]> git.ipfire.org Git - thirdparty/kernel/stable.git/commitdiff
usb: xhci: bInterval quirk for TI TUSB73x0
authorRoger Quadros <rogerq@ti.com>
Fri, 7 Apr 2017 14:57:12 +0000 (17:57 +0300)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sat, 20 May 2017 12:30:55 +0000 (14:30 +0200)
commit 69307ccb9ad7ccb653e332de68effdeaaab6907d upstream.

As per [1] issue #4,
"The periodic EP scheduler always tries to schedule the EPs
that have large intervals (interval equal to or greater than
128 microframes) into different microframes. So it maintains
an internal counter and increments for each large interval
EP added. When the counter is greater than 128, the scheduler
rejects the new EP. So when the hub re-enumerated 128 times,
it triggers this condition."

This results in Bandwidth error when devices with periodic
endpoints (ISO/INT) having bInterval > 7 are plugged and
unplugged several times on a TUSB73x0 XHCI host.

Workaround this issue by limiting the bInterval to 7
(i.e. interval to 6) for High-speed or faster periodic endpoints.

[1] - http://www.ti.com/lit/er/sllz076/sllz076.pdf

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-mem.c
drivers/usb/host/xhci-pci.c
drivers/usb/host/xhci.h

index 8414ed2a02de98b08ccadbe375d75b93da59cd35..27830b683f716254fc6b74b24350e655f1b998c9 100644 (file)
@@ -1493,6 +1493,17 @@ int xhci_endpoint_init(struct xhci_hcd *xhci,
         */
        max_esit_payload = xhci_get_max_esit_payload(udev, ep);
        interval = xhci_get_endpoint_interval(udev, ep);
+
+       /* Periodic endpoint bInterval limit quirk */
+       if (usb_endpoint_xfer_int(&ep->desc) ||
+           usb_endpoint_xfer_isoc(&ep->desc)) {
+               if ((xhci->quirks & XHCI_LIMIT_ENDPOINT_INTERVAL_7) &&
+                   udev->speed >= USB_SPEED_HIGH &&
+                   interval >= 7) {
+                       interval = 6;
+               }
+       }
+
        mult = xhci_get_endpoint_mult(udev, ep);
        max_packet = usb_endpoint_maxp(&ep->desc);
        max_burst = xhci_get_endpoint_max_burst(udev, ep);
index 954abfd5014d281d537e11353cb6093b9b7a0bdd..93f566cb968b1764983f04cd34c45ed40bd6c8fd 100644 (file)
@@ -199,6 +199,9 @@ static void xhci_pci_quirks(struct device *dev, struct xhci_hcd *xhci)
                        pdev->device == 0x1042)
                xhci->quirks |= XHCI_BROKEN_STREAMS;
 
+       if (pdev->vendor == PCI_VENDOR_ID_TI && pdev->device == 0x8241)
+               xhci->quirks |= XHCI_LIMIT_ENDPOINT_INTERVAL_7;
+
        if (xhci->quirks & XHCI_RESET_ON_RESUME)
                xhci_dbg_trace(xhci, trace_xhci_dbg_quirks,
                                "QUIRK: Resetting on resume");
index ea18bf49c2eb0d31bfb85f2a7750b23624ff3b0c..98eb5d50e03db5c14cf49959dbb8326319dce241 100644 (file)
@@ -1652,6 +1652,7 @@ struct xhci_hcd {
 #define XHCI_MISSING_CAS       (1 << 24)
 /* For controller with a broken Port Disable implementation */
 #define XHCI_BROKEN_PORT_PED   (1 << 25)
+#define XHCI_LIMIT_ENDPOINT_INTERVAL_7 (1 << 26)
 
        unsigned int            num_active_eps;
        unsigned int            limit_active_eps;