Re: [REGRESSION] PM / sleep: Unbalanced suspend/resume on late abort causes data abort
From: Rafael J. Wysocki
Date: Mon Nov 17 2025 - 12:07:17 EST
Hi,
On Mon, Nov 17, 2025 at 10:31 AM Rose Wu <ya-jou.wu@xxxxxxxxxxxx> wrote:
>
> Hi Rafael and All,
>
> I am reporting a regression introduced by the commit
> 443046d1ad66607f324c604b9fbdf11266fa8aad (PM: sleep: Make suspend of
> devices more asynchronous), which can lead to a kernel panic (data
> abort) if a late suspend aborts.
> The commit modifies list handling during suspend. When a device suspend
> aborts at the "late" stage, `dpm_suspended_list` is spliced into
> `dpm_late_early_list`.
> This creates an imbalance. Devices on this list that had not yet
> executed `pm_runtime_disable()` in `device_suspend_late()` are now
> incorrectly subjected to `pm_runtime_enable()` during the subsequent
> `device_resume_early()` sequence.
Ah, obviously.
Does the attached patch (that should apply on top of 6.18-rc6) help?
If this patch doesn't apply to your kernel, making an analogous change
to it should be straightforward enough.
---
drivers/base/power/main.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
--- a/drivers/base/power/main.c
+++ b/drivers/base/power/main.c
@@ -941,11 +941,11 @@ Run:
Skip:
dev->power.is_late_suspended = false;
+ pm_runtime_enable(dev);
Out:
TRACE_RESUME(error);
- pm_runtime_enable(dev);
complete_all(&dev->power.completion);
if (error) {