From: "Rafael J. Wysocki" <rjw@sisk.pl>
To: Alan Stern <stern@rowland.harvard.edu>
Cc: linux-pm <linux-pm@lists.osdl.org>, Pavel Machek <pavel@ucw.cz>
Subject: Re: [RFC][PATCH 2/2] PM: Remove saved_state from dev_pm_info
Date: Sun, 10 Jun 2007 19:10:44 +0200 [thread overview]
Message-ID: <200706101910.44409.rjw@sisk.pl> (raw)
In-Reply-To: <Pine.LNX.4.44L0.0706101018430.29131-100000@netrider.rowland.org>
On Sunday, 10 June 2007 16:32, Alan Stern wrote:
> On Sat, 9 Jun 2007, Rafael J. Wysocki wrote:
>
> > From: Rafael J. Wysocki <rjw@sisk.pl>
> >
> > The saved_state member of struct dev_pm_info, defined in include/linux/pm.h, is
> > not used anywhere, so it can be removed.
>
> Along the same lines, feature_removal_schedule.txt says that
> dev->power.power_state will be removed next month. In preparation,
> you could consider removing the prev_state member now. As far as I
> know, it isn't used for anything other than avoiding resume method
> calls to devices that were already suspended when a system sleep
> began.
Yes, I considered that too, but I decided to leave if for now in case something
depended on it.
I'll take another look. ;-)
> I suggest that suspend and resume always be called for every device
> during a system sleep transition, regardless of the device's state.
That's reasonable, I think.
> That will have to done anyway once dev->power.power_state is gone.
Besides, that would fix the issue with the current code that if
dev->class->suspend() changes dev->power.power_state.event to 'off',
then dev->bus->suspend() is not called, but dev->bus->resume() will be called
during the subsequent resume.
> The idea is that drivers should regard these method calls as
> notifications that the system is about to go to sleep or has just woken
> up, rather than as directives to put their device into a particular
> state.
>
> Thus, if a driver knows that its device was already in a low-power
> state before the system sleep then it need not respond to a resume
> method call by switching the device to a high-power state. Instead the
> driver should be free to take whatever action it thinks is appropriate.
> This is already explained in Documentation/power/devices.txt.
OK
I'll prepare a patch to remove the dev->power.power_state.event checks from the
suspend core code.
Greetings,
Rafael
--
"Premature optimization is the root of all evil." - Donald Knuth
next prev parent reply other threads:[~2007-06-10 17:10 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-06-09 21:29 [RFC][PATCH 0/2] PM: Remove two fields from dev_pm_info Rafael J. Wysocki
2007-06-09 21:31 ` [RFC][PATCH 1/2] PM: Remove pm_parent " Rafael J. Wysocki
2007-06-09 21:32 ` [RFC][PATCH 2/2] PM: Remove saved_state " Rafael J. Wysocki
2007-06-10 14:32 ` Alan Stern
2007-06-10 17:10 ` Rafael J. Wysocki [this message]
2007-06-10 23:31 ` [RFC][PATCH] PM: Remove prev_state " Rafael J. Wysocki
2007-06-11 14:14 ` Alan Stern
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=200706101910.44409.rjw@sisk.pl \
--to=rjw@sisk.pl \
--cc=linux-pm@lists.osdl.org \
--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