diff options
| author | Rafael J. Wysocki <rafael.j.wysocki@intel.com> | 2025-06-03 19:19:27 +0300 |
|---|---|---|
| committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2025-06-19 16:32:18 +0300 |
| commit | 0cffc6e40d5d33524b459c17fdf9ff03f0296a71 (patch) | |
| tree | 01c427ec9dc14c918692e303a97185150ab996a3 /drivers/base | |
| parent | 1184f7df1d08c682631d9fe68df407615601db14 (diff) | |
| download | linux-0cffc6e40d5d33524b459c17fdf9ff03f0296a71.tar.xz | |
PM: sleep: Fix power.is_suspended cleanup for direct-complete devices
[ Upstream commit d46c4c839c20a599a0eb8d73708ce401f9c7d06d ]
Commit 03f1444016b7 ("PM: sleep: Fix handling devices with direct_complete
set on errors") caused power.is_suspended to be set for devices with
power.direct_complete set, but it forgot to ensure the clearing of that
flag for them in device_resume(), so power.is_suspended is still set for
them during the next system suspend-resume cycle.
If that cycle is aborted in dpm_suspend(), the subsequent invocation of
dpm_resume() will trigger a device_resume() call for every device and
because power.is_suspended is set for the devices in question, they will
not be skipped by device_resume() as expected which causes scary error
messages to be logged (as appropriate).
To address this issue, move the clearing of power.is_suspended in
device_resume() immediately after the power.is_suspended check so it
will be always cleared for all devices processed by that function.
Fixes: 03f1444016b7 ("PM: sleep: Fix handling devices with direct_complete set on errors")
Closes: https://gitlab.freedesktop.org/drm/amd/-/issues/4280
Reported-and-tested-by: Chris Bainbridge <chris.bainbridge@gmail.com>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Reviewed-by: Mario Limonciello <mario.limonciello@amd.com>
Link: https://patch.msgid.link/4990586.GXAFRqVoOG@rjwysocki.net
Signed-off-by: Sasha Levin <sashal@kernel.org>
Diffstat (limited to 'drivers/base')
| -rw-r--r-- | drivers/base/power/main.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/drivers/base/power/main.c b/drivers/base/power/main.c index 1abe61f11525..faf4cdec23f0 100644 --- a/drivers/base/power/main.c +++ b/drivers/base/power/main.c @@ -916,6 +916,8 @@ static void device_resume(struct device *dev, pm_message_t state, bool async) if (!dev->power.is_suspended) goto Complete; + dev->power.is_suspended = false; + if (dev->power.direct_complete) { /* Match the pm_runtime_disable() in __device_suspend(). */ pm_runtime_enable(dev); @@ -971,7 +973,6 @@ static void device_resume(struct device *dev, pm_message_t state, bool async) End: error = dpm_run_callback(callback, dev, state, info); - dev->power.is_suspended = false; device_unlock(dev); dpm_watchdog_clear(&wd); |
