Skip to contentSkip to conversation

usb: host: xhci-plat: Fix timeout on removal of hot pluggable xhci controllers

PATCH In review Guenter Roeck 2 participants 2 messages Mar 8, 2017 – Mar 9, 2017

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 usb: host: xhci-plat: Fix timeout on removal of hot pluggable xhci controllers

Upstream commit 98d74f9ceaef ("xhci: fix 10 second timeout on removal of PCI hotpluggable xhci controllers") fixes a problem with hot pluggable PCI xhci controllers which can result in excessive timeouts, to the point where the system reports a deadlock.

The same problem is seen with hot pluggable xhci controllers using the xhci-plat driver, such as the driver used for Type-C ports on rk3399. Similar to hot-pluggable PCI controllers, the driver for this chip removes the xhci controller from the system when the Type-C cable is disconnected.

The solution for PCI devices works just as well for non-PCI devices and avoids the problem.

---
 drivers/usb/host/xhci-plat.c | 2 ++
 1 file changed, 2 insertions(+)
drivers/usb/host/xhci-plat.c +2 -0
index 6d33b42ffcf5..bd02a6cd8e2c 100644
@@ -286,6 +286,8 @@ static int xhci_plat_remove(struct platform_device *dev)
 	struct xhci_hcd	*xhci = hcd_to_xhci(hcd);
 	struct clk *clk = xhci->clk;
 
+	xhci->xhc_state |= XHCI_STATE_REMOVING;
+
 	usb_remove_hcd(xhci->shared_hcd);
 	usb_phy_shutdown(hcd->usb_phy);
 
Signature · 1 line
2.7.4
#1 lore raw
Quoted 11 lines · Guenter Roeck

Upstream commit 98d74f9ceaef ("xhci: fix 10 second timeout on removal of PCI hotpluggable xhci controllers") fixes a problem with hot pluggable PCI xhci controllers which can result in excessive timeouts, to the point where the system reports a deadlock.

The same problem is seen with hot pluggable xhci controllers using the xhci-plat driver, such as the driver used for Type-C ports on rk3399. Similar to hot-pluggable PCI controllers, the driver for this chip removes the xhci controller from the system when the Type-C cable is disconnected.

Quoted 5 lines

The solution for PCI devices works just as well for non-PCI devices and avoids the problem.

---

Thanks, adding to queue

-Mathias