From: "Rafael J. Wysocki" <rjw@sisk.pl>
To: Alan Stern <stern@rowland.harvard.edu>
Cc: "Linux-pm mailing list" <linux-pm@lists.linux-foundation.org>,
Magnus Damm <magnus.damm@gmail.com>, Greg KH <gregkh@suse.de>,
Pavel Machek <pavel@ucw.cz>, Len Brown <lenb@kernel.org>,
LKML <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH update x2] PM: Introduce core framework for run-time PM of I/O devices (rev. 13)
Date: Sat, 8 Aug 2009 16:03:02 +0200 [thread overview]
Message-ID: <200908081603.02713.rjw@sisk.pl> (raw)
In-Reply-To: <Pine.LNX.4.44L0.0908071130440.3063-100000@iolanthe.rowland.org>
On Friday 07 August 2009, Alan Stern wrote:
> On Thu, 6 Aug 2009, Rafael J. Wysocki wrote:
>
> > Hi,
> >
> > The patch below should address all of your most recent comments.
>
> Only two comments.
>
>
> > +static int __pm_request_idle(struct device *dev)
> > +{
> ...
> > + if (dev->power.request_pending) {
> > + /* Any requests other then RPM_REQ_IDLE take precedence. */
> > + if (dev->power.request != RPM_REQ_NONE)
>
> Replace != with ==.
Good catch, thanks!
> > + dev->power.request = RPM_REQ_IDLE;
> > + else if (dev->power.request != RPM_REQ_IDLE)
> > + retval = -EAGAIN;
> > + return retval;
>
>
> > --- linux-2.6.orig/drivers/base/dd.c
> > +++ linux-2.6/drivers/base/dd.c
> ...
> > @@ -306,6 +317,8 @@ static void __device_release_driver(stru
> >
> > drv = dev->driver;
> > if (drv) {
> > + pm_runtime_disable(dev);
> > +
> > driver_sysfs_remove(dev);
> >
> > if (dev->bus)
> > @@ -324,6 +337,8 @@ static void __device_release_driver(stru
> > blocking_notifier_call_chain(&dev->bus->p->bus_notifier,
> > BUS_NOTIFY_UNBOUND_DRIVER,
> > dev);
> > +
> > + pm_runtime_enable(dev);
> > }
> > }
>
> We may need to be more careful here. The driver's remove method may
> want to do some runtime PM stuff to the device before giving up
> control. On the other hand I'm not sure what _should_ be done here, so
> I can't suggest anything better.
Hmm. Perhaps we can do something along the lines of our .probe() handling.
Namely, call
pm_runtime_disable(dev);
pm_runtime_get_noresume(dev);
pm_runtime_enable(dev);
before and
pm_runtime_put_noidle()
after? Then, if the driver's or bus type's .remove() needs to resume, it will
be able to do that right away and if it wants to suspend, it can always call
pm_runtime_put*(), because our pm_runtime_put_noidle() won't decrease the
usage counter below zero.
At the same time we can avoid "leftover" suspends that could interfere with
.remove() in case it needs to access the hardware.
Best,
Rafael
next prev parent reply other threads:[~2009-08-08 14:02 UTC|newest]
Thread overview: 20+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-08-03 21:36 [Resend][PATCH] PM: Introduce core framework for run-time PM of I/O devices (rev. 11) Rafael J. Wysocki
2009-08-04 20:33 ` Alan Stern
2009-08-05 0:19 ` Rafael J. Wysocki
2009-08-05 2:44 ` Alan Stern
2009-08-05 13:25 ` Rafael J. Wysocki
2009-08-05 21:47 ` [PATCH update] PM: Introduce core framework for run-time PM of I/O devices (rev. 12) Rafael J. Wysocki
2009-08-06 17:01 ` Alan Stern
2009-08-06 21:50 ` Rafael J. Wysocki
2009-08-07 13:59 ` Alan Stern
2009-08-06 21:53 ` [PATCH update x2] PM: Introduce core framework for run-time PM of I/O devices (rev. 13) Rafael J. Wysocki
2009-08-07 7:45 ` Magnus Damm
2009-08-07 13:54 ` Rafael J. Wysocki
2009-08-07 15:41 ` Alan Stern
2009-08-08 14:03 ` Rafael J. Wysocki [this message]
2009-08-08 15:50 ` Alan Stern
2009-08-08 21:55 ` Rafael J. Wysocki
2009-08-09 2:28 ` Alan Stern
2009-08-09 13:10 ` Rafael J. Wysocki
2009-08-09 15:19 ` Alan Stern
2009-08-09 20:49 ` Rafael J. Wysocki
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=200908081603.02713.rjw@sisk.pl \
--to=rjw@sisk.pl \
--cc=gregkh@suse.de \
--cc=lenb@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-pm@lists.linux-foundation.org \
--cc=magnus.damm@gmail.com \
--cc=pavel@ucw.cz \
--cc=stern@rowland.harvard.edu \
/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