[PATCH] usb: dwc3: Resend full Data Packet for non-compliant USB3.1 devices

Konrad Dybcio posted 1 patch 1 week, 2 days ago
drivers/usb/dwc3/core.c | 8 ++++++++
drivers/usb/dwc3/core.h | 2 ++
2 files changed, 10 insertions(+)
[PATCH] usb: dwc3: Resend full Data Packet for non-compliant USB3.1 devices
Posted by Konrad Dybcio 1 week, 2 days ago
From: Konrad Dybcio <konrad.dybcio@oss.qualcomm.com>

Some non-compliant devices require that a full Data Packet (and not
only the header) is resent upon LBAD. One such device is the USB3
protocol adapter within the Qualcomm USB4 router.

DWC3 has a toggle to enable that behavior within LLINKDBGCTRL, use it.

Signed-off-by: Konrad Dybcio <konrad.dybcio@oss.qualcomm.com>
---
 drivers/usb/dwc3/core.c | 8 ++++++++
 drivers/usb/dwc3/core.h | 2 ++
 2 files changed, 10 insertions(+)

diff --git a/drivers/usb/dwc3/core.c b/drivers/usb/dwc3/core.c
index fd5c2cd36c59..d375ebee297b 100644
--- a/drivers/usb/dwc3/core.c
+++ b/drivers/usb/dwc3/core.c
@@ -1514,6 +1514,14 @@ int dwc3_core_init(struct dwc3 *dwc)
 		}
 	}
 
+	if (DWC3_IP_IS(DWC31) || DWC3_IP_IS(DWC32)) {
+		for (int i = 0; i < dwc->num_usb3_ports; i++) {
+			reg = dwc3_readl(dwc, DWC3_LLINKDBGCTRL(i));
+			reg |= DWC3_LLINKDBGCTRL_RETRY_DP;
+			dwc3_writel(dwc, DWC3_LLINKDBGCTRL(i), reg);
+		}
+	}
+
 	/*
 	 * STAR 9001346572: This issue affects DWC_usb31 versions 1.80a and
 	 * prior. When an active endpoint not currently cached in the host
diff --git a/drivers/usb/dwc3/core.h b/drivers/usb/dwc3/core.h
index 608daeb7ef10..6af644a9672d 100644
--- a/drivers/usb/dwc3/core.h
+++ b/drivers/usb/dwc3/core.h
@@ -180,6 +180,8 @@
 #define DWC3_OSTS		0xcc10
 
 #define DWC3_LLUCTL(n)		(0xd024 + ((n) * 0x80))
+#define DWC3_LLINKDBGCTRL(n)	(0xd058 + ((n) * 0x80))
+#define DWC3_LLINKDBGCTRL_RETRY_DP	BIT(31)
 
 /* Bit fields */
 

---
base-commit: 1a1de54f7369cd2b5bac0f265910e60ad3a6b4c3
change-id: 20260915-topic-usb3_tunneling_fixup-8c0fb73edec8

Best regards,
--  
Konrad Dybcio <konrad.dybcio@oss.qualcomm.com>