Patch "usb: xhci: Fix port minor revision" has been added to the 5.4-stable tree

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



This is a note to let you know that I've just added the patch titled

    usb: xhci: Fix port minor revision

to the 5.4-stable tree which can be found at:
    http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary

The filename of the patch is:
     usb-xhci-fix-port-minor-revision.patch
and it can be found in the queue-5.4 subdirectory.

If you, or anyone else, feels it should not be added to the stable tree,
please let <stable@xxxxxxxxxxxxxxx> know about it.



commit 6b60fa57e4673103d3af81a52bc45ec458695915
Author: Thinh Nguyen <Thinh.Nguyen@xxxxxxxxxxxx>
Date:   Wed Mar 10 19:43:21 2021 -0800

    usb: xhci: Fix port minor revision
    
    [ Upstream commit 64364bc912c01b33bba6c22e3ccb849bfca96398 ]
    
    Some hosts incorrectly use sub-minor version for minor version (i.e.
    0x02 instead of 0x20 for bcdUSB 0x320 and 0x01 for bcdUSB 0x310).
    Currently the xHCI driver works around this by just checking for minor
    revision > 0x01 for USB 3.1 everywhere. With the addition of USB 3.2,
    checking this gets a bit cumbersome. Since there is no USB release with
    bcdUSB 0x301 to 0x309, we can assume that sub-minor version 01 to 09 is
    incorrect. Let's try to fix this and use the minor revision that matches
    with the USB/xHCI spec to help with the version checking within the
    driver.
    
    Acked-by: Mathias Nyman <mathias.nyman@xxxxxxxxxxxxxxx>
    Signed-off-by: Thinh Nguyen <Thinh.Nguyen@xxxxxxxxxxxx>
    Link: https://lore.kernel.org/r/ed330e95a19dc367819c5b4d78bf7a541c35aa0a.1615432770.git.Thinh.Nguyen@xxxxxxxxxxxx
    Signed-off-by: Greg Kroah-Hartman <gregkh@xxxxxxxxxxxxxxxxxxx>
    Signed-off-by: Sasha Levin <sashal@xxxxxxxxxx>

diff --git a/drivers/usb/host/xhci-mem.c b/drivers/usb/host/xhci-mem.c
index 9764122c9cdf..7f9f302a73cd 100644
--- a/drivers/usb/host/xhci-mem.c
+++ b/drivers/usb/host/xhci-mem.c
@@ -2134,6 +2134,15 @@ static void xhci_add_in_port(struct xhci_hcd *xhci, unsigned int num_ports,
 
 	if (major_revision == 0x03) {
 		rhub = &xhci->usb3_rhub;
+		/*
+		 * Some hosts incorrectly use sub-minor version for minor
+		 * version (i.e. 0x02 instead of 0x20 for bcdUSB 0x320 and 0x01
+		 * for bcdUSB 0x310). Since there is no USB release with sub
+		 * minor version 0x301 to 0x309, we can assume that they are
+		 * incorrect and fix it here.
+		 */
+		if (minor_revision > 0x00 && minor_revision < 0x10)
+			minor_revision <<= 4;
 	} else if (major_revision <= 0x02) {
 		rhub = &xhci->usb2_rhub;
 	} else {



[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux