On Sat, 2021-10-23 at 14:35 +0800, Chunfeng Yun wrote:
On Tue, 2021-10-19 at 17:28 +0200, Rafael J. Wysocki wrote:
quoted
On Wed, Aug 11, 2021 at 5:05 AM Chunfeng Yun <
chunfeng.yun@mediatek.com> wrote:
quoted
When the dedicated wake-irq is level trigger, and it uses the
consumer's sleep status as the wakeup source, that means if the
consumer is not in sleep state, the wake-irq will be triggered
when enable it; For this case, need enable the wake-irq after
invoking the consumer's runtime_suspend() which make the consumer
enter sleep state.
[...]
If want to make it static, should move it from wakeirq.c into
runtime.c
quoted
quoted
{
struct wake_irq *wirq = dev->power.wakeirq;
if (!wirq || !(wirq->status & WAKE_IRQ_DEDICATED_MASK))
return;
And I would just add the following line here:
if (cond_disable && (wirq->status &
WAKE_IRQ_DEDICATED_LATE_ENABLED))
return;
This change doesn't cover the case (WAKE_IRQ_DEDICATED_LATE_ENABLED
and
WAKE_IRQ_DEDICATED_MANAGED are both set 1):
-->rpm_suspend(): wirq->irq is enabled
-->rpm_resume(): disable wirq->irq; (if change it, doesn't disable
wirq->irq)
Seems I'm wrong, check again.
quoted
quoted
- if (wirq->status & WAKE_IRQ_DEDICATED_MANAGED)
+ if (wirq->status & WAKE_IRQ_DEDICATED_MANAGED &&
+ (skip_late_enabled_status ||
+ !(wirq->status & WAKE_IRQ_DEDICATED_LATE_ENABLED)))
disable_irq_nosync(wirq->irq);
}
+/**
+ * dev_pm_enable_wake_irq_complete - enable wake irq based on
status