linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] PM / wakeirq: report wakeup events in dedicated wake-IRQs
@ 2016-11-10 18:07 Brian Norris
  2016-11-10 18:13 ` Dmitry Torokhov
  2016-11-10 20:57 ` Pavel Machek
  0 siblings, 2 replies; 23+ messages in thread
From: Brian Norris @ 2016-11-10 18:07 UTC (permalink / raw)
  To: Rafael J . Wysocki, Pavel Machek, Len Brown, Greg Kroah-Hartman
  Cc: linux-kernel, Brian Norris, linux-pm, Tony Lindgren,
	Dmitry Torokhov, Brian Norris

It's important that user space can figure out what device woke the
system from suspend -- e.g., for debugging, or for implementing
conditional wake behavior. Dedicated wakeup IRQs don't currently do
that.

Let's report the event (pm_wakeup_event()) and also allow drivers to
synchronize with these events in their resume path (hence, disable_irq()
instead of disable_irq_nosync()).

Signed-off-by: Brian Norris <briannorris@chromium.org>
---
 drivers/base/power/wakeirq.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/drivers/base/power/wakeirq.c b/drivers/base/power/wakeirq.c
index 0d77cd6fd8d1..c35b2db1194c 100644
--- a/drivers/base/power/wakeirq.c
+++ b/drivers/base/power/wakeirq.c
@@ -139,6 +139,8 @@ static irqreturn_t handle_threaded_wake_irq(int irq, void *_wirq)
 	struct wake_irq *wirq = _wirq;
 	int res;
 
+	pm_wakeup_event(wirq->dev, 0);
+
 	/* We don't want RPM_ASYNC or RPM_NOWAIT here */
 	res = pm_runtime_resume(wirq->dev);
 	if (res < 0)
@@ -240,7 +242,7 @@ void dev_pm_disable_wake_irq(struct device *dev)
 	struct wake_irq *wirq = dev->power.wakeirq;
 
 	if (wirq && wirq->dedicated_irq)
-		disable_irq_nosync(wirq->irq);
+		disable_irq(wirq->irq);
 }
 EXPORT_SYMBOL_GPL(dev_pm_disable_wake_irq);
 
-- 
2.8.0.rc3.226.g39d4020

^ permalink raw reply related	[flat|nested] 23+ messages in thread

end of thread, other threads:[~2016-11-24 14:28 UTC | newest]

Thread overview: 23+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-11-10 18:07 [PATCH] PM / wakeirq: report wakeup events in dedicated wake-IRQs Brian Norris
2016-11-10 18:13 ` Dmitry Torokhov
2016-11-10 18:49   ` Brian Norris
2016-11-10 20:49     ` Tony Lindgren
2016-11-10 21:30       ` Brian Norris
2016-11-11 16:47         ` Tony Lindgren
2016-11-11 19:40           ` Brian Norris
2016-11-11 20:17             ` Tony Lindgren
2016-11-11 21:09             ` Alan Stern
2016-11-11 21:40             ` Rafael J. Wysocki
2016-11-11  0:06     ` Rafael J. Wysocki
2016-11-11 16:31       ` Tony Lindgren
2016-11-11 21:33         ` Rafael J. Wysocki
2016-11-11 22:29           ` Tony Lindgren
2016-11-11 22:32             ` Tony Lindgren
2016-11-11 23:34               ` Rafael J. Wysocki
2016-11-12  0:19                 ` Tony Lindgren
2016-11-12  0:35                   ` Rafael J. Wysocki
2016-11-18 20:18                     ` Tony Lindgren
2016-11-23 22:37                       ` Rafael J. Wysocki
2016-11-24 14:27                         ` Tony Lindgren
2016-11-10 20:57 ` Pavel Machek
2016-11-10 21:39   ` Brian Norris

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).