Skip to content

Commit 4084286

Browse files
committed
Bluetooth: btusb: Fix not being able to reconnect after suspend
This partially reverts 81b3e33bb054 ("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]>
1 parent 1db4564 commit 4084286

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
@@ -4038,7 +4038,6 @@ static void btusb_disconnect(struct usb_interface *intf)
40384038
static int btusb_suspend(struct usb_interface *intf, pm_message_t message)
40394039
{
40404040
struct btusb_data *data = usb_get_intfdata(intf);
4041-
int err;
40424041

40434042
BT_DBG("intf %p", intf);
40444043

@@ -4051,24 +4050,13 @@ static int btusb_suspend(struct usb_interface *intf, pm_message_t message)
40514050
if (data->suspend_count++)
40524051
return 0;
40534052

4054-
/* Notify Host stack to suspend; this has to be done before stopping
4055-
* the traffic since the hci_suspend_dev itself may generate some
4056-
* traffic.
4057-
*/
4058-
err = hci_suspend_dev(data->hdev);
4059-
if (err) {
4060-
data->suspend_count--;
4061-
return err;
4062-
}
4063-
40644053
spin_lock_irq(&data->txlock);
40654054
if (!(PMSG_IS_AUTO(message) && data->tx_in_flight)) {
40664055
set_bit(BTUSB_SUSPENDING, &data->flags);
40674056
spin_unlock_irq(&data->txlock);
40684057
} else {
40694058
spin_unlock_irq(&data->txlock);
40704059
data->suspend_count--;
4071-
hci_resume_dev(data->hdev);
40724060
return -EBUSY;
40734061
}
40744062

@@ -4189,8 +4177,6 @@ static int btusb_resume(struct usb_interface *intf)
41894177
spin_unlock_irq(&data->txlock);
41904178
schedule_work(&data->work);
41914179

4192-
hci_resume_dev(data->hdev);
4193-
41944180
return 0;
41954181

41964182
failed:

0 commit comments

Comments
 (0)