Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1578829 > unrolled thread

[PATCH 1/2] PM / wakeirq: Enable dedicated wakeirq for suspend

Started byTony Lindgren <tony@atomide.com>
First post2017-02-10 23:30 +0100
Last post2017-02-10 23:30 +0100
Articles 1 — 1 participant

Back to article view | Back to linux.kernel

This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by below is the oldest one visible, not the original post.


Contents

  [PATCH 1/2] PM / wakeirq: Enable dedicated wakeirq for suspend Tony Lindgren <tony@atomide.com> - 2017-02-10 23:30 +0100

#1578829 — [PATCH 1/2] PM / wakeirq: Enable dedicated wakeirq for suspend

FromTony Lindgren <tony@atomide.com>
Date2017-02-10 23:30 +0100
Subject[PATCH 1/2] PM / wakeirq: Enable dedicated wakeirq for suspend
Message-ID<t9rRv-Xp-11@gated-at.bofh.it>
From: Grygorii Strashko <grygorii.strashko@ti.com>

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: bed570307ed7 ("PM / wakeirq: Fix dedicated wakeirq for
drivers not using autosuspend")
Fixes: 4990d4fe327b ("PM / Wakeirq: Add automated device wake IRQ
handling")
Cc: Brian Norris <briannorris@chromium.org>
Cc: Tero Kristo <t-kristo@ti.com>
Reported-by: Keerthy <j-keerthy@ti.com>
Tested-by: Keerthy <j-keerthy@ti.com>
Signed-off-by: Grygorii Strashko <grygorii.strashko@ti.com>
[tony@atomide.com: updated based on bed570307ed7, added description]
Tested-by: Tony Lindgren <tony@atomide.com>
Signed-off-by: Tony Lindgren <tony@atomide.com>
---
 drivers/base/power/wakeirq.c | 12 ++++++++++--
 1 file changed, 10 insertions(+), 2 deletions(-)

diff --git a/drivers/base/power/wakeirq.c b/drivers/base/power/wakeirq.c
--- a/drivers/base/power/wakeirq.c
+++ b/drivers/base/power/wakeirq.c
@@ -312,8 +312,12 @@ void dev_pm_arm_wake_irq(struct wake_irq *wirq)
 	if (!wirq)
 		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);
+	}
 }
 
 /**
@@ -328,6 +332,10 @@ void dev_pm_disarm_wake_irq(struct wake_irq *wirq)
 	if (!wirq)
 		return;
 
-	if (device_may_wakeup(wirq->dev))
+	if (device_may_wakeup(wirq->dev)) {
 		disable_irq_wake(wirq->irq);
+
+		if (wirq->status & WAKE_IRQ_DEDICATED_ALLOCATED)
+			disable_irq_nosync(wirq->irq);
+	}
 }
-- 
2.11.1

[toc] | [standalone]


Back to top | Article view | linux.kernel


csiph-web