Re: [PATCH v2] drvier: usb: dwc3: Fix runtime PM trying to activate child device xxx.dwc3 but parent is not active

Thinh Nguyen
2025-09-12T21:36:47Z

On Thu, Sep 11, 2025, ryan zhou wrote:
> Thinh Nguyen <Thinh.Nguyen@synopsys.com> 于2025年9月11日周四 09:32写道：
> >
> > On Wed, Sep 10, 2025, Ryan Zhou wrote:
> > > Issue description:During the wake-up sequence, if the system invokes
> > > dwc3->resume and detects that the parent device of dwc3 is in a
> > > runtime suspend state, the system will generate an error: runtime PM
> > > trying to activate child device xxx.dwc3 but parent is not active.
> > >
> > > Solution:At the dwc3->resume entry point, if the dwc3 controller
> > > is detected in a suspended state, the function shall return
> > > immediately without executing any further operations.
> > >
> > > Signed-off-by: Ryan Zhou <ryanzhou54@gmail.com>
> > > ---
> > > drivers/usb/dwc3/core.c | 3 +++
> > > 1 file changed, 3 insertions(+)
> > >
> > > diff --git a/drivers/usb/dwc3/core.c b/drivers/usb/dwc3/core.c
> > > index 370fc524a468..06a6f8a67129 100644
> > > --- a/drivers/usb/dwc3/core.c
> > > +++ b/drivers/usb/dwc3/core.c
> > > @@ -2687,6 +2687,9 @@ int dwc3_pm_resume(struct dwc3 *dwc)
> > > struct device *dev = dwc->dev;
> > > int ret = 0;
> > >
> > > + if (pm_runtime_suspended(dev))
> > > + return ret;
> > > +
> >
> > Is this a documented behavior where the device should remain runtime
> > suspend on system resume? I feel that that this should be configurable
> > by the user or defined the PM core. I don't think we should change
> > default behavior here just to workaround the issue that we're facing.
>
> No documentation was found, but modifying the runtime suspend state
> after wakeup from sleep seems unnecessary if the device was already
> in runtime suspend before sleep.
>
> > What if the user wants to keep the old behavior and resume up the device
> > on system resume?

> For USB devices, RPM resume should be initiated by plug/unplug events,
> not PM resume when the device is physically disconnected.
>

Why not? This resume will also apply for host right? The host can be
woken up by a remote-wake signal that triggers a pm_resume. The user may
expect the host to resume on pm_resume.

We may implement device hibernation in the future where RPM resume is
relevant more than just plug/unplug events.

BR,
Thinh