PM / wakeirq: report a wakeup_event on dedicated wekup irq
Subsystems (4)
PATCH 1/1 PM / wakeirq: report a wakeup_event on dedicated wekup irq
From: Grygorii Strashko <[email protected]>
There are two reasons for reporting wakeup event when dedicated wakeup IRQ is triggered:
- wakeup events accounting, so proper statistical data will be displayed in sysfs and debugfs;
- there are small window when System is entering suspend during which dedicated wakeup IRQ can be lost:
dpm_suspend_noirq()
|- device_wakeup_arm_wake_irqs()
|- dev_pm_arm_wake_irq(X)
|- IRQ is enabled and marked as wakeup source
[1]...
|- suspend_device_irqs()
|- suspend_device_irq(X)
|- irqd_set(X, IRQD_WAKEUP_ARMED);
|- wakup IRQ armed
The wakeup IRQ can be lost if it's triggered at point [1] and not armed yet.
Hence, fix above cases by adding simple pm_wakeup_event() call in handle_threaded_wake_irq().
handling")
--- drivers/base/power/wakeirq.c | 7 +++++++ 1 file changed, 7 insertions(+)
drivers/base/power/wakeirq.c +7 -0
@@ -141,6 +141,13 @@ static irqreturn_t handle_threaded_wake_irq(int irq, void *_wirq)struct wake_irq *wirq = _wirq;int res; +/* Maybe abort suspend? */ +if (irqd_is_wakeup_set (irq_get_irq_data (irq))) { +pm_wakeup_event (wirq->dev,0 ); + +return IRQ_HANDLED ; + } +/* We don't want RPM_ASYNC or RPM_NOWAIT here */ res =pm_runtime_resume (wirq->dev);if (res <0 )
Signature · 1 line
2.11.1
Quoted 28 lines · Tony Lindgren
From: Grygorii Strashko <[email protected]>
There are two reasons for reporting wakeup event when dedicated wakeup IRQ is triggered:
- wakeup events accounting, so proper statistical data will be displayed in sysfs and debugfs;
- there are small window when System is entering suspend during which dedicated wakeup IRQ can be lost:
dpm_suspend_noirq()
|-device_wakeup_arm_wake_irqs()
|-dev_pm_arm_wake_irq(X)
|- IRQ is enabled and marked as wakeup source
[1]...
|-suspend_device_irqs()
|-suspend_device_irq(X)
|-irqd_set(X, IRQD_WAKEUP_ARMED);
|- wakup IRQ armedThe wakeup IRQ can be lost if it's triggered at point [1] and not armed yet.
Hence, fix above cases by adding simple
pm_wakeup_event()call inhandle_threaded_wake_irq().Fixes 4990d4fe327b ("PM / Wakeirq: Add automated device wake IRQ
Quoted 8 lines
handling")
Cc Brian Norris <[email protected]>Cc Tero Kristo <[email protected]>Signed-off-by Grygorii Strashko <[email protected]>Tested-by Keerthy <[email protected]>[[email protected]: added missing return to avoid warnings]Tested-by Tony Lindgren <[email protected]>Signed-off-by Tony Lindgren <[email protected]>
Applied (along with the other two wakeirq fixes).
Thanks,
Rafael