Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

Bluetooth: btusb: Revert Fix the autosuspend enable and disable

drivers/usb/core/hub.c: usb_new_device() contains the following:

/* By default, forbid autosuspend for all devices. It will be
* allowed for hubs during binding.
*/
usb_disable_autosuspend(udev);

So for anything which is not a hub, such as btusb devices, autosuspend is
disabled by default and we must call usb_enable_autosuspend(udev) to
enable it.

This means that the "Fix the autosuspend enable and disable" commit,
which drops the usb_enable_autosuspend() call when the enable_autosuspend
module option is true, is completely wrong, revert it.

This reverts commit 7bd9fb058d77213130e4b3e594115c028b708e7e.

Cc: Hui Wang <hui.wang@canonical.com>
Fixes: 7bd9fb058d77 ("Bluetooth: btusb: Fix the autosuspend enable and disable")
Acked-by: Hui Wang <hui.wang@canonical.com>
Acked-by: Marcel Holtmann <marcel@holtmann.org>
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>

authored by

Hans de Goede and committed by
Linus Torvalds
89591522 17e7124a

+2 -5
+2 -5
drivers/bluetooth/btusb.c
··· 4849 4849 data->diag = NULL; 4850 4850 } 4851 4851 4852 - if (!enable_autosuspend) 4853 - usb_disable_autosuspend(data->udev); 4852 + if (enable_autosuspend) 4853 + usb_enable_autosuspend(data->udev); 4854 4854 4855 4855 err = hci_register_dev(hdev); 4856 4856 if (err < 0) ··· 4910 4910 gpiod_put(data->reset_gpio); 4911 4911 4912 4912 hci_free_dev(hdev); 4913 - 4914 - if (!enable_autosuspend) 4915 - usb_enable_autosuspend(data->udev); 4916 4913 } 4917 4914 4918 4915 #ifdef CONFIG_PM