From: YD Tseng <yd_ts...@asmedia.com.tw>

Hi Greg and Mathias,

This patch works around for parsing extended speed protocol lists. 
If the xHCI controller supports USB 3.1 and 3.0 extended speed protocol,
it could show as one 3.1 roothub.

Changes since v1:
- change diff path

Signed-off-by: YD Tseng <yd_ts...@asmedia.com.tw>

---

diff -up linux/drivers/usb/host/xhci-mem.c{.orig,} > /tmp/patch
--- linux/drivers/usb/host/xhci-mem.c.orig      2017-04-08 15:35:38.000000000 
+0800
+++ linux/drivers/usb/host/xhci-mem.c   2017-05-22 11:56:21.362907677 +0800
@@ -2111,11 +2111,12 @@ static void xhci_add_in_port(struct xhci
 {
        u32 temp, port_offset, port_count;
        int i;
-       u8 major_revision;
+       u8 major_revision, minor_revision;
        struct xhci_hub *rhub;

        temp = readl(addr);
        major_revision = XHCI_EXT_PORT_MAJOR(temp);
+       minor_revision = XHCI_EXT_PORT_MINOR(temp);

        if (major_revision == 0x03) {
                rhub = &xhci->usb3_rhub;
@@ -2129,7 +2130,9 @@ static void xhci_add_in_port(struct xhci
                return;
        }
        rhub->maj_rev = XHCI_EXT_PORT_MAJOR(temp);
-       rhub->min_rev = XHCI_EXT_PORT_MINOR(temp);
+
+       if (rhub->min_rev < minor_revision)
+               rhub->min_rev = minor_revision;

        /* Port offset and count in the third dword, see section 7.2 */
        temp = readl(addr + 2);
@@ -2280,6 +2283,8 @@ static int xhci_setup_port_arrays(struct

        offset = cap_start;

+       xhci->usb3_rhub.min_rev = 0;
+       xhci->usb2_rhub.min_rev = 0;
        while (offset) {
                xhci_add_in_port(xhci, num_ports, base + offset, cap_count);
                if (xhci->num_usb2_ports + xhci->num_usb3_ports == num_ports)
--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to