public inbox for linux-pm@vger.kernel.org
 help / color / mirror / Atom feed
* RE: RE: on-ness
@ 2006-04-21 17:58 Preece Scott-PREECE
  2006-04-21 18:15 ` David Brownell
  0 siblings, 1 reply; 22+ messages in thread
From: Preece Scott-PREECE @ 2006-04-21 17:58 UTC (permalink / raw)
  To: Pavel Machek, Brown, Len; +Cc: David Brownell, linux-pm

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

I think Pavel's points are important. Unless we're prepared to expose
exactly the ACPI semantics (and I don't think we are), we need to make
sure that the namespace is not easily confused with ACPI's namespace.

I would also prefer names to numbers, for the reasons already pointed
out - harder to confuse, less likely to be taken as an
arithmetically-interpretable ordered sequence, and easier to insert new
values into actual ordered sequences. 

However, I also have to admit that I like the notion of the zero-state
meaning having a consistent meaning across the different atttributes and
it might be good to have a similarly consistent name for the
maximum/full-operation state across the attributes...

scott

-----Original Message-----
From: linux-pm-bounces@lists.osdl.org
[mailto:linux-pm-bounces@lists.osdl.org] On Behalf Of Pavel Machek
Sent: Thursday, April 20, 2006 8:26 AM
To: Brown, Len
Cc: David Brownell; linux-pm@lists.osdl.org
Subject: Re: [linux-pm] RE: on-ness

Hi!

> (restored linux-pm to cc:)

> no, if the numbers happen to corrolate to ACPI states, that is purely 
> lucky for the ACPI maintainer:-) But honestly, we should "leverage" 
> all we can from ACPI.
> My role, of course, it to make sure that the generic description can 
> accommodate everything ACPI can do.

Please, put there translation layer from the begining. Otherwise people
will assme they *are* ACPI states, and great confusion will begin.

See suspend functions, where half people assumed they are acpi Dx
states, half people thought they are pci Dx states, and half the people
assumed they are system Sx states.


It took quite long to sort out.

> yes, idle refers to either Cx or Dx states -- it depends on the 
> device.  0 means operating, non zero means non-operating.
> 
> Re: strings.
> we breifly debated strings vs numbers.
> I'm not confident that there are enough unique strings available 
> without falling into state0, state1, state2, state3 -- so numbers 
> seemed simpler.
> The only issue I see with numbers is that they imply order, and it may

> be that some operating points might not have such a strict order.

Second issue is that you might want to "insert" between states.

Lets look at disk. Old disks had:

spinning
spindown

states. You'd name them 0 and 1, eventually apps will learn to use that.
But (some) newer disks have

spinning
slowspin
spindown

if app does echo 1 > state, it will get slowspin instead of spindown it
wanted.

Yes, inventing good names may be tricky in some cases, but in other
cases names are very natural (arm has sleep, deep sleep and big sleep,
iirc).... And we can always fall back to state0..state5.

						Pavel
--
Thanks, Sharp!


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



^ permalink raw reply	[flat|nested] 22+ messages in thread
* Re: RE: on-ness
@ 2006-04-27 14:12 Scott E. Preece
  2006-04-27 17:01 ` Patrick Mochel
  2006-05-01 21:58 ` David Brownell
  0 siblings, 2 replies; 22+ messages in thread
From: Scott E. Preece @ 2006-04-27 14:12 UTC (permalink / raw)
  To: mochel; +Cc: david-b, linux-pm, linux

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


Let me recast the question a little.

Quite aside from the utility of having names that are meaningful to a
human reader unfamiliar with a particular device, is the problem of
supporting a system-level power policy on top of devices that have
different device-level power states.

So, is the sum of this conversation to this point that it simply isn't
possible to come up with a set of names and attributes that are
meaningful across devices? Or might it be possible to map the set of
special conditions (like the "NoSoftReset" below) to a common vocabulary
that a device could expose to power management and that a generic,
cross-platform power management facility could map to system states and
transitions?

In my domain (consumer devices) it's not such a big deal, because we
pick the devices and can write code [albeit with some effort that we
would rather not expend] to control each device appropriately in the
context of the system's projected use cases. However, even in our domain
we're beginning to need to deal with USB OTG devices being added, and it
would be useful to be able to handle them at least somewhat
intelligently based on attributes that they expose.

scott

| On Mon, Apr 24, 2006 at 04:32:54PM -0500, Woodruff, Richard wrote:
| > > Are they?  Does "off" imply the device will have been reset the next
| > > time it goes to "on"?  If not, there would seem to be two "off"
| > states.
| > > Or maybe more ... PCI_D0 is probably "on", but all of the other PCI
| > > device states seem to be variants of "off", not of "on".
| > 
| > That would seem device specific.  It would seem that applying a reset
| > when moving from "off" (especially that mapped to PCI_D3) would seem
| > reasonable.  As I was told, the rest of the PCI defined states D1-D3 are
| > non-functional.  So they are all OFF states.
| 
| Yes, they are all off in the sense that they are not operable. However, 
| there are definitely different levels of off-ness. When a device is in D3
| then it transitions to D0, it is assumed to perform an internal device
| reset.
| 
| Well, up until the PCI PM Spec 1.2, which adds a field to the PCI PM 
| config space called "NoSoftReset". If a device has that set, then it is
| an indication that the device does not perform a soft reset (and there-
| fore may not lose any state).
| 
| In D1 and D2, the devices will not lose as much state (though the amount
| is device-specific), but more importantly, the device will not perform a
| reset on the transition back to D0, meaning that we don't have to do a
| full reinitialization. 
| 
| [ The memory savings may be insignificant, but saving ourselves from the
| process of reinitialziation is a big plus. For video devices, it's even
| more compelling - the framebuffer may be large, a reinit may take a very
| long time, and we may not even know how to do a full reinit. ]
| 
| > If just happens that in D3 you can safely physically remove the device.
| 
| That's not necessarily true, but it's moot for this thread anyway. 
| 
| > The current pseudo export
| > of these non-functional states doesn't seem so useful.  Having some
| > fuzzy level of idleness seems much better.
| 
| Maybe. What's more important is getting rid of the pseudo states. The
| drivers should export exactly the states that they support, in whatever
| fashion makes the most sense to them. For PCI devices that support basic
| PM, this will be "D0" and "D3". PCI devices that support D1 and D2 will
| export "D1" and "D2" as well. Devices that support other, device-
| specific states will export meaningful names for them. 
| 
| Different concepts of on-ness should be handled in a similar fashion. It
| doesn't really matter if they are sensical strings or if they are digits,
| it's all ASCII as it goes through sysfs, and it all has to get parsed,
| mapped, and verified at some level. 
| 
| > In my current hack attempts I am trying to associate a 'device' D2 state
| > with a local device sleep with an async wake up enabled.  In this state
| > a devices accesses are locked out until the device wake up event
| > happens.  This async wake can be from a device specific wake up or from
| > an associated timer resource.  Current DPM enabled OMAP sprinkles
| > suspend lock outs inside of drivers which re-suspend queued waiters and
| > suspends new requests if the device is in a locked out state.  From many
| > devices this creates a device which just reacts with a higher latency.
| 
| That sounds promising. Got any patches that you care to post? 
| 
| Thanks,
| 
| 
| 	Patrick
| 
| --===============74204344604701977==
| ----------
| _______________________________________________
| linux-pm mailing list
| linux-pm@lists.osdl.org
| https://lists.osdl.org/mailman/listinfo/linux-pm
| 
| --===============74204344604701977==--

-- 
scott preece
motorola mobile devices, il67, 1800 s. oak st., champaign, il  61820  
e-mail:	preece@motorola.com	fax:	+1-217-384-8550
phone:	+1-217-384-8589	cell: +1-217-433-6114	pager: 2174336114@vtext.com



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



^ permalink raw reply	[flat|nested] 22+ messages in thread
* RE: RE: on-ness
@ 2006-04-24 21:32 Woodruff, Richard
  2006-04-27  1:39 ` Patrick Mochel
  2006-05-01 21:35 ` David Brownell
  0 siblings, 2 replies; 22+ messages in thread
From: Woodruff, Richard @ 2006-04-24 21:32 UTC (permalink / raw)
  To: David Brownell, linux-pm; +Cc: Dominik Brodowski

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

> Are they?  Does "off" imply the device will have been reset the next
> time it goes to "on"?  If not, there would seem to be two "off"
states.
> Or maybe more ... PCI_D0 is probably "on", but all of the other PCI
> device states seem to be variants of "off", not of "on".

That would seem device specific.  It would seem that applying a reset
when moving from "off" (especially that mapped to PCI_D3) would seem
reasonable.  As I was told, the rest of the PCI defined states D1-D3 are
non-functional.  So they are all OFF states.  If just happens that in D3
you can safely physically remove the device.  The current pseudo export
of these non-functional states doesn't seem so useful.  Having some
fuzzy level of idleness seems much better.

The point of the idle states Len was floating attempts to define a level
of on-ness/idleness.  As it turns out there was a nice correlation to
some ACPI states.  Numbering them seems reasonable, else your just
wasting effort translating 'state0, state1, state2, ...', keeping the
naming convention simple '0,1,2,..0xffff' would seem to lend itself to
code sharing of necessary class/device specific translation code.
 
> Actually the wakeup characteristics are orthogonal, there are
per-device
> bits controlling whether a device can and should do the wakeup.  We
don't
> for example treat "PCI_D3hot with wakeup" as a distinct state.

In my current hack attempts I am trying to associate a 'device' D2 state
with a local device sleep with an async wake up enabled.  In this state
a devices accesses are locked out until the device wake up event
happens.  This async wake can be from a device specific wake up or from
an associated timer resource.  Current DPM enabled OMAP sprinkles
suspend lock outs inside of drivers which re-suspend queued waiters and
suspends new requests if the device is in a locked out state.  From many
devices this creates a device which just reacts with a higher latency.


Regards,
Richard W.


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



^ permalink raw reply	[flat|nested] 22+ messages in thread
* RE: RE: on-ness
@ 2006-04-18 18:39 Brown, Len
  2006-04-20 13:25 ` Pavel Machek
  0 siblings, 1 reply; 22+ messages in thread
From: Brown, Len @ 2006-04-18 18:39 UTC (permalink / raw)
  To: David Brownell; +Cc: linux-pm

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

(restored linux-pm to cc:)

yes, the concept was to explore a language generic enough
that it could describe either CPUs or any other devices.

no, this wasn't expected to be complete, just a start.
yes, wakeup capability is one thing we we discussed.
note that we may need to differentiate between enabling
the device to wakeup the system, and waking up just
the device itself.

no, if the numbers happen to corrolate to ACPI states,
that is purely lucky for the ACPI maintainer:-)
But honestly, we should "leverage" all we can from ACPI.
My role, of course, it to make sure that the generic
description can accommodate everything ACPI can do.

yes, idle refers to either Cx or Dx states -- it depends
on the device.  0 means operating, non zero means non-operating.

Re: strings.
we breifly debated strings vs numbers.
I'm not confident that there are enough unique strings
available without falling into state0, state1, state2, state3 --
so numbers seemed simpler.
The only issue I see with numbers is that they imply order,
and it may be that some operating points might not have
such a strict order.

appology in advace for the top-post, Intel IT re-installed my
laptop and a lot of things are not "quite right"...

-Len

-----Original Message-----
From: David Brownell [mailto:david-b@pacbell.net] 
Sent: Tuesday, April 18, 2006 2:15 PM
To: Brown, Len
Cc: Richard A. Griffiths
Subject: Re: [linux-pm] RE: on-ness

On Monday 17 April 2006 2:43 pm, Brown, Len wrote:
> > Thinking about the discussion of the ON field. How about Limiter?
Then
> > maps to no limit (max power, max freq, whatever) and any
> > other number is
> > some limit of performance/power, similar to what was decided for
Idle.
> 
> my scribbles on generic sysfs device directory file names say:

That is, you're talking about parameters related to individual devices?
Or CPUs?

Let's surface more parameters first, before talking about managers!

One more is the wakeup capability; devices may easily have two parameter
sets, one spending a bit of power to deliver wakeup capability.

Another is which <linux/clk.h> clocks are associated with the device.


> state:
> on	- running and available
> off	- requires a full device initialization to be usable

Also e.g. "bus suspend" causing maybe 2 mA current draw vs normal
usb root port power budgets of 100+ mA ... two modes like that, one
supporting remote wakeup and one not.


> idle: # = "how idle"
> 0 - active, not idle at all eg C0, D0
> 1 - idle. eg C1, D1
> ...
> n - most power saving, highest latency idle state, eg. Cn, Dn

These are ACPI CPU states Cx?  Or device states Dx?  Such values
should be a string, which need not match acpi conventions...

- Dave


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



^ permalink raw reply	[flat|nested] 22+ messages in thread

end of thread, other threads:[~2006-05-01 21:58 UTC | newest]

Thread overview: 22+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-04-21 17:58 RE: on-ness Preece Scott-PREECE
2006-04-21 18:15 ` David Brownell
  -- strict thread matches above, loose matches on Subject: below --
2006-04-27 14:12 Scott E. Preece
2006-04-27 17:01 ` Patrick Mochel
2006-05-01 21:58 ` David Brownell
2006-04-24 21:32 Woodruff, Richard
2006-04-27  1:39 ` Patrick Mochel
2006-05-01 21:35 ` David Brownell
2006-04-18 18:39 Brown, Len
2006-04-20 13:25 ` Pavel Machek
2006-04-21 15:27   ` David Brownell
2006-04-21 15:40     ` Dominik Brodowski
2006-04-21 17:03       ` David Brownell
2006-04-21 17:12         ` Dominik Brodowski
2006-04-21 18:30           ` David Brownell
2006-04-21 18:33             ` Dominik Brodowski
2006-04-21 19:00               ` David Brownell
2006-04-21 19:01               ` Pavel Machek
2006-04-24 21:04                 ` David Brownell
2006-04-24 21:32                   ` Pavel Machek
2006-04-24 23:21                     ` David Brownell
2006-04-21 17:15     ` David Brownell

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox