Re: [PATCH v3 2/5] PM: sleep: Suspend async parents after suspending children

From: Rafael J. Wysocki
Date: Tue Jun 03 2025 - 09:06:08 EST


On Tue, Jun 3, 2025 at 2:27 PM Chris Bainbridge
<chris.bainbridge@xxxxxxxxx> wrote:
>
> On Tue, 3 Jun 2025 at 13:24, Rafael J. Wysocki <rafael@xxxxxxxxxx> wrote:
> > >
> > > This patch does fix the list corruption, but the "Unbalanced
> > > pm_runtime_enable" still occurs:
> >
> > Have you applied it together with the previous patch?
>
> Yes

So it looks like some devices have power.is_suspended set from the
previous cycle which causes device_resume() to attempt to resume them
even though they have not been suspended in the current cycle yet.

Please try the attached patch in addition to the previous 2 patches.

Thanks!
---
drivers/base/power/main.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)

--- a/drivers/base/power/main.c
+++ b/drivers/base/power/main.c
@@ -992,6 +992,8 @@
if (!dev->power.is_suspended)
goto Complete;

+ dev->power.is_suspended = false;
+
if (dev->power.direct_complete) {
/*
* Allow new children to be added under the device after this
@@ -1054,7 +1056,6 @@

End:
error = dpm_run_callback(callback, dev, state, info);
- dev->power.is_suspended = false;

device_unlock(dev);
dpm_watchdog_clear(&wd);