Linux bluetooth development
 help / color / mirror / Atom feed
* [PATCH 5.12 regression fix 0/1] Bluetooth: btusb: Revert Fix the autosuspend enable and disable
@ 2021-04-09 13:58 Hans de Goede
  2021-04-09 13:58 ` [PATCH 5.12 regression fix 1/1] " Hans de Goede
  0 siblings, 1 reply; 5+ messages in thread
From: Hans de Goede @ 2021-04-09 13:58 UTC (permalink / raw)
  To: Linus Torvalds; +Cc: Hans de Goede, Marcel Holtmann, Hui Wang, linux-bluetooth

Hi Linus,

Since we are already at 5.12-rc6, Marcel Holtmann has asked me to send
this patch to you directly.

It has his Acked-by to indicate that he is ok with the fix (and it also
has an Acked-by of the author of the original patch which this reverts).

Regards,

Hans


Hans de Goede (1):
  Bluetooth: btusb: Revert Fix the autosuspend enable and disable

 drivers/bluetooth/btusb.c | 7 ++-----
 1 file changed, 2 insertions(+), 5 deletions(-)

-- 
2.30.2


^ permalink raw reply	[flat|nested] 5+ messages in thread
* [PATCH 5.12 regression fix resend 1/1] Bluetooth: btusb: Revert Fix the autosuspend enable and disable
@ 2021-04-05 20:35 Hans de Goede
  2021-04-05 21:09 ` bluez.test.bot
  0 siblings, 1 reply; 5+ messages in thread
From: Hans de Goede @ 2021-04-05 20:35 UTC (permalink / raw)
  To: Marcel Holtmann, Johan Hedberg, Luiz Augusto von Dentz
  Cc: Hans de Goede, Hui Wang, linux-bluetooth

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>
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
---
 drivers/bluetooth/btusb.c | 7 ++-----
 1 file changed, 2 insertions(+), 5 deletions(-)

diff --git a/drivers/bluetooth/btusb.c b/drivers/bluetooth/btusb.c
index 52683fd22e05..5cbfbd948f67 100644
--- a/drivers/bluetooth/btusb.c
+++ b/drivers/bluetooth/btusb.c
@@ -4849,8 +4849,8 @@ static int btusb_probe(struct usb_interface *intf,
 			data->diag = NULL;
 	}
 
-	if (!enable_autosuspend)
-		usb_disable_autosuspend(data->udev);
+	if (enable_autosuspend)
+		usb_enable_autosuspend(data->udev);
 
 	err = hci_register_dev(hdev);
 	if (err < 0)
@@ -4910,9 +4910,6 @@ static void btusb_disconnect(struct usb_interface *intf)
 		gpiod_put(data->reset_gpio);
 
 	hci_free_dev(hdev);
-
-	if (!enable_autosuspend)
-		usb_enable_autosuspend(data->udev);
 }
 
 #ifdef CONFIG_PM
-- 
2.30.2


^ permalink raw reply related	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2021-04-09 15:12 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2021-04-09 13:58 [PATCH 5.12 regression fix 0/1] Bluetooth: btusb: Revert Fix the autosuspend enable and disable Hans de Goede
2021-04-09 13:58 ` [PATCH 5.12 regression fix 1/1] " Hans de Goede
2021-04-09 15:12   ` bluez.test.bot
  -- strict thread matches above, loose matches on Subject: below --
2021-04-05 20:35 [PATCH 5.12 regression fix resend 1/1] " Hans de Goede
2021-04-05 21:09 ` bluez.test.bot
2021-04-05 21:13   ` Hans de Goede

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox