Skip to content

Commit c843455

Browse files
grygoriySrafaeljw
authored andcommitted
PM / wakeirq: Enable dedicated wakeirq for suspend
We currently rely on runtime PM to enable dedicated wakeirq for suspend. This assumption fails in the following two cases: 1. If the consumer driver does not have runtime PM implemented, the dedicated wakeirq never gets enabled for suspend 2. If the consumer driver has runtime PM implemented, but does not idle in suspend Let's fix the issue by always enabling the dedicated wakeirq during suspend. Depends-on: bed5703 (PM / wakeirq: Fix dedicated wakeirq for drivers not using autosuspend) Fixes: 4990d4f (PM / Wakeirq: Add automated device wake IRQ handling) Reported-by: Keerthy <[email protected]> Tested-by: Keerthy <[email protected]> Signed-off-by: Grygorii Strashko <[email protected]> [ [email protected]: updated based on bed5703, added description ] Tested-by: Tony Lindgren <[email protected]> Signed-off-by: Tony Lindgren <[email protected]> Signed-off-by: Rafael J. Wysocki <[email protected]>
1 parent 7089db8 commit c843455

File tree

1 file changed

+10
-2
lines changed

1 file changed

+10
-2
lines changed

drivers/base/power/wakeirq.c

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -312,8 +312,12 @@ void dev_pm_arm_wake_irq(struct wake_irq *wirq)
312312
if (!wirq)
313313
return;
314314

315-
if (device_may_wakeup(wirq->dev))
315+
if (device_may_wakeup(wirq->dev)) {
316+
if (wirq->status & WAKE_IRQ_DEDICATED_ALLOCATED)
317+
enable_irq(wirq->irq);
318+
316319
enable_irq_wake(wirq->irq);
320+
}
317321
}
318322

319323
/**
@@ -328,6 +332,10 @@ void dev_pm_disarm_wake_irq(struct wake_irq *wirq)
328332
if (!wirq)
329333
return;
330334

331-
if (device_may_wakeup(wirq->dev))
335+
if (device_may_wakeup(wirq->dev)) {
332336
disable_irq_wake(wirq->irq);
337+
338+
if (wirq->status & WAKE_IRQ_DEDICATED_ALLOCATED)
339+
disable_irq_nosync(wirq->irq);
340+
}
333341
}

0 commit comments

Comments
 (0)