Return-Path: Received: from mga01.intel.com ([192.55.52.88]:36468 "EHLO mga01.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754891AbdCINiE (ORCPT ); Thu, 9 Mar 2017 08:38:04 -0500 From: Mathias Nyman To: Cc: , Guenter Roeck , stable , Mathias Nyman Subject: [PATCH 4/4] usb: host: xhci-plat: Fix timeout on removal of hot pluggable xhci controllers Date: Thu, 9 Mar 2017 15:39:37 +0200 Message-Id: <1489066777-12597-5-git-send-email-mathias.nyman@linux.intel.com> In-Reply-To: <1489066777-12597-1-git-send-email-mathias.nyman@linux.intel.com> References: <1489066777-12597-1-git-send-email-mathias.nyman@linux.intel.com> Sender: stable-owner@vger.kernel.org List-ID: From: 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. The solution for PCI devices works just as well for non-PCI devices and avoids the problem. Signed-off-by: Guenter Roeck Cc: stable Signed-off-by: Mathias Nyman --- drivers/usb/host/xhci-plat.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/usb/host/xhci-plat.c b/drivers/usb/host/xhci-plat.c index 6d33b42..bd02a6c 100644 --- a/drivers/usb/host/xhci-plat.c +++ b/drivers/usb/host/xhci-plat.c @@ -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); -- 1.9.1