Skip to content

Commit e7a7681

Browse files
Qingliang Lirafaeljw
authored andcommitted
PM: sleep: wakeirq: fix wake irq warning in system suspend
When driver uses pm_runtime_force_suspend() as the system suspend callback function and registers the wake irq with reverse enable ordering, the wake irq will be re-enabled when entering system suspend, triggering an 'Unbalanced enable for IRQ xxx' warning. In this scenario, the call sequence during system suspend is as follows: suspend_devices_and_enter() -> dpm_suspend_start() -> dpm_run_callback() -> pm_runtime_force_suspend() -> dev_pm_enable_wake_irq_check() -> dev_pm_enable_wake_irq_complete() -> suspend_enter() -> dpm_suspend_noirq() -> device_wakeup_arm_wake_irqs() -> dev_pm_arm_wake_irq() To fix this issue, complete the setting of WAKE_IRQ_DEDICATED_ENABLED flag in dev_pm_enable_wake_irq_complete() to avoid redundant irq enablement. Fixes: 8527beb ("PM: sleep: wakeirq: fix wake irq arming") Reviewed-by: Dhruva Gole <d-gole@ti.com> Signed-off-by: Qingliang Li <qingliang.li@mediatek.com> Reviewed-by: Johan Hovold <johan+linaro@kernel.org> Cc: 5.16+ <stable@vger.kernel.org> # 5.16+ Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
1 parent 9bc4ffd commit e7a7681

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

drivers/base/power/wakeirq.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -313,8 +313,10 @@ void dev_pm_enable_wake_irq_complete(struct device *dev)
313313
return;
314314

315315
if (wirq->status & WAKE_IRQ_DEDICATED_MANAGED &&
316-
wirq->status & WAKE_IRQ_DEDICATED_REVERSE)
316+
wirq->status & WAKE_IRQ_DEDICATED_REVERSE) {
317317
enable_irq(wirq->irq);
318+
wirq->status |= WAKE_IRQ_DEDICATED_ENABLED;
319+
}
318320
}
319321

320322
/**

0 commit comments

Comments
 (0)