diff options
| author | Shibo Zhu <3499129952@qq.com> | 2026-08-19 00:18:39 +0800 |
|---|---|---|
| committer | Rafael J. Wysocki <rafael.j.wysocki@intel.com> | 2026-08-20 23:18:15 +0200 |
| commit | cb258d651d747a7f7063d40f145418bee562ceaf (patch) | |
| tree | 9370e645d989aab52cb9f79ad317bda5dd83c3ae /samples/workqueue | |
| parent | a5778046a02570fd23bdf0b48dce330237d1996c (diff) | |
| download | linux-stable-cb258d651d747a7f7063d40f145418bee562ceaf.tar.gz linux-stable-cb258d651d747a7f7063d40f145418bee562ceaf.zip | |
PM: sleep: Unblock runtime PM when device prepare fails
device_prepare() blocks runtime PM for a device with runtime PM disabled
before invoking its system-sleep ->prepare() callback. For a device that
has never enabled runtime PM, this changes dev->power.last_status from
RPM_INVALID to RPM_BLOCKED.
If the callback returns an error, dpm_prepare() does not move the device
to dpm_prepared_list. Consequently, the recovery path through
dpm_complete() never calls device_complete() for the failing device.
The error path drops the runtime PM usage reference, but does not clear
RPM_BLOCKED. A later legitimate pm_runtime_enable() then reports:
Attempt to enable runtime PM when it is blocked
before clearing the stale state.
Call pm_runtime_unblock() on the prepare error path before dropping the
runtime PM reference, matching the cleanup performed by device_complete().
The issue was reproduced with a platform test device whose ->prepare()
callback returns -EIO while runtime PM has never been enabled. Before
the fix, last_status remained RPM_BLOCKED after the failed suspend and
the first pm_runtime_enable() produced the warning above. With the fix,
last_status is restored to RPM_INVALID and the warning is absent.
Fixes: 3e5eee147b7b ("PM: Block enabling of runtime PM during system suspend")
Cc: All applicable <stable@vger.kernel.org>
Signed-off-by: Shibo Zhu <3499129952@qq.com>
Link: https://patch.msgid.link/tencent_C5AC0A02FC01F700E764F8C2E3ECE4F41009@qq.com
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Diffstat (limited to 'samples/workqueue')
0 files changed, 0 insertions, 0 deletions
