linux-pm.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Tony Lindgren <tony@atomide.com>
To: Brian Norris <briannorris@chromium.org>
Cc: Dmitry Torokhov <dmitry.torokhov@gmail.com>,
	"Rafael J . Wysocki" <rjw@rjwysocki.net>,
	Pavel Machek <pavel@ucw.cz>, Len Brown <len.brown@intel.com>,
	Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	lkml <linux-kernel@vger.kernel.org>,
	Brian Norris <computersforpeace@gmail.com>,
	"linux-pm@vger.kernel.org" <linux-pm@vger.kernel.org>,
	Grygorii Strashko <grygorii.strashko@ti.com>,
	linux-omap@vger.kernel.org
Subject: Re: [PATCH] PM / wakeirq: report wakeup events in dedicated wake-IRQs
Date: Fri, 11 Nov 2016 12:17:52 -0800	[thread overview]
Message-ID: <20161111201751.GH7138@atomide.com> (raw)
In-Reply-To: <20161111194041.GA111624@google.com>

* Brian Norris <briannorris@chromium.org> [161111 11:40]:
> 
> BTW, for context, I'm working on using dev_pm_set_dedicated_wake_irq()
> for a Wifi driver which supports out-of-band (e.g., GPIO-based) wakeup.
> I see it's used in the I2C core, but the I2C code never actually calls
> dev_pm_enable_wake_irq(). So while I think I can use this API OK for
> my Wifi driver (calling dev_pm_{en,dis}able_wake_irq() at system
> suspend/resume), I'm not sure this will help the I2C case.

OK it's used for that purpose with the SDIO dat1 interrupt for
omaps. This allows the WLAN to stay on and connected while the
SoC can hit deeper idle states.

The calling of dev_pm_enable_wake_irq() happens automagically from
rpm_suspend() and then it's disabled after rpm_resume().

> The more I look at this API, the more I'm confused, especially about its
> seeming dependence on runtime PM.

Are you talking about suspend/resume only? If so, see if the
following snippet from Grygorii helps. Grygorii, care to send it with
proper description and Signed-off-by if you did not yet do that?

Regards,

Tony

8< ----------------------
--- a/drivers/base/power/wakeirq.c
+++ b/drivers/base/power/wakeirq.c
@@ -256,8 +256,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->dedicated_irq)
+			enable_irq(wirq->irq);
+
 		enable_irq_wake(wirq->irq);
+	}
 }
 
 /**
@@ -272,6 +276,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->dedicated_irq)
+			disable_irq_nosync(wirq->irq);
+	}
 }

  reply	other threads:[~2016-11-11 20:17 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
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 [this message]
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

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20161111201751.GH7138@atomide.com \
    --to=tony@atomide.com \
    --cc=briannorris@chromium.org \
    --cc=computersforpeace@gmail.com \
    --cc=dmitry.torokhov@gmail.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=grygorii.strashko@ti.com \
    --cc=len.brown@intel.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-omap@vger.kernel.org \
    --cc=linux-pm@vger.kernel.org \
    --cc=pavel@ucw.cz \
    --cc=rjw@rjwysocki.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).