Skip to content

Commit ba28f16

Browse files
grygoriySgregkh
authored andcommitted
PM / wakeirq: report a wakeup_event on dedicated wekup irq
[ Upstream commit 09bb6e93956ae5175b96905b723ec879c3ca0765 ] 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(). Fixes: 4990d4f (PM / Wakeirq: Add automated device wake IRQ handling) Signed-off-by: Grygorii Strashko <grygorii.strashko@ti.com> Tested-by: Keerthy <j-keerthy@ti.com> [ tony@atomide.com: added missing return to avoid warnings ] Tested-by: Tony Lindgren <tony@atomide.com> Signed-off-by: Tony Lindgren <tony@atomide.com> Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com> Signed-off-by: Sasha Levin <alexander.levin@verizon.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
1 parent b83c288 commit ba28f16

1 file changed

Lines changed: 7 additions & 0 deletions

File tree

drivers/base/power/wakeirq.c

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -141,6 +141,13 @@ static irqreturn_t handle_threaded_wake_irq(int irq, void *_wirq)
141141
struct wake_irq *wirq = _wirq;
142142
int res;
143143

144+
/* Maybe abort suspend? */
145+
if (irqd_is_wakeup_set(irq_get_irq_data(irq))) {
146+
pm_wakeup_event(wirq->dev, 0);
147+
148+
return IRQ_HANDLED;
149+
}
150+
144151
/* We don't want RPM_ASYNC or RPM_NOWAIT here */
145152
res = pm_runtime_resume(wirq->dev);
146153
if (res < 0)

0 commit comments

Comments
 (0)