usb: xhci: add quirk flag for broken PED bits
authorFelipe Balbi <balbi@ti.com>
Mon, 23 Jan 2017 12:19:58 +0000 (14:19 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 25 Jan 2017 09:57:35 +0000 (10:57 +0100)
Some devices from Texas Instruments [1] suffer from
a silicon bug where Port Enabled/Disabled bit
should not be used to silence an erroneous device.

The bug is so that if port is disabled with PED
bit, an IRQ for device removal (or attachment)
will never fire.

Just for the sake of completeness, the actual
problem lies with SNPS USB IP and this affects
all known versions up to 3.00a. A separate
patch will be added to dwc3 to enabled this
quirk flag if version is <= 3.00a.

[1] - AM572x Silicon Errata http://www.ti.com/lit/er/sprz429j/sprz429j.pdf
Section i896— USB xHCI Port Disable Feature Does Not Work

Signed-off-by: Felipe Balbi <balbi@ti.com>
Signed-off-by: Roger Quadros <rogerq@ti.com>
Signed-off-by: Mathias Nyman <mathias.nyman@linux.intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/usb/host/xhci-hub.c
drivers/usb/host/xhci.h

index 2d154e27c1429ef97370164b6cbe05f3dc727cb6..8b906c3683c38b4ff10d64104d78182854bfb42a 100644 (file)
@@ -458,6 +458,12 @@ static void xhci_disable_port(struct usb_hcd *hcd, struct xhci_hcd *xhci,
                return;
        }
 
+       if (xhci->quirks & XHCI_BROKEN_PORT_PED) {
+               xhci_dbg(xhci,
+                        "Broken Port Enabled/Disabled, ignoring port disable request.\n");
+               return;
+       }
+
        /* Write 1 to disable the port */
        writel(port_status | PORT_PE, addr);
        port_status = readl(addr);
index 5bf9df25e2eaa9bf322f01751630d6262b2798ea..b8474a2e6e5dc67897b820d7c837811d27b0d775 100644 (file)
@@ -1648,6 +1648,9 @@ struct xhci_hcd {
 #define XHCI_SSIC_PORT_UNUSED  (1 << 22)
 #define XHCI_NO_64BIT_SUPPORT  (1 << 23)
 #define XHCI_MISSING_CAS       (1 << 24)
+/* For controller with a broken Port Disable implementation */
+#define XHCI_BROKEN_PORT_PED   (1 << 25)
+
        unsigned int            num_active_eps;
        unsigned int            limit_active_eps;
        /* There are two roothubs to keep track of bus suspend info for */