Thread (21 messages) 21 messages, 6 authors, 3d ago

Re: [PATCH v16 2/6] usb: dwc3: rockchip: introduce glue driver

flat view

From: sashiko-bot@kernel.org
Date: 2026-09-24 17:36:51

Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
- [Medium] usb: dwc3: unconditional blocklist breaks USB fallback without rockchip glue
--

commit b1c2a157ba4928faa78118602b451577e3210786
Author: Sebastian Reichel [off-list ref]

usb: dwc3: rockchip: introduce glue driver

This commit introduces Rockchip specific glue code for the Synopsys DWC3
USB driver. It currently handles things identically to the default glue.
quoted hunk ↗ jump to hunk
diff --git a/drivers/usb/dwc3/core.c b/drivers/usb/dwc3/core.c
index fd5c2cd36c595..4b7132887a030 100644
--- a/drivers/usb/dwc3/core.c
+++ b/drivers/usb/dwc3/core.c
@@ -2448,11 +2448,26 @@ int dwc3_core_probe(const struct dwc3_probe_data *data)
 }
 EXPORT_SYMBOL_GPL(dwc3_core_probe);
 
+/*
+ * List of compatibles, which have "synopsys,dwc3" as a fallback
+ * compatible, but have a vendor specific glue driver that should
+ * be used instead of this one.
+ */
+static const char *const dwc3_compatible_blocklist[] = {
+	"rockchip,rk3588-dwc3",
+	"rockchip,rk3576-dwc3",
+};
+
 static int dwc3_probe(struct platform_device *pdev)
 {
 	struct dwc3_probe_data probe_data = {};
 	struct resource *res;
 	struct dwc3 *dwc;
+	int i;
+
+	for (i = 0; i < ARRAY_SIZE(dwc3_compatible_blocklist); i++)
+		if (device_is_compatible(&pdev->dev, dwc3_compatible_blocklist[i]))
+			return -ENODEV;
[Severity: Medium]
Does this unconditional blocklist break the USB fallback mechanism when the
kernel is built without CONFIG_USB_DWC3_ROCKCHIP?

The device tree bindings for these boards specify snps,dwc3 as a fallback
so the generic driver can bind if the specialized Rockchip driver is
unavailable. By unconditionally blocklisting the Rockchip compatibles in
dwc3_probe(), the fallback mechanism is defeated.

If a user configures their kernel without the newly added
CONFIG_USB_DWC3_ROCKCHIP, will the device be rejected completely and leave
the system with no USB functionality? 

Could these blocklist entries be conditionally compiled (for example, using
IS_ENABLED(CONFIG_USB_DWC3_ROCKCHIP)) so the generic driver can still serve
as a fallback when the glue driver is not built?
 
 	res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
 	if (!res) {
-- 
Sashiko AI review · https://sashiko.dev/#/patchset/20260924-b4-rockchip-dwc3-rockchip-glue-v16-0-126a2e9133c3@collabora.com?part=2

-- 
linux-phy mailing list
linux-phy@lists.infradead.org
https://lists.infradead.org/mailman/listinfo/linux-phy
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help