Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

usb: dwc3: core: Set force_gen1 bit for all applicable SuperSpeed ports

Currently if the maximum-speed is set to Super Speed for a 3.1 Gen2
capable controller, the FORCE_GEN1 bit of LLUCTL register is set only
for one SuperSpeed port (or the first port) present. Modify the logic
to set the FORCE_GEN1 bit for all ports if speed is being limited to
Gen-1.

Suggested-by: Thinh Nguyen <Thinh.Nguyen@synopsys.com>
Signed-off-by: Krishna Kurapati <quic_kriskura@quicinc.com>
Acked-by: Thinh Nguyen <Thinh.Nguyen@synopsys.com>
Link: https://lore.kernel.org/r/20241112182018.199392-1-quic_kriskura@quicinc.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

authored by

Krishna Kurapati and committed by
Greg Kroah-Hartman
ce25e2a8 61eb055c

+8 -4
+7 -3
drivers/usb/dwc3/core.c
··· 1470 1470 if (hw_mode != DWC3_GHWPARAMS0_MODE_GADGET && 1471 1471 (DWC3_IP_IS(DWC31)) && 1472 1472 dwc->maximum_speed == USB_SPEED_SUPER) { 1473 - reg = dwc3_readl(dwc->regs, DWC3_LLUCTL); 1474 - reg |= DWC3_LLUCTL_FORCE_GEN1; 1475 - dwc3_writel(dwc->regs, DWC3_LLUCTL, reg); 1473 + int i; 1474 + 1475 + for (i = 0; i < dwc->num_usb3_ports; i++) { 1476 + reg = dwc3_readl(dwc->regs, DWC3_LLUCTL(i)); 1477 + reg |= DWC3_LLUCTL_FORCE_GEN1; 1478 + dwc3_writel(dwc->regs, DWC3_LLUCTL(i), reg); 1479 + } 1476 1480 } 1477 1481 1478 1482 return 0;
+1 -1
drivers/usb/dwc3/core.h
··· 179 179 #define DWC3_OEVTEN 0xcc0C 180 180 #define DWC3_OSTS 0xcc10 181 181 182 - #define DWC3_LLUCTL 0xd024 182 + #define DWC3_LLUCTL(n) (0xd024 + ((n) * 0x80)) 183 183 184 184 /* Bit fields */ 185 185