From: "Rafael J. Wysocki" <rjw@sisk.pl>
To: Alan Stern <stern@rowland.harvard.edu>
Cc: "linux-pm@lists.linux-foundation.org"
<linux-pm@lists.linux-foundation.org>
Subject: Re: Runtime PM: Calling Device runtime PM callbacks?
Date: Mon, 14 Dec 2009 23:28:15 +0100 [thread overview]
Message-ID: <200912142328.15796.rjw@sisk.pl> (raw)
In-Reply-To: <Pine.LNX.4.44L0.0912141703330.2690-100000@iolanthe.rowland.org>
On Monday 14 December 2009, Alan Stern wrote:
> On Mon, 14 Dec 2009, Rafael J. Wysocki wrote:
>
> > On Monday 14 December 2009, Alan Stern wrote:
> > > On Mon, 14 Dec 2009, Rafael J. Wysocki wrote:
> > >
> > > > There you go (untested for now).
> > > >
> > > > ->runtime_idle() is still only called for the device's bus type, because
> > > > otherwise it will be hard to determine the right ordering of the bus type,
> > > > device type and device class callbacks.
> > >
> > > Shouldn't it be the same as runtime_suspend and runtime_resume?
> >
> > Well, the ordering is different in each of them ...
>
> Why not just copy the order used by device_suspend(): class, then type,
> then bus?
Do you mean in _idle?
> Actually, I don't know of any cases where the order matters. But there
> may be some, for system suspend. Runtime suspend is new enough that
> people will adapt.
Still, calling them in the reverse order in resume is kind of logical ...
> > > What's the reason for error_ptr here? Its value will always be the
> > > same as the return value except in the case where none of the callbacks
> > > are defined. Why not just use -ENOSYS in that case and eliminate
> > > error_ptr?
> >
> > To preserve the existing logic.
> >
> > Namely, without the patch dev->power.runtime error is not updated in the
> > -ENOSYS case and that actually is for a reason (we don't want runtime_error to
> > be set merely because there's no callbacks to execute). I could check the
> > return value, but what if one of the callbacks returns -ENOSYS?
>
> Don't worry about it. -ENOSYS means the operation isn't implemented.
> So if somebody's method implementation tells you that the method isn't
> implemented, they'll get what they deserve. :-)
OK
Rafael
next prev parent reply other threads:[~2009-12-14 22:28 UTC|newest]
Thread overview: 23+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-12-13 5:20 Runtime PM: Calling Device runtime PM callbacks? Mahalingam, Nithish
2009-12-13 12:34 ` Rafael J. Wysocki
2009-12-13 16:57 ` Alan Stern
2009-12-13 18:36 ` Rafael J. Wysocki
2009-12-13 18:49 ` Alan Stern
2009-12-14 0:03 ` Rafael J. Wysocki
2009-12-14 3:36 ` Mahalingam, Nithish
2009-12-14 4:42 ` Alan Stern
2009-12-14 21:58 ` Rafael J. Wysocki
2009-12-14 4:37 ` Alan Stern
2009-12-14 21:57 ` Rafael J. Wysocki
2009-12-14 22:08 ` Alan Stern
2009-12-14 22:28 ` Rafael J. Wysocki [this message]
2009-12-14 23:09 ` Alan Stern
2009-12-14 23:26 ` Rafael J. Wysocki
2009-12-15 3:11 ` Mahalingam, Nithish
2009-12-15 14:40 ` Alan Stern
2009-12-15 20:30 ` Rafael J. Wysocki
2009-12-15 20:51 ` Alan Stern
2009-12-15 21:04 ` Rafael J. Wysocki
2009-12-19 15:13 ` Rafael J. Wysocki
2009-12-19 16:46 ` Alan Stern
2009-12-19 21:31 ` 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=200912142328.15796.rjw@sisk.pl \
--to=rjw@sisk.pl \
--cc=linux-pm@lists.linux-foundation.org \
--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