public inbox for linux-pm@vger.kernel.org
 help / color / mirror / Atom feed
From: Adam Belay <ambx1@neo.rr.com>
To: Benjamin Herrenschmidt <benh@kernel.crashing.org>,
	Pavel Machek <pavel@ucw.cz>
Cc: Andrew Morton <akpm@osdl.org>,
	Linux-USB <linux-usb-devel@lists.sourceforge.net>,
	Linux-pm mailing list <linux-pm@lists.osdl.org>,
	Linux Kernel list <linux-kernel@vger.kernel.org>,
	alexn@dsv.su.se, gud@eth.net, Adam Belay <abelay@novell.com>,
	Dave Jones <davej@redhat.com>,
	linux-pci@atrey.karlin.mff.cuni.cz,
	Jeff Garzik <jgarzik@pobox.com>,
	cramerj@intel.com
Subject: Re: [PATCH] PCI: Add pci shutdown ability
Date: Tue, 26 Apr 2005 02:23:14 -0400	[thread overview]
Message-ID: <20050426062314.GC3951@neo.rr.com> (raw)
In-Reply-To: <1114489949.7111.43.camel@gaston>

[-- Attachment #1: Type: text/plain, Size: 3024 bytes --]

On Tue, Apr 26, 2005 at 02:32:29PM +1000, Benjamin Herrenschmidt wrote:

-->snip

> 
> I don't like this notion of "stop" separated from power states anyway, I
> think it just doesn't work in practice.

Yeah, after giving it some additional thought, I think there are better ways.

> 
> Ben.
> 

Ok, here's a new idea.

For many devices "->suspend" and "->resume" with pm_message_t is exactly what
we need.  However, as we support more advanced power management features, such
as runtime power management, or power containers, we need something a little
more specific.  The exact power state must be specified among other issues.

We might do something like this:

Keep "->suspend" and "->resume" around unchanged. (so the states would
probably remain as PMSG_FREEZE and PMSG_SUSPEND).  If the driver doesn't
support the more advanced PM methods just use these.  They work well enough
for system sleep states etc.

Alternatively drivers could support a more rich power management interface
via the following methods:


change_state - changes a device's power state

change_state(struct device * dev, pm_state_t state, struct system_state * sys_state, int reason);  
@dev - the device
@state - the target device-specific power state
@sys_state - a data structure containing information about the intended global system power state
@reason - why the state must be changed (ex. RUNTIME_PM, SYSTEM_SLEEP, SYSTEM_RESUME, etc.)


halt - acts somewhat like PMSG_FREEZE, stops device activity, doesn't change power state

halt(struct device * dev, struct system_state * sys_state, int reason);
@dev - the device
@sys_state - a data structure containing information about the intended global system power state
@reason - why we are halting operation (ex. RUNTIME_CHANGES (like cpufreq), SYSTEM_SLEEP, SHUTDOWN, REBOOT)  


contine - resumes from a "halt"

continue(struct device * dev, struct system_state * sys_state, int reason);
@dev - the device
@sys_state - a data structure containing information about the intended global system power state
@reason - why we are resuming operation (ex. RUNTIME_CHANGES (like cpufreq), SYSTEM_RESUME)  


When changing system state, we call "change_state" for every device with power
resources.  Devices that do not directly consume power or have power states
will not implement "change_state" so we will call "halt" and "continue"
instead.

When shutting down the system, halt has the option of turning off the device,
as it will see the SHUTDOWN reason.  So it's a driver-knows-best approach
instead of assuming everything must be turned off, or everything must just be
stopped.

So in theory, with cpufreq, we could stop userspace, ->halt every device
(drivers won't do anything if they know it's not necessary), change the
frequency, and then resume operation.

We may want to create structures like pm_message_t for "change_state", "halt",
and "continue".  Pavel, do you have any thoughts on this?

This is just a rough idea... I look forward to any comments or suggestions.

Thanks,
Adam

[-- Attachment #2: Type: text/plain, Size: 0 bytes --]



       reply	other threads:[~2005-04-26  6:23 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <1114458325.983.17.camel@localhost.localdomain>
     [not found] ` <Pine.LNX.4.44L0.0504251609420.7408-100000@iolanthe.rowland.org>
     [not found]   ` <20050425145831.48f27edb.akpm@osdl.org>
     [not found]     ` <20050425221326.GC15366@redhat.com>
     [not found]       ` <20050425232330.GG27771@neo.rr.com>
     [not found]         ` <1114489949.7111.43.camel@gaston>
2005-04-26  6:23           ` Adam Belay [this message]
2005-04-26  7:14             ` Re: [PATCH] PCI: Add pci shutdown ability Nigel Cunningham
2005-04-26  9:16             ` Pavel Machek
     [not found] <Pine.LNX.4.44L0.0504251128070.5751-100000@iolanthe.rowland.org>
     [not found] ` <20050425182951.GA23209@kroah.com>
     [not found]   ` <SVLXCHCON1syWVLEFN00000099e@SVLXCHCON1.enterprise.veritas.com>
     [not found]     ` <20050425185113.GC23209@kroah.com>
     [not found]       ` <20050425190606.GA23763@kroah.com>
2005-04-25 20:08         ` Adam Belay
2005-04-25 20:19           ` Greg KH
2005-04-25 20:24             ` Adam Belay
     [not found]         ` <426D439D.6080705@pobox.com>
2005-04-25 20:11           ` Adam Belay

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=20050426062314.GC3951@neo.rr.com \
    --to=ambx1@neo.rr.com \
    --cc=abelay@novell.com \
    --cc=akpm@osdl.org \
    --cc=alexn@dsv.su.se \
    --cc=benh@kernel.crashing.org \
    --cc=cramerj@intel.com \
    --cc=davej@redhat.com \
    --cc=gud@eth.net \
    --cc=jgarzik@pobox.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-pci@atrey.karlin.mff.cuni.cz \
    --cc=linux-pm@lists.osdl.org \
    --cc=linux-usb-devel@lists.sourceforge.net \
    --cc=pavel@ucw.cz \
    /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