linux-stable/drivers/base/power
Qingliang Li 40dda05486 PM: sleep: wakeirq: fix wake irq warning in system suspend
[ Upstream commit e7a7681c85 ]

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: 8527beb120 ("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>
Signed-off-by: Sasha Levin <sashal@kernel.org>
2024-04-13 12:58:18 +02:00
..
clock_ops.c
common.c
domain.c pmdomain: core: Move the unused cleanup to a _sync initcall 2024-02-23 08:42:29 +01:00
domain_governor.c
generic_ops.c
main.c PM: sleep: Fix error handling in dpm_prepare() 2024-02-23 08:42:18 +01:00
Makefile
power.h PM: sleep: wakeirq: fix wake irq arming 2023-08-11 11:57:55 +02:00
qos-test.c
qos.c
runtime.c PM: runtime: Have devm_pm_runtime_enable() handle pm_runtime_dont_use_autosuspend() 2024-02-23 08:42:32 +01:00
sysfs.c
trace.c rtc: Check return value from mc146818_get_time() 2022-12-14 11:31:55 +01:00
wakeirq.c PM: sleep: wakeirq: fix wake irq warning in system suspend 2024-04-13 12:58:18 +02:00
wakeup.c PM: s2idle: ACPI: Fix wakeup interrupts handling 2022-02-16 12:54:22 +01:00
wakeup_stats.c