Commit 7b51d1fd authored by Qingliang Li's avatar Qingliang Li Committed by Treehugger Robot
Browse files

FROMGIT: 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.

Bug: 330244514
(cherry picked from commit e7a7681c
 https://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm.git


 linux-next)
Fixes: 8527beb1 ("PM: sleep: wakeirq: fix wake irq arming")
Reviewed-by: default avatarDhruva Gole <d-gole@ti.com>
Signed-off-by: default avatarQingliang Li <qingliang.li@mediatek.com>
Reviewed-by: default avatarJohan Hovold <johan+linaro@kernel.org>
Cc: 5.16+ <stable@vger.kernel.org> # 5.16+
Signed-off-by: default avatarRafael J. Wysocki <rafael.j.wysocki@intel.com>
Change-Id: I46ba27631ed5561123bd98dd32872837b726b5bd
parent a354271b
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment