WSL2-Linux-Kernel/drivers/base/power
Qingliang Li f3f867201b PM: sleep: wakeirq: fix wake irq warning in system suspend
[ Upstream commit e7a7681c859643f3f2476b2a28a494877fd89442 ]

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-10 16:18:37 +02:00
..
Makefile
clock_ops.c
common.c
domain.c pmdomain: core: Move the unused cleanup to a _sync initcall 2024-02-23 08:55:10 +01:00
domain_governor.c
generic_ops.c
main.c PM: sleep: Fix possible deadlocks in core system-wide PM code 2024-02-23 08:54:33 +01:00
power.h PM: sleep: wakeirq: fix wake irq arming 2023-08-11 15:14:00 +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:55:15 +01:00
sysfs.c
trace.c
wakeirq.c PM: sleep: wakeirq: fix wake irq warning in system suspend 2024-04-10 16:18:37 +02:00
wakeup.c
wakeup_stats.c