On 2021/3/26 19:59, LeoLiu-oc wrote:
Some Zhaoxin xHCI controllers follow usb3.1 spec, but only support gen1 speed 5G. While in Linux kernel, if xHCI suspport usb3.1,root hub speed will show on 10G. To fix this issue, read usb speed ID supported by xHCI to determine root hub speed.
The patch is scheduled to be submitted to the kernel mainline in 2021.
v1->v2: - Use quirks instead of vendor id.
Signed-off-by: LeoLiu-oc LeoLiu-oc@zhaoxin.com
drivers/usb/host/xhci.c | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+)
diff --git a/drivers/usb/host/xhci.c b/drivers/usb/host/xhci.c index fad995b5635e..a26d4040a761 100644 --- a/drivers/usb/host/xhci.c +++ b/drivers/usb/host/xhci.c @@ -5079,6 +5079,7 @@ int xhci_gen_setup(struct usb_hcd *hcd, xhci_get_quirks_t get_quirks) */ struct device *dev = hcd->self.sysdev; unsigned int minor_rev; + u8 i, j; int retval;
/* Accept arbitrarily long scatter-gather lists */ @@ -5133,6 +5134,24 @@ int xhci_gen_setup(struct usb_hcd *hcd, xhci_get_quirks_t get_quirks) hcd->self.root_hub->speed = USB_SPEED_SUPER_PLUS; break; }
+ /* usb3.1 has gen1 and gen2, Some zx's xHCI controller that follow usb3.1 spec + * but only support gen1 + */ + if (xhci->quirks == XHCI_ZHAOXIN_HOST) {
Same here, should it be xhci->quirks & XHCI_ZHAOXIN_HOST ?
Thanks Hanjun