LKML Archive on lore.kernel.org
help / color / mirror / Atom feed
From: Tony Lindgren <tony@atomide.com>
To: Alan Stern <stern@rowland.harvard.edu>
Cc: "Rafael J. Wysocki" <rjw@rjwysocki.net>,
	"Rafael J. Wysocki" <rafael.j.wysocki@intel.com>,
	Andreas Fenkart <afenkart@gmail.com>,
	Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	Felipe Balbi <balbi@ti.com>,
	Huiquan Zhong <huiquan.zhong@intel.com>,
	Kevin Hilman <khilman@kernel.org>, NeilBrown <neilb@suse.de>,
	Mika Westerberg <mika.westerberg@linux.intel.com>,
	Nishanth Menon <nm@ti.com>,
	Peter Hurley <peter@hurleysoftware.com>,
	Sebastian Andrzej Siewior <bigeasy@linutronix.de>,
	Ulf Hansson <ulf.hansson@linaro.org>,
	Thomas Gleixner <tglx@linutronix.de>,
	linux-kernel@vger.kernel.org, linux-serial@vger.kernel.org,
	linux-omap@vger.kernel.org,
	Linux PM list <linux-pm@vger.kernel.org>
Subject: Re: [PATCH 1/4] PM / Wakeirq: Add minimal device wakeirq helper functions
Date: Mon, 9 Mar 2015 09:41:25 -0700	[thread overview]
Message-ID: <20150309164125.GG5264@atomide.com> (raw)
In-Reply-To: <Pine.LNX.4.44L0.1503091134240.1472-100000@iolanthe.rowland.org>

* Alan Stern <stern@rowland.harvard.edu> [150309 08:42]:
> On Mon, 9 Mar 2015, Tony Lindgren wrote:
> 
> > > > > > Considering the above, should we add a new function something like
> > > > > > pm_resume_complete() that does not need irq_safe set but does
> > > > > > not return until the device has completed resume?
> > > > > 
> > > > > That doesn't make sense.  You're asking for a routine that is allowed
> > > > > to sleep but can safely be called in interrupt context.
> > > > 
> > > > Oh it naturally would not work in irq context, it's for the bottom
> > > > half again.
> > > 
> > > In other words, you're suggesting we add a function that runs in 
> > > process context and doesn't return until the device is fully resumed?  
> > > That's exactly what pm_runtime_resume does right now.
> > 
> > But doesn't it only wait for completion if the driver is marked with
> > pm_runtime_irq_safe()?
> 
> Put it this way: pm_runtime_resume invokes a ->runtime_resume
> callback routine (the subsystem's or the driver's or whichever), and it
> assumes that if the routine returns 0 then the device has been resumed.  
> It doesn't really _wait_ for anything; it just calls the callback
> routine.
> 
> It behaves this way whether or not the irq_safe flag is set.  The only
> difference is that if irq_safe is set then the callback routine is
> invoked with interrupts disabled (and in this case pm_runtime_resume
> may be called in interrupt context -- normally it can be called only in
> process context).

Oh right you are. Looking at rpm_resume() again, it's the RPM_ASYNC that
was causing problems to me earlier, not the irq_safe. Sorry it seems I
was a bit confused. And yes, pm_runtime_resume() does not set RPM_ASYNC
like you pointed out earlier so no need to do anything there.

Regards,

Tony

  reply	other threads:[~2015-03-09 16:46 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-03-06  0:34 [PATCH 0/4] Minimal generic wakeirq helpers Tony Lindgren
2015-03-06  0:34 ` [PATCH 1/4] PM / Wakeirq: Add minimal device wakeirq helper functions Tony Lindgren
2015-03-06  2:02   ` Rafael J. Wysocki
2015-03-06 12:41     ` Rafael J. Wysocki
2015-03-06 16:19     ` Tony Lindgren
2015-03-06 19:05       ` Alan Stern
2015-03-06 23:05         ` Tony Lindgren
2015-03-07  0:43           ` Rafael J. Wysocki
2015-03-07  1:09             ` Tony Lindgren
2015-03-08 15:43             ` Alan Stern
2015-03-09 14:09               ` Rafael J. Wysocki
2015-03-08 15:41           ` Alan Stern
2015-03-09 15:09             ` Tony Lindgren
2015-03-09 15:42               ` Alan Stern
2015-03-09 16:41                 ` Tony Lindgren [this message]
2015-03-06 23:30         ` Rafael J. Wysocki
2015-03-08 15:34           ` Alan Stern
2015-03-06  0:34 ` [PATCH 2/4] serial: 8250_omap: Move wake-up interrupt to generic wakeirq Tony Lindgren
2015-03-06  0:34 ` [PATCH 3/4] serial: omap: Switch " Tony Lindgren
2015-03-06  0:34 ` [PATCH 4/4] mmc: omap_hsmmc: Change wake-up interrupt to use " Tony Lindgren

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=20150309164125.GG5264@atomide.com \
    --to=tony@atomide.com \
    --cc=afenkart@gmail.com \
    --cc=balbi@ti.com \
    --cc=bigeasy@linutronix.de \
    --cc=gregkh@linuxfoundation.org \
    --cc=huiquan.zhong@intel.com \
    --cc=khilman@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-omap@vger.kernel.org \
    --cc=linux-pm@vger.kernel.org \
    --cc=linux-serial@vger.kernel.org \
    --cc=mika.westerberg@linux.intel.com \
    --cc=neilb@suse.de \
    --cc=nm@ti.com \
    --cc=peter@hurleysoftware.com \
    --cc=rafael.j.wysocki@intel.com \
    --cc=rjw@rjwysocki.net \
    --cc=stern@rowland.harvard.edu \
    --cc=tglx@linutronix.de \
    --cc=ulf.hansson@linaro.org \
    --subject='Re: [PATCH 1/4] PM / Wakeirq: Add minimal device wakeirq helper functions' \
    /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

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).