]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
Bluetooth: btusb: Fix not being able to reconnect after suspend
authorLuiz Augusto von Dentz <luiz.von.dentz@intel.com>
Mon, 14 Oct 2024 20:23:26 +0000 (16:23 -0400)
committerLuiz Augusto von Dentz <luiz.von.dentz@intel.com>
Wed, 16 Oct 2024 20:09:43 +0000 (16:09 -0400)
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 <rafael@kernel.org>
Reported-by: Heiner Kallweit <hkallweit1@gmail.com>
Reported-by: Kenneth Crudup <kenny@panix.com>
Fixes: 610712298b11 ("Bluetooth: btusb: Don't fail external suspend requests")
Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
Tested-by: Rafael J. Wysocki <rafael@kernel.org>
drivers/bluetooth/btusb.c

index a3e45b3060d1de9c7da5d4a602c2384a8af9c8b1..33d655e7d1248eb7da693a0dd7729c26cebc1b79 100644 (file)
@@ -4038,7 +4038,6 @@ static void btusb_disconnect(struct usb_interface *intf)
 static int btusb_suspend(struct usb_interface *intf, pm_message_t message)
 {
        struct btusb_data *data = usb_get_intfdata(intf);
-       int err;
 
        BT_DBG("intf %p", intf);
 
@@ -4051,16 +4050,6 @@ static int btusb_suspend(struct usb_interface *intf, pm_message_t message)
        if (data->suspend_count++)
                return 0;
 
-       /* Notify Host stack to suspend; this has to be done before stopping
-        * the traffic since the hci_suspend_dev itself may generate some
-        * traffic.
-        */
-       err = hci_suspend_dev(data->hdev);
-       if (err) {
-               data->suspend_count--;
-               return err;
-       }
-
        spin_lock_irq(&data->txlock);
        if (!(PMSG_IS_AUTO(message) && data->tx_in_flight)) {
                set_bit(BTUSB_SUSPENDING, &data->flags);
@@ -4068,7 +4057,6 @@ static int btusb_suspend(struct usb_interface *intf, pm_message_t message)
        } else {
                spin_unlock_irq(&data->txlock);
                data->suspend_count--;
-               hci_resume_dev(data->hdev);
                return -EBUSY;
        }
 
@@ -4189,8 +4177,6 @@ static int btusb_resume(struct usb_interface *intf)
        spin_unlock_irq(&data->txlock);
        schedule_work(&data->work);
 
-       hci_resume_dev(data->hdev);
-
        return 0;
 
 failed: