linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] Bluetooth: btusb: Disable runtime suspend on Realtek devices
@ 2019-12-05  9:07 Kai-Heng Feng
  2019-12-05  9:32 ` Marcel Holtmann
  0 siblings, 1 reply; 2+ messages in thread
From: Kai-Heng Feng @ 2019-12-05  9:07 UTC (permalink / raw)
  To: marcel, johan.hedberg
  Cc: alex_lu, pkshih, linux-bluetooth, linux-kernel, Kai-Heng Feng

After commit 9e45524a0111 ("Bluetooth: btusb: Fix suspend issue for
Realtek devices") both WiFi and Bluetooth stop working after reboot:
[   34.322617] usb 1-8: reset full-speed USB device number 3 using xhci_hcd
[   34.450401] usb 1-8: device descriptor read/64, error -71
[   34.694375] usb 1-8: device descriptor read/64, error -71
...
[   44.599111] rtw_pci 0000:02:00.0: failed to poll offset=0x5 mask=0x3 value=0x0
[   44.599113] rtw_pci 0000:02:00.0: mac power on failed
[   44.599114] rtw_pci 0000:02:00.0: failed to power on mac
[   44.599114] rtw_pci 0000:02:00.0: leave idle state failed
[   44.599492] rtw_pci 0000:02:00.0: failed to leave ips state
[   44.599493] rtw_pci 0000:02:00.0: failed to leave idle state

That commit removed USB_QUIRK_RESET_RESUME, which not only resets the USB
device after resume, it also prevents the device from being runtime
suspended by USB core. My experiment shows if the Realtek btusb device
ever runtime suspends once, the entire wireless module becomes useless
after reboot.

So let's explicitly disable runtime suspend on Realtek btusb device for
now.

Fixes: 9e45524a0111 ("Bluetooth: btusb: Fix suspend issue for Realtek devices")
Signed-off-by: Kai-Heng Feng <kai.heng.feng@canonical.com>
---
 drivers/bluetooth/btusb.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/drivers/bluetooth/btusb.c b/drivers/bluetooth/btusb.c
index d9cd0677d41c..0eaeca0a64fb 100644
--- a/drivers/bluetooth/btusb.c
+++ b/drivers/bluetooth/btusb.c
@@ -3832,6 +3832,10 @@ static int btusb_probe(struct usb_interface *intf,
 		 * (DEVICE_REMOTE_WAKEUP)
 		 */
 		set_bit(BTUSB_WAKEUP_DISABLE, &data->flags);
+
+		err = usb_autopm_get_interface(intf);
+		if (err < 0)
+			goto out_free_dev;
 	}
 
 	if (id->driver_info & BTUSB_AMP) {
-- 
2.17.1


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

* Re: [PATCH] Bluetooth: btusb: Disable runtime suspend on Realtek devices
  2019-12-05  9:07 [PATCH] Bluetooth: btusb: Disable runtime suspend on Realtek devices Kai-Heng Feng
@ 2019-12-05  9:32 ` Marcel Holtmann
  0 siblings, 0 replies; 2+ messages in thread
From: Marcel Holtmann @ 2019-12-05  9:32 UTC (permalink / raw)
  To: Kai-Heng Feng
  Cc: Johan Hedberg, Alex Lu, pkshih, linux-bluetooth, linux-kernel

Hi Kai-Heng,

> After commit 9e45524a0111 ("Bluetooth: btusb: Fix suspend issue for
> Realtek devices") both WiFi and Bluetooth stop working after reboot:
> [   34.322617] usb 1-8: reset full-speed USB device number 3 using xhci_hcd
> [   34.450401] usb 1-8: device descriptor read/64, error -71
> [   34.694375] usb 1-8: device descriptor read/64, error -71
> ...
> [   44.599111] rtw_pci 0000:02:00.0: failed to poll offset=0x5 mask=0x3 value=0x0
> [   44.599113] rtw_pci 0000:02:00.0: mac power on failed
> [   44.599114] rtw_pci 0000:02:00.0: failed to power on mac
> [   44.599114] rtw_pci 0000:02:00.0: leave idle state failed
> [   44.599492] rtw_pci 0000:02:00.0: failed to leave ips state
> [   44.599493] rtw_pci 0000:02:00.0: failed to leave idle state
> 
> That commit removed USB_QUIRK_RESET_RESUME, which not only resets the USB
> device after resume, it also prevents the device from being runtime
> suspended by USB core. My experiment shows if the Realtek btusb device
> ever runtime suspends once, the entire wireless module becomes useless
> after reboot.
> 
> So let's explicitly disable runtime suspend on Realtek btusb device for
> now.
> 
> Fixes: 9e45524a0111 ("Bluetooth: btusb: Fix suspend issue for Realtek devices")
> Signed-off-by: Kai-Heng Feng <kai.heng.feng@canonical.com>
> ---
> drivers/bluetooth/btusb.c | 4 ++++
> 1 file changed, 4 insertions(+)

patch has been applied to bluetooth-next tree.

Regards

Marcel


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

end of thread, other threads:[~2019-12-05  9:32 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-12-05  9:07 [PATCH] Bluetooth: btusb: Disable runtime suspend on Realtek devices Kai-Heng Feng
2019-12-05  9:32 ` Marcel Holtmann

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).