* [PATCH] dwc3: Fix fastboot re-run failure with flat DTS
@ 2026-05-29 12:22 Balaji Selvanathan
2026-05-30 10:02 ` Marek Vasut
0 siblings, 1 reply; 4+ messages in thread
From: Balaji Selvanathan @ 2026-05-29 12:22 UTC (permalink / raw)
To: u-boot
Cc: Marek Vasut, Tom Rini, Mattijs Korpershoek, Jonas Karlman,
Kever Yang, Casey Connolly, Kaustabh Chakraborty, Sam Protsenko,
Balaji Selvanathan
Problem: The first "run fastboot" works and enumerates on the host.
Subsequent runs fail, with no USB enumeration observed.
With flat DTS configurations, the peripheral device inherits
power-domains from its parent (glue) node, as both reference the
same DT node. During teardown after "fastboot continue",
device_remove() of peripheral device invokes dev_power_domain_off(),
which powers off the shared USB GDSC.
As a result, the next "run fastboot" fails because the power
domain is left in an uninitialized state.
Add DM_FLAG_LEAVE_PD_ON to dwc3_generic_peripheral to prevent
power domain shutdown during peripheral removal.
This aligns with hierarchical DTS behavior, where the peripheral
child does not own power-domains. Power management remains with
the glue device, which persists across probe/remove cycles,
allowing repeated fastboot runs to succeed.
Signed-off-by: Balaji Selvanathan <balaji.selvanathan@oss.qualcomm.com>
---
drivers/usb/dwc3/dwc3-generic.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/drivers/usb/dwc3/dwc3-generic.c b/drivers/usb/dwc3/dwc3-generic.c
index 22b9ef0b24e..788fe6fc819 100644
--- a/drivers/usb/dwc3/dwc3-generic.c
+++ b/drivers/usb/dwc3/dwc3-generic.c
@@ -220,6 +220,7 @@ U_BOOT_DRIVER(dwc3_generic_peripheral) = {
.remove = dwc3_generic_peripheral_remove,
.priv_auto = sizeof(struct dwc3_generic_priv),
.plat_auto = sizeof(struct dwc3_generic_plat),
+ .flags = DM_FLAG_LEAVE_PD_ON,
};
#endif
---
base-commit: 987907ae4bcc5d6055bdf7d318a3edf53e14d5fa
change-id: 20260529-usb-3b6b44559cc5
Best regards,
--
Balaji Selvanathan <balaji.selvanathan@oss.qualcomm.com>
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [PATCH] dwc3: Fix fastboot re-run failure with flat DTS
2026-05-29 12:22 [PATCH] dwc3: Fix fastboot re-run failure with flat DTS Balaji Selvanathan
@ 2026-05-30 10:02 ` Marek Vasut
2026-06-08 7:15 ` Mattijs Korpershoek
0 siblings, 1 reply; 4+ messages in thread
From: Marek Vasut @ 2026-05-30 10:02 UTC (permalink / raw)
To: Balaji Selvanathan, u-boot
Cc: Marek Vasut, Tom Rini, Mattijs Korpershoek, Jonas Karlman,
Kever Yang, Casey Connolly, Kaustabh Chakraborty, Sam Protsenko
On 5/29/26 2:22 PM, Balaji Selvanathan wrote:
> Problem: The first "run fastboot" works and enumerates on the host.
> Subsequent runs fail, with no USB enumeration observed.
>
> With flat DTS configurations, the peripheral device inherits
> power-domains from its parent (glue) node, as both reference the
> same DT node. During teardown after "fastboot continue",
> device_remove() of peripheral device invokes dev_power_domain_off(),
> which powers off the shared USB GDSC.
>
> As a result, the next "run fastboot" fails because the power
> domain is left in an uninitialized state.
>
> Add DM_FLAG_LEAVE_PD_ON to dwc3_generic_peripheral to prevent
> power domain shutdown during peripheral removal.
It seems the driver does not handle its power domains correctly,
inhibiting PD control is not a fix, sorry.
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] dwc3: Fix fastboot re-run failure with flat DTS
2026-05-30 10:02 ` Marek Vasut
@ 2026-06-08 7:15 ` Mattijs Korpershoek
2026-06-08 9:07 ` Balaji Selvanathan
0 siblings, 1 reply; 4+ messages in thread
From: Mattijs Korpershoek @ 2026-06-08 7:15 UTC (permalink / raw)
To: Marek Vasut, Balaji Selvanathan, u-boot
Cc: Marek Vasut, Tom Rini, Mattijs Korpershoek, Jonas Karlman,
Kever Yang, Casey Connolly, Kaustabh Chakraborty, Sam Protsenko
Hi,
On Sat, May 30, 2026 at 12:02, Marek Vasut <marek.vasut@mailbox.org> wrote:
> On 5/29/26 2:22 PM, Balaji Selvanathan wrote:
>> Problem: The first "run fastboot" works and enumerates on the host.
>> Subsequent runs fail, with no USB enumeration observed.
>>
>> With flat DTS configurations, the peripheral device inherits
>> power-domains from its parent (glue) node, as both reference the
>> same DT node. During teardown after "fastboot continue",
>> device_remove() of peripheral device invokes dev_power_domain_off(),
>> which powers off the shared USB GDSC.
>>
>> As a result, the next "run fastboot" fails because the power
>> domain is left in an uninitialized state.
>>
>> Add DM_FLAG_LEAVE_PD_ON to dwc3_generic_peripheral to prevent
>> power domain shutdown during peripheral removal.
> It seems the driver does not handle its power domains correctly,
> inhibiting PD control is not a fix, sorry.
I agree with Marek here. Especially since this is a generic driver.
I had a somewhat similar problem on amlogic devices where I could only
run fastboot once.
I've solved this via
https://lore.kernel.org/all/20221024-meson-dm-usb-v1-1-2ab077a503b9@baylibre.com/
Maybe you can explore something similar instead?
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] dwc3: Fix fastboot re-run failure with flat DTS
2026-06-08 7:15 ` Mattijs Korpershoek
@ 2026-06-08 9:07 ` Balaji Selvanathan
0 siblings, 0 replies; 4+ messages in thread
From: Balaji Selvanathan @ 2026-06-08 9:07 UTC (permalink / raw)
To: Mattijs Korpershoek, Marek Vasut, u-boot
Cc: Marek Vasut, Tom Rini, Jonas Karlman, Kever Yang, Casey Connolly,
Kaustabh Chakraborty, Sam Protsenko
Hi Mattijs,
On 6/8/2026 12:45 PM, Mattijs Korpershoek wrote:
> Hi,
>
> On Sat, May 30, 2026 at 12:02, Marek Vasut <marek.vasut@mailbox.org> wrote:
>
>> On 5/29/26 2:22 PM, Balaji Selvanathan wrote:
>>> Problem: The first "run fastboot" works and enumerates on the host.
>>> Subsequent runs fail, with no USB enumeration observed.
>>>
>>> With flat DTS configurations, the peripheral device inherits
>>> power-domains from its parent (glue) node, as both reference the
>>> same DT node. During teardown after "fastboot continue",
>>> device_remove() of peripheral device invokes dev_power_domain_off(),
>>> which powers off the shared USB GDSC.
>>>
>>> As a result, the next "run fastboot" fails because the power
>>> domain is left in an uninitialized state.
>>>
>>> Add DM_FLAG_LEAVE_PD_ON to dwc3_generic_peripheral to prevent
>>> power domain shutdown during peripheral removal.
>> It seems the driver does not handle its power domains correctly,
>> inhibiting PD control is not a fix, sorry.
> I agree with Marek here. Especially since this is a generic driver.
>
> I had a somewhat similar problem on amlogic devices where I could only
> run fastboot once.
>
> I've solved this via
> https://lore.kernel.org/all/20221024-meson-dm-usb-v1-1-2ab077a503b9@baylibre.com/
>
> Maybe you can explore something similar instead?
Thanks, will look into this patch.
Regards,
Balaji
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2026-06-08 9:08 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-05-29 12:22 [PATCH] dwc3: Fix fastboot re-run failure with flat DTS Balaji Selvanathan
2026-05-30 10:02 ` Marek Vasut
2026-06-08 7:15 ` Mattijs Korpershoek
2026-06-08 9:07 ` Balaji Selvanathan
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.