OpenCloudOS-Kernel/drivers/base/power
Qingliang Li 677aa47e3e 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-03 15:28:24 +02:00
..
Makefile PM / QoS: Initial kunit test 2019-11-29 12:04:49 +01:00
clock_ops.c PM: runtime: add devm_pm_clk_create helper 2021-08-26 11:28:07 -07:00
common.c PM: domains: Extend dev_pm_domain_detach() doc 2022-04-13 17:07:58 +02:00
domain.c pmdomain: core: Move the unused cleanup to a _sync initcall 2024-02-23 09:25:17 +01:00
domain_governor.c PM: domains: Store the next hrtimer wakeup in genpd 2022-11-09 21:14:21 -06:00
generic_ops.c drivers: base: power: add proper SPDX identifiers on files that did not have them. 2019-04-04 20:03:40 +02:00
main.c PM: sleep: Fix possible deadlocks in core system-wide PM code 2024-01-31 16:18:49 -08:00
power.h PM: sleep: wakeirq: fix wake irq arming 2023-07-24 09:51:51 +02:00
qos-test.c kunit: allow kunit tests to be loaded as a module 2020-01-09 16:42:29 -07:00
qos.c PM / QoS: Restore DEV_PM_QOS_MIN/MAX_FREQUENCY 2019-11-29 12:04:50 +01:00
runtime.c Power management updates for 6.3-rc1 2023-02-21 12:13:58 -08:00
sysfs.c drivers core: Miscellaneous changes for sysfs_emit 2020-10-02 13:12:07 +02:00
trace.c rtc: Extend timeout for waiting for UIP to clear to 1s 2024-01-31 16:18:56 -08:00
wakeirq.c PM: sleep: wakeirq: fix wake irq warning in system suspend 2024-04-03 15:28:24 +02:00
wakeup.c PM: suspend: Fix pm_suspend_target_state handling for !CONFIG_PM 2023-05-24 18:52:14 +02:00
wakeup_stats.c driver core: class: remove module * from class_create() 2023-03-17 15:16:33 +01:00