* [PATCH v2] usb: dwc3: fix dwc3_readl() and dwc3_writel() calls in dwc3_ulpi_setup()
@ 2026-06-29 11:37 Ben Dooks
2026-06-30 0:33 ` Thinh Nguyen
0 siblings, 1 reply; 5+ messages in thread
From: Ben Dooks @ 2026-06-29 11:37 UTC (permalink / raw)
To: Thinh Nguyen, Greg Kroah-Hartman, linux-usb, linux-kernel
Cc: Ben Dooks, stable
The dwc3_ulpi_setup() calls the register read and write calls with
dwc3->regs when both these calls take the dwc3 structure directly.
Chnage these two calls to fix the following sparse warning, and
possibly a nasty bug in the dwc3_ulpi_setup() code:
drivers/usb/dwc3/core.c:796:45: warning: incorrect type in argument 1 (different address spaces)
drivers/usb/dwc3/core.c:796:45: expected struct dwc3 *dwc
drivers/usb/dwc3/core.c:796:45: got void [noderef] __iomem *regs
drivers/usb/dwc3/core.c:798:40: warning: incorrect type in argument 1 (different address spaces)
drivers/usb/dwc3/core.c:798:40: expected struct dwc3 *dwc
drivers/usb/dwc3/core.c:798:40: got void [noderef] __iomem *regs
Cc: stable@kernel.org
Fixes: dcdc3f399e3b ("usb: dwc3: Support USB3340x ULPI PHY high-speed negotiation.")
Acked-by: Thinh Nguyen <Thinh.Nguyen@synopsys.com>
Signed-off-by: Ben Dooks <ben.dooks@codethink.co.uk>
---
v2: add fixes and cc to stable
---
drivers/usb/dwc3/core.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/usb/dwc3/core.c b/drivers/usb/dwc3/core.c
index 517aa7f1486d..ceb49f2f8004 100644
--- a/drivers/usb/dwc3/core.c
+++ b/drivers/usb/dwc3/core.c
@@ -789,9 +789,9 @@ static void dwc3_ulpi_setup(struct dwc3 *dwc)
if (dwc->enable_usb2_transceiver_delay) {
for (index = 0; index < dwc->num_usb2_ports; index++) {
- reg = dwc3_readl(dwc->regs, DWC3_GUSB2PHYCFG(index));
+ reg = dwc3_readl(dwc, DWC3_GUSB2PHYCFG(index));
reg |= DWC3_GUSB2PHYCFG_XCVRDLY;
- dwc3_writel(dwc->regs, DWC3_GUSB2PHYCFG(index), reg);
+ dwc3_writel(dwc, DWC3_GUSB2PHYCFG(index), reg);
}
}
}
--
2.37.2.352.g3c44437643
^ permalink raw reply related [flat|nested] 5+ messages in thread* Re: [PATCH v2] usb: dwc3: fix dwc3_readl() and dwc3_writel() calls in dwc3_ulpi_setup()
2026-06-29 11:37 [PATCH v2] usb: dwc3: fix dwc3_readl() and dwc3_writel() calls in dwc3_ulpi_setup() Ben Dooks
@ 2026-06-30 0:33 ` Thinh Nguyen
0 siblings, 0 replies; 5+ messages in thread
From: Thinh Nguyen @ 2026-06-30 0:33 UTC (permalink / raw)
To: Ben Dooks
Cc: Thinh Nguyen, Greg Kroah-Hartman, linux-usb@vger.kernel.org,
linux-kernel@vger.kernel.org, stable@kernel.org
On Mon, Jun 29, 2026, Ben Dooks wrote:
> The dwc3_ulpi_setup() calls the register read and write calls with
> dwc3->regs when both these calls take the dwc3 structure directly.
>
> Chnage these two calls to fix the following sparse warning, and
> possibly a nasty bug in the dwc3_ulpi_setup() code:
>
> drivers/usb/dwc3/core.c:796:45: warning: incorrect type in argument 1 (different address spaces)
> drivers/usb/dwc3/core.c:796:45: expected struct dwc3 *dwc
> drivers/usb/dwc3/core.c:796:45: got void [noderef] __iomem *regs
> drivers/usb/dwc3/core.c:798:40: warning: incorrect type in argument 1 (different address spaces)
> drivers/usb/dwc3/core.c:798:40: expected struct dwc3 *dwc
> drivers/usb/dwc3/core.c:798:40: got void [noderef] __iomem *regs
>
> Cc: stable@kernel.org
> Fixes: dcdc3f399e3b ("usb: dwc3: Support USB3340x ULPI PHY high-speed negotiation.")
This patch should be v3, and the Fixes tag should be pointing to
9accc68b1cf0 ("usb: dwc3: Add dwc pointer to dwc3_readl/writel")
Thanks,
Thinh
> Acked-by: Thinh Nguyen <Thinh.Nguyen@synopsys.com>
> Signed-off-by: Ben Dooks <ben.dooks@codethink.co.uk>
> ---
> v2: add fixes and cc to stable
> ---
> drivers/usb/dwc3/core.c | 4 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)
>
^ permalink raw reply [flat|nested] 5+ messages in thread
* [PATCH v2] usb: dwc3: fix dwc3_readl() and dwc3_writel() calls in dwc3_ulpi_setup()
@ 2026-06-23 10:08 Ben Dooks
2026-06-26 22:23 ` Thinh Nguyen
0 siblings, 1 reply; 5+ messages in thread
From: Ben Dooks @ 2026-06-23 10:08 UTC (permalink / raw)
To: Thinh Nguyen, Greg Kroah-Hartman, linux-usb, linux-kernel; +Cc: Ben Dooks
The dwc3_ulpi_setup() calls the register read and write calls with
dwc3->regs when both these calls take the dwc3 structure directly.
Chnage these two calls to fix the following sparse warning, and
possibly a nasty bug in the dwc3_ulpi_setup() code:
drivers/usb/dwc3/core.c:796:45: warning: incorrect type in argument 1 (different address spaces)
drivers/usb/dwc3/core.c:796:45: expected struct dwc3 *dwc
drivers/usb/dwc3/core.c:796:45: got void [noderef] __iomem *regs
drivers/usb/dwc3/core.c:798:40: warning: incorrect type in argument 1 (different address spaces)
drivers/usb/dwc3/core.c:798:40: expected struct dwc3 *dwc
drivers/usb/dwc3/core.c:798:40: got void [noderef] __iomem *regs
Signed-off-by: Ben Dooks <ben.dooks@codethink.co.uk>
---
drivers/usb/dwc3/core.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/usb/dwc3/core.c b/drivers/usb/dwc3/core.c
index 517aa7f1486d..ceb49f2f8004 100644
--- a/drivers/usb/dwc3/core.c
+++ b/drivers/usb/dwc3/core.c
@@ -789,9 +789,9 @@ static void dwc3_ulpi_setup(struct dwc3 *dwc)
if (dwc->enable_usb2_transceiver_delay) {
for (index = 0; index < dwc->num_usb2_ports; index++) {
- reg = dwc3_readl(dwc->regs, DWC3_GUSB2PHYCFG(index));
+ reg = dwc3_readl(dwc, DWC3_GUSB2PHYCFG(index));
reg |= DWC3_GUSB2PHYCFG_XCVRDLY;
- dwc3_writel(dwc->regs, DWC3_GUSB2PHYCFG(index), reg);
+ dwc3_writel(dwc, DWC3_GUSB2PHYCFG(index), reg);
}
}
}
--
2.37.2.352.g3c44437643
^ permalink raw reply related [flat|nested] 5+ messages in thread* Re: [PATCH v2] usb: dwc3: fix dwc3_readl() and dwc3_writel() calls in dwc3_ulpi_setup()
2026-06-23 10:08 Ben Dooks
@ 2026-06-26 22:23 ` Thinh Nguyen
2026-06-29 11:36 ` Ben Dooks
0 siblings, 1 reply; 5+ messages in thread
From: Thinh Nguyen @ 2026-06-26 22:23 UTC (permalink / raw)
To: Ben Dooks
Cc: Thinh Nguyen, Greg Kroah-Hartman, linux-usb@vger.kernel.org,
linux-kernel@vger.kernel.org
On Tue, Jun 23, 2026, Ben Dooks wrote:
> The dwc3_ulpi_setup() calls the register read and write calls with
> dwc3->regs when both these calls take the dwc3 structure directly.
>
> Chnage these two calls to fix the following sparse warning, and
> possibly a nasty bug in the dwc3_ulpi_setup() code:
>
> drivers/usb/dwc3/core.c:796:45: warning: incorrect type in argument 1 (different address spaces)
> drivers/usb/dwc3/core.c:796:45: expected struct dwc3 *dwc
> drivers/usb/dwc3/core.c:796:45: got void [noderef] __iomem *regs
> drivers/usb/dwc3/core.c:798:40: warning: incorrect type in argument 1 (different address spaces)
> drivers/usb/dwc3/core.c:798:40: expected struct dwc3 *dwc
> drivers/usb/dwc3/core.c:798:40: got void [noderef] __iomem *regs
>
> Signed-off-by: Ben Dooks <ben.dooks@codethink.co.uk>
> ---
> drivers/usb/dwc3/core.c | 4 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/usb/dwc3/core.c b/drivers/usb/dwc3/core.c
> index 517aa7f1486d..ceb49f2f8004 100644
> --- a/drivers/usb/dwc3/core.c
> +++ b/drivers/usb/dwc3/core.c
> @@ -789,9 +789,9 @@ static void dwc3_ulpi_setup(struct dwc3 *dwc)
>
> if (dwc->enable_usb2_transceiver_delay) {
> for (index = 0; index < dwc->num_usb2_ports; index++) {
> - reg = dwc3_readl(dwc->regs, DWC3_GUSB2PHYCFG(index));
> + reg = dwc3_readl(dwc, DWC3_GUSB2PHYCFG(index));
> reg |= DWC3_GUSB2PHYCFG_XCVRDLY;
> - dwc3_writel(dwc->regs, DWC3_GUSB2PHYCFG(index), reg);
> + dwc3_writel(dwc, DWC3_GUSB2PHYCFG(index), reg);
> }
> }
> }
> --
> 2.37.2.352.g3c44437643
>
Ah! How did we miss this. Thanks for the catch.
Please also add Fixes and Cc stable tags. Add my Ack after you include
the tags:
Acked-by: Thinh Nguyen <Thinh.Nguyen@synopsys.com>
Thanks!
Thinh
^ permalink raw reply [flat|nested] 5+ messages in thread* Re: [PATCH v2] usb: dwc3: fix dwc3_readl() and dwc3_writel() calls in dwc3_ulpi_setup()
2026-06-26 22:23 ` Thinh Nguyen
@ 2026-06-29 11:36 ` Ben Dooks
0 siblings, 0 replies; 5+ messages in thread
From: Ben Dooks @ 2026-06-29 11:36 UTC (permalink / raw)
To: Thinh Nguyen
Cc: Greg Kroah-Hartman, linux-usb@vger.kernel.org,
linux-kernel@vger.kernel.org
On 26/06/2026 23:23, Thinh Nguyen wrote:
> On Tue, Jun 23, 2026, Ben Dooks wrote:
>> The dwc3_ulpi_setup() calls the register read and write calls with
>> dwc3->regs when both these calls take the dwc3 structure directly.
>>
>> Chnage these two calls to fix the following sparse warning, and
>> possibly a nasty bug in the dwc3_ulpi_setup() code:
>>
>> drivers/usb/dwc3/core.c:796:45: warning: incorrect type in argument 1 (different address spaces)
>> drivers/usb/dwc3/core.c:796:45: expected struct dwc3 *dwc
>> drivers/usb/dwc3/core.c:796:45: got void [noderef] __iomem *regs
>> drivers/usb/dwc3/core.c:798:40: warning: incorrect type in argument 1 (different address spaces)
>> drivers/usb/dwc3/core.c:798:40: expected struct dwc3 *dwc
>> drivers/usb/dwc3/core.c:798:40: got void [noderef] __iomem *regs
>>
>> Signed-off-by: Ben Dooks <ben.dooks@codethink.co.uk>
>> ---
>> drivers/usb/dwc3/core.c | 4 ++--
>> 1 file changed, 2 insertions(+), 2 deletions(-)
>>
>> diff --git a/drivers/usb/dwc3/core.c b/drivers/usb/dwc3/core.c
>> index 517aa7f1486d..ceb49f2f8004 100644
>> --- a/drivers/usb/dwc3/core.c
>> +++ b/drivers/usb/dwc3/core.c
>> @@ -789,9 +789,9 @@ static void dwc3_ulpi_setup(struct dwc3 *dwc)
>>
>> if (dwc->enable_usb2_transceiver_delay) {
>> for (index = 0; index < dwc->num_usb2_ports; index++) {
>> - reg = dwc3_readl(dwc->regs, DWC3_GUSB2PHYCFG(index));
>> + reg = dwc3_readl(dwc, DWC3_GUSB2PHYCFG(index));
>> reg |= DWC3_GUSB2PHYCFG_XCVRDLY;
>> - dwc3_writel(dwc->regs, DWC3_GUSB2PHYCFG(index), reg);
>> + dwc3_writel(dwc, DWC3_GUSB2PHYCFG(index), reg);
>> }
>> }
>> }
>> --
>> 2.37.2.352.g3c44437643
>>
>
> Ah! How did we miss this. Thanks for the catch.
I think it is probably limited hardware as the commit it was introduced
in was: dcdc3f399e3b ("usb: dwc3: Support USB3340x ULPI PHY high-speed
negotiation.")
--
Ben Dooks http://www.codethink.co.uk/
Senior Engineer Codethink - Providing Genius
https://www.codethink.co.uk/privacy.html
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2026-06-30 0:34 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-06-29 11:37 [PATCH v2] usb: dwc3: fix dwc3_readl() and dwc3_writel() calls in dwc3_ulpi_setup() Ben Dooks
2026-06-30 0:33 ` Thinh Nguyen
-- strict thread matches above, loose matches on Subject: below --
2026-06-23 10:08 Ben Dooks
2026-06-26 22:23 ` Thinh Nguyen
2026-06-29 11:36 ` Ben Dooks
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox