Commit c8434559 authored by Grygorii Strashko's avatar Grygorii Strashko Committed by Rafael J. Wysocki

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: bed57030 (PM / wakeirq: Fix dedicated wakeirq for drivers not using autosuspend)
Fixes: 4990d4fe (PM / Wakeirq: Add automated device wake IRQ handling)
Reported-by: default avatarKeerthy <j-keerthy@ti.com>
Tested-by: default avatarKeerthy <j-keerthy@ti.com>
Signed-off-by: default avatarGrygorii Strashko <grygorii.strashko@ti.com>
[ tony@atomide.com: updated based on bed57030, added description ]
Tested-by: default avatarTony Lindgren <tony@atomide.com>
Signed-off-by: default avatarTony Lindgren <tony@atomide.com>
Signed-off-by: default avatarRafael J. Wysocki <rafael.j.wysocki@intel.com>
parent 7089db84
...@@ -312,8 +312,12 @@ void dev_pm_arm_wake_irq(struct wake_irq *wirq) ...@@ -312,8 +312,12 @@ void dev_pm_arm_wake_irq(struct wake_irq *wirq)
if (!wirq) if (!wirq)
return; return;
if (device_may_wakeup(wirq->dev)) if (device_may_wakeup(wirq->dev)) {
if (wirq->status & WAKE_IRQ_DEDICATED_ALLOCATED)
enable_irq(wirq->irq);
enable_irq_wake(wirq->irq); enable_irq_wake(wirq->irq);
}
} }
/** /**
...@@ -328,6 +332,10 @@ void dev_pm_disarm_wake_irq(struct wake_irq *wirq) ...@@ -328,6 +332,10 @@ void dev_pm_disarm_wake_irq(struct wake_irq *wirq)
if (!wirq) if (!wirq)
return; return;
if (device_may_wakeup(wirq->dev)) if (device_may_wakeup(wirq->dev)) {
disable_irq_wake(wirq->irq); disable_irq_wake(wirq->irq);
if (wirq->status & WAKE_IRQ_DEDICATED_ALLOCATED)
disable_irq_nosync(wirq->irq);
}
} }
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment