Re: [PATCH v5 1/7] usb: dwc2: fix recovery after PM domain off
From: Fabrice Gasnier
Date: Tue Nov 24 2026 - 05:52:19 EST
On 11/21/26 21:38, Stefan Wahren wrote:
> Hi Fabrice,
>
> Am 17.11.26 um 18:06 schrieb Fabrice Gasnier:
>> When the power domain containing the DWC2 controller is disabled during
>> suspend, its registers are lost. Reading registers to back them up from
>> dwc2_suspend() after clock gating can hang STM32MP1 in both host and
>> device mode. Host suspend enters clock gating directly; in device mode,
>> this can happen if the host suspended the USB bus before system suspend.
Hi Stefan,
> sorry for breaking this platform, but I only had the Raspberry Pi for testing and I didn't get much
> feedback last year.
I saw your series, sorry about that, but unfortunately I haven't tested in time...
>
> I'm not familiar with STM32MP1, could you please clarify based on the compatible which is affected?
Yes, "st,stm32mp15-hsotg"
>
> Could you please explain, why backing up the registers before clock gating isn't an option?
Well, that can probably be an option, thanks on your suggestion!
That's not the way I had in mind (power gating and clock gating are two things).
This means: prepare for register loss each time the controller is put into clock gating mode (but
drop the backup values when exiting clock gating without PM-wide platform suspend, as these are
normally not lost).
I can rework this in V6:
- Add the registers backup call when entering clock gating. This will backup the registers when the
bus gets suspended (either as device or host), then a later PM suspend request can skip the backup,
if they are already backed-up.
- Remains some stale states, as raised by Sashiko: when doing this, most of state flags have to be
re-initialized. I'll try to split into separate patch to ease review.
Is it basically what you're thinking of ?
Best Regards,
Fabrice
>
> Best regards