Skip to content

Commit 811ae81

Browse files
khfenggregkh
authored andcommitted
xhci: Remove CONFIG_USB_DEFAULT_PERSIST to prevent xHCI from runtime suspending
When the xHCI is quirked with XHCI_RESET_ON_RESUME, runtime resume routine also resets the controller. This is bad for USB drivers without reset_resume callback, because there's no subsequent call of usb_dev_complete() -> usb_resume_complete() to force rebinding the driver to the device. For instance, btusb device stops working after xHCI controller is runtime resumed, if the controlled is quirked with XHCI_RESET_ON_RESUME. So always take XHCI_RESET_ON_RESUME into account to solve the issue. Cc: <[email protected]> Signed-off-by: Kai-Heng Feng <[email protected]> Signed-off-by: Mathias Nyman <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Greg Kroah-Hartman <[email protected]>
1 parent 6a97cee commit 811ae81

File tree

1 file changed

+0
-4
lines changed

1 file changed

+0
-4
lines changed

drivers/usb/host/xhci.c

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3934,15 +3934,13 @@ static void xhci_free_dev(struct usb_hcd *hcd, struct usb_device *udev)
39343934
struct xhci_slot_ctx *slot_ctx;
39353935
int i, ret;
39363936

3937-
#ifndef CONFIG_USB_DEFAULT_PERSIST
39383937
/*
39393938
* We called pm_runtime_get_noresume when the device was attached.
39403939
* Decrement the counter here to allow controller to runtime suspend
39413940
* if no devices remain.
39423941
*/
39433942
if (xhci->quirks & XHCI_RESET_ON_RESUME)
39443943
pm_runtime_put_noidle(hcd->self.controller);
3945-
#endif
39463944

39473945
ret = xhci_check_args(hcd, udev, NULL, 0, true, __func__);
39483946
/* If the host is halted due to driver unload, we still need to free the
@@ -4094,14 +4092,12 @@ int xhci_alloc_dev(struct usb_hcd *hcd, struct usb_device *udev)
40944092

40954093
xhci_debugfs_create_slot(xhci, slot_id);
40964094

4097-
#ifndef CONFIG_USB_DEFAULT_PERSIST
40984095
/*
40994096
* If resetting upon resume, we can't put the controller into runtime
41004097
* suspend if there is a device attached.
41014098
*/
41024099
if (xhci->quirks & XHCI_RESET_ON_RESUME)
41034100
pm_runtime_get_noresume(hcd->self.controller);
4104-
#endif
41054101

41064102
/* Is this a LS or FS device under a HS hub? */
41074103
/* Hub or peripherial? */

0 commit comments

Comments
 (0)