Skip to content

Commit 52c9ab5

Browse files
Vudentzheftig
authored andcommitted
Bluetooth: btusb: Fix not being able to reconnect after suspend
This partially reverts 81b3e33 ("Bluetooth: btusb: Don't fail external suspend requests") as it introduced a call to hci_suspend_dev that assumes the system-suspend which doesn't work well when just the device is being suspended because wakeup flag is only set for remote devices that can wakeup the system. Reported-by: Rafael J. Wysocki <[email protected]> Reported-by: Heiner Kallweit <[email protected]> Reported-by: Kenneth Crudup <[email protected]> Fixes: 6107122 ("Bluetooth: btusb: Don't fail external suspend requests") Signed-off-by: Luiz Augusto von Dentz <[email protected]> Tested-by: Rafael J. Wysocki <[email protected]> Cherry-picked-for: https://gitlab.archlinux.org/archlinux/packaging/packages/linux/-/issues/86
1 parent 8195636 commit 52c9ab5

File tree

1 file changed

+0
-14
lines changed

1 file changed

+0
-14
lines changed

drivers/bluetooth/btusb.c

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -4092,7 +4092,6 @@ static void btusb_disconnect(struct usb_interface *intf)
40924092
static int btusb_suspend(struct usb_interface *intf, pm_message_t message)
40934093
{
40944094
struct btusb_data *data = usb_get_intfdata(intf);
4095-
int err;
40964095

40974096
BT_DBG("intf %p", intf);
40984097

@@ -4105,24 +4104,13 @@ static int btusb_suspend(struct usb_interface *intf, pm_message_t message)
41054104
if (data->suspend_count++)
41064105
return 0;
41074106

4108-
/* Notify Host stack to suspend; this has to be done before stopping
4109-
* the traffic since the hci_suspend_dev itself may generate some
4110-
* traffic.
4111-
*/
4112-
err = hci_suspend_dev(data->hdev);
4113-
if (err) {
4114-
data->suspend_count--;
4115-
return err;
4116-
}
4117-
41184107
spin_lock_irq(&data->txlock);
41194108
if (!(PMSG_IS_AUTO(message) && data->tx_in_flight)) {
41204109
set_bit(BTUSB_SUSPENDING, &data->flags);
41214110
spin_unlock_irq(&data->txlock);
41224111
} else {
41234112
spin_unlock_irq(&data->txlock);
41244113
data->suspend_count--;
4125-
hci_resume_dev(data->hdev);
41264114
return -EBUSY;
41274115
}
41284116

@@ -4243,8 +4231,6 @@ static int btusb_resume(struct usb_interface *intf)
42434231
spin_unlock_irq(&data->txlock);
42444232
schedule_work(&data->work);
42454233

4246-
hci_resume_dev(data->hdev);
4247-
42484234
return 0;
42494235

42504236
failed:

0 commit comments

Comments
 (0)