]> git.proxmox.com Git - mirror_ubuntu-zesty-kernel.git/commitdiff
usb: host: xhci-plat: Fix timeout on removal of hot pluggable xhci controllers
authorGuenter Roeck <linux@roeck-us.net>
Thu, 9 Mar 2017 13:39:37 +0000 (15:39 +0200)
committerTim Gardner <tim.gardner@canonical.com>
Mon, 20 Mar 2017 11:24:55 +0000 (05:24 -0600)
BugLink: http://bugs.launchpad.net/bugs/1674288
commit dcc7620cad5ad1326a78f4031a7bf4f0e5b42984 upstream.

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.

Signed-off-by: Guenter Roeck <linux@roeck-us.net>
Signed-off-by: Mathias Nyman <mathias.nyman@linux.intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Tim Gardner <tim.gardner@canonical.com>
drivers/usb/host/xhci-plat.c

index c0cd98e804a39451aa07e6721f530e95eca0fc4d..9715200eb36e4d3621c6015e301d5fd53a4a8527 100644 (file)
@@ -283,6 +283,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);