Skip to contentSkip to conversation

usb: host: xhci-dbg: HCIVERSION should be a binary number

PATCH New Mathias Nyman 1 participant 2 messages Mar 9, 2017 1 message not in the archive

Subsystems (3)
lore
Share & tools
lore
#1 lore raw

PATCH 3/4 usb: host: xhci-dbg: HCIVERSION should be a binary number

In reply to a message not in the archive

From: Peter Chen <[email protected]>

According to xHCI spec, HCIVERSION containing a BCD encoding of the xHCI specification revision number, 0100h corresponds to xHCI version 1.0. Change "100" as "0x100".

Cc Lu Baolu <[email protected]>
Cc stable <[email protected]>
Fixes 04abb6de2825 ("xhci: Read and parse new xhci

1.1 capability register")

---
 drivers/usb/host/xhci-dbg.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/usb/host/xhci-dbg.c +1 -1
index 363d125..2b4a00f 100644
@@ -109,7 +109,7 @@ static void xhci_print_cap_regs(struct xhci_hcd *xhci)
 	xhci_dbg(xhci, "RTSOFF 0x%x:\n", temp & RTSOFF_MASK);
 
 	/* xhci 1.1 controllers have the HCCPARAMS2 register */
-	if (hci_version > 100) {
+	if (hci_version > 0x100) {
 		temp = readl(&xhci->cap_regs->hcc_params2);
 		xhci_dbg(xhci, "HCC PARAMS2 0x%x:\n", (unsigned int) temp);
 		xhci_dbg(xhci, "  HC %s Force save context capability",
Signature · 1 line
1.9.1
#2 lore raw

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

In reply to a message not in the archive

From: Guenter Roeck <[email protected]>

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 6d33b42..bd02a6c 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
1.9.1