[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <20250108012507.jv2wkw7qtxztfkvv@synopsys.com>
Date: Wed, 8 Jan 2025 01:25:09 +0000
From: Thinh Nguyen <Thinh.Nguyen@...opsys.com>
To: Ray Chi <raychi@...gle.com>
CC: "gregkh@...uxfoundation.org" <gregkh@...uxfoundation.org>,
"albertccwang@...gle.com" <albertccwang@...gle.com>,
"linux-usb@...r.kernel.org" <linux-usb@...r.kernel.org>,
"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
"pumahsu@...gle.com" <pumahsu@...gle.com>,
"stable@...r.kernel.org"
<stable@...r.kernel.org>
Subject: Re: [PATCH] usb: dwc3: Skip resume if pm_runtime_set_active() fails
On Wed, Jan 08, 2025, Thinh Nguyen wrote:
> On Mon, Jan 06, 2025, Ray Chi wrote:
> > When the system begins to enter suspend mode, dwc3_suspend() is called
> > by PM suspend. There is a problem that if someone interrupt the system
> > suspend process between dwc3_suspend() and pm_suspend() of its parent
> > device, PM suspend will be canceled and attempt to resume suspended
> > devices so that dwc3_resume() will be called. However, dwc3 and its
> > parent device (like the power domain or glue driver) may already be
> > suspended by runtime PM in fact. If this sutiation happened, the
> > pm_runtime_set_active() in dwc3_resume() will return an error since
> > parent device was suspended. This can lead to unexpected behavior if
> > DWC3 proceeds to execute dwc3_resume_common().
> >
> > EX.
> > RPM suspend: ... -> dwc3_runtime_suspend()
> > -> rpm_suspend() of parent device
> > ...
> > PM suspend: ... -> dwc3_suspend() -> pm_suspend of parent device
> > ^ interrupt, so resume suspended device
> > ... <- dwc3_resume() <-/
> > ^ pm_runtime_set_active() returns error
> >
> > To prevent the problem, this commit will skip dwc3_resume_common() and
> > return the error if pm_runtime_set_active() fails.
>
>
> So, if the device is runtime suspended, we prevent any interrupt during
> system suspend? Any way we can keep the same behavior and allow PM
> interruption as when there's no runtime suspend.
>
Actually, I misread, the interruption is still there. Just the resume is
prevented.
Looks good to me.
Acked-by: Thinh Nguyen <Thinh.Nguyen@...opsys.com>
Thanks,
Thinh
Powered by blists - more mailing lists