From: Igor Stoppa <igor.stoppa@nokia.com>
To: ext Matthew Locke <matt@nomadgs.com>
Cc: alexey.y.starikovskiy@intel.com, ben@simtec.co.uk,
dirk.behme@de.bosch.com, pavel@ucw.cz, johannes@sipsolutions.net,
nico@cam.org, linux-pm@lists.linux-foundation.org,
g.liakhovetski@gmx.de
Subject: Re: [PATCH] implement pm_ops.valid for everybody
Date: Fri, 23 Mar 2007 21:19:30 +0200 [thread overview]
Message-ID: <1174677570.20521.283.camel@Dogbert.NOE.nokia.com> (raw)
In-Reply-To: <D72CCDBA-7D0E-41FA-9ABD-761D5B8409BC@nomadgs.com>
On Fri, 2007-03-23 at 11:51 -0700, ext Matthew Locke wrote:
> On Mar 23, 2007, at 8:17 AM, Igor Stoppa wrote:
>
> > On Fri, 2007-03-23 at 10:52 -0400, ext tony@atomide.com wrote:
> >> * Igor Stoppa <igor.stoppa@nokia.com> [070323 09:37]:
> >>> On Fri, 2007-03-23 at 09:17 -0400, ext
> >>> linux-pm-bounces@lists.linux-foundation.org wrote:
> >>>> * Matthew Locke <matt@nomadgs.com> [070322 21:15]:
> >>>>>
> >>>>> On Mar 22, 2007, at 4:55 PM, David Brownell wrote:
> >>>>>
> >>>>>> On Thursday 22 March 2007 4:21 pm, Rafael J. Wysocki wrote:
> >>>>>>
> >>>>>>>> My answer: there is NO value to such an arbitrary restriction.
> >>>>>>>
> >>>>>>> I'm not talking on restrictions.
> >>>>>>
> >>>>>> You most certainly did talk about them. You said that if the
> >>>>>> hardware doesn't support a "turn CPU off" mode, then you'd
> >>>>>> define that as being incapable of implementing suspend-to-RAM.
> >>>>>> That's a restriction ... a very arbitrary one.
> >>>>>>
> >>>>>>
> >>>>>>> I'm talking on being able to define
> >>>>>>> _anything_ more precisely then just a low-power system-wide
> >>>>>>> state.
> >>>>>>
> >>>>>> Me too. And I'm trying to convey to you the results of the
> >>>>>> investigations I did on that topic. You don't seem to like
> >>>>>> those results though ...
> >>>>>>
> >>>>>>
> >>>>>>> And let's start from just something, please. Like STR and
> >>>>>>> "standby" to begin
> >>>>>>> with? At least on ACPI systems we can distinguish one from the
> >>>>>>> other quite
> >>>>>>> clearly, so why can't we start from that and _then_ generalize?
> >>>>>>
> >>>>>> That's exactly what I did. Looked also at APM, and several
> >>>>>> different SOC designs (AT91, OMAP1, PXA25x, SA1100, more).
> >>>>>>
> >>>>>> The generalization I came up with is what I've described.
> >>>>>> Namely, that coming up with one definition of those states
> >>>>>> that can usefully be mapped all platforms is impractical.
> >>>>>> They're just labels. The platform implementor can choose
> >>>>>> two states to implement, but non-x86 hardware states rarely
> >>>>>> match the expectations of ACPI.
> >>>>>>
> >>>>>> So the fundamental definition needs to be in relative terms,
> >>>>>> because platform-specific differences otherwise make trouble.
> >>>>>
> >>>>> The problem is that a 1:1 mapping between system low power
> >>>>> state and
> >>>>> a processor low power state is trying to be forced on every
> >>>>> platform. As Dave pointed out, embedded SoC's provide multiple
> >>>>> low
> >>>>> power states that qualify for the suspend-to-ram definition. The
> >>>>> only reasonable platform independent definition is that in STR
> >>>>> memory
> >>>>> is powered and contents preserved. The rest is platform specific.
> >>>>>
> >>>>> I think the right answer is that a mechanism for mapping platform
> >>>>> specific states to the system states is needed. Platforms define
> >>>>> their low power states and define the default for each system
> >>>>> state . On x86 platforms, the default just works and is probably
> >>>>> never changed. On embedded platforms, a policy manager can change
> >>>>> the other low power states according to its latency and
> >>>>> operational
> >>>>> requirements.
> >>>>
> >>>> Plus the states should be distributed. Trying to force the whole
> >>>> system into certain state turns things messy.
> >>>>
> >>>> Some devices may be active while some are in retention or suspend.
> >>>>
> >>>> Basically everything should idle itself automatically whenever
> >>>> possible based on a idle timer or some other policy, such as
> >>>> suspending a device from user space via sysfs.
> >>>
> >>> The timer sound like a reasonable idea, as long as there is one
> >>> timer
> >>> for each shared resource, not user.
> >>>
> >>> Example:
> >>>
> >>> Devices A & B share the same voltage domain.
> >>>
> >>> Device A has timeout period Timeout(A)
> >>> Device B has timeout period Timeout(B)
> >>>
> >>> One timer is associated to the voltage regulator/switch and will
> >>> expire
> >>> at t=TIM
> >>>
> >>> Every time the device d (either A or B) performs some activity, then
> >>>
> >>> TIM = max(TIM, now + Timeout(d))
> >>>
> >>> When t=TIM (timer expired), then the suspend() function for each
> >>> device
> >>> is called.
> >>
> >> What problem do you see with with device specific idle timers?
> >
> > That the number of idle timers grows linearly with the number of
> > resources consumers rather than _providers_
> >
> > See also my comment below.
> >
> >> For example, what's wrong with the following:
> >>
> >> When the device specific idle timer expires, the driver's suspend
> >> function would get called, and the device would release it's clock
> >> and voltage.
> >
> > We might end up doing extra useless activity by saving the state of a
> > device that is re-enabled without even going off.
> >
> > Of course the restoring can be optimised so that it doesn't happen
> > unless the voltage has actually been removed (this implies that the
> > state saving happens in such a way that doesn't compromise the current
> > settings of the device).
> >
> >> Then when a shared voltage domain has 0 users, that voltage domain
> >> can be shut off.
> >
> > Both your and my approaches have drawbacks: in your case the system
> > will
> > probably end up doing extra state saving, but will be ready to perform
> > immediately the transition to off; in my case there will be the
> > overhead
> > of saving the state of the peripherals.
>
> I think we again have the problem that the behavior is very device
> specific.
It's not really a problem.
> Some i/o devices have internal low power states that may
> or may not require saving state. Others have no notion of low power
> states. And on some platforms register contents are preserved even
> when a device is "off".
So???? Each ofthem will take care of itself, that's expected.
> How about something like:
>
> - When idle timer pops, driver releases pm resources (clock,
> voltage, whatever).
No: it's still using one timer for each driver.
> - Then driver does device specific stuff which may or may not
> include going into a low power state and saving state.
Sure, that's the device-specific part.
> - If a pm resource (clock, voltage, whatever) reference count goes
> to zero, something will decide to turn it off.
Something? I see a manager lurking here.
Why can't the corresponding framework (clock or voltage, let's drop the
whatever_framework till it gets integrated) switch off the resource when
the usecount drops to zero?
> - Users of the pm resource are told they are going to lose power.
ok
> - Then driver does device specific stuff. If the device driver
> already saved state, then ignore. Otherwise do what the device needs
> done.
I'd rather do everything here, but this is probably a decision that
depends on the specific device. So maybe a device-based behavior is the
best option: sort of PRE and POST.
> >
> > However saving state in a preemptive way is decoupled by having idle
> > timers associated to resources providers rather than consumers.
> >
> >> Same thing with clock domains.
> >
> > Clocks is fine, since no saving/restoring is needed, albeit we might
> > consider PLL relock time to fall in this "costy" class of activities.
--
Cheers, Igor
Igor Stoppa <igor.stoppa@nokia.com>
(Nokia Multimedia - CP - OSSO / Helsinki, Finland)
next prev parent reply other threads:[~2007-03-23 19:19 UTC|newest]
Thread overview: 68+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-03-22 13:44 [PATCH] implement pm_ops.valid for everybody Scott E. Preece
2007-03-22 18:29 ` David Brownell
2007-03-22 19:26 ` Tony Lindgren
2007-03-22 21:16 ` David Brownell
2007-03-23 13:15 ` tony
2007-03-23 18:25 ` David Brownell
2007-03-22 21:37 ` Rafael J. Wysocki
2007-03-22 21:27 ` Rafael J. Wysocki
2007-03-22 21:43 ` David Brownell
2007-03-22 21:56 ` Guennadi Liakhovetski
2007-03-22 22:42 ` David Brownell
2007-03-22 22:10 ` Rafael J. Wysocki
2007-03-22 22:56 ` David Brownell
2007-03-22 23:21 ` Rafael J. Wysocki
2007-03-22 23:55 ` David Brownell
2007-03-23 1:14 ` Matthew Locke
2007-03-23 13:17 ` tony
2007-03-23 13:35 ` Igor Stoppa
2007-03-23 14:52 ` tony
2007-03-23 15:17 ` Igor Stoppa
2007-03-23 18:51 ` Matthew Locke
2007-03-23 19:19 ` Igor Stoppa [this message]
2007-03-23 18:29 ` David Brownell
2007-03-23 19:21 ` Matthew Locke
2007-03-23 20:11 ` David Brownell
2007-03-23 6:46 ` Guennadi Liakhovetski
2007-03-23 16:15 ` David Brownell
2007-03-23 21:08 ` Guennadi Liakhovetski
2007-03-24 0:52 ` David Brownell
2007-03-23 13:43 ` Rafael J. Wysocki
2007-03-23 17:57 ` David Brownell
2007-03-23 20:39 ` Rafael J. Wysocki
2007-03-24 0:01 ` Pavel Machek
2007-03-24 0:54 ` David Brownell
2007-03-24 20:01 ` Rafael J. Wysocki
2007-03-24 0:41 ` Dmitry Krivoschekov
2007-03-24 20:49 ` David Brownell
2007-03-24 21:01 ` Johannes Berg
2007-03-25 1:02 ` David Brownell
2007-03-24 21:36 ` Rafael J. Wysocki
2007-03-24 22:19 ` David Brownell
2007-03-25 10:26 ` Dmitry Krivoschekov
2007-03-25 15:20 ` David Brownell
2007-03-25 16:23 ` Jim Gettys
2007-03-25 16:55 ` David Brownell
2007-03-23 18:18 ` Matthew Locke
2007-03-24 3:08 ` Paul Mackerras
2007-03-24 20:04 ` Rafael J. Wysocki
2007-03-22 23:29 ` Guennadi Liakhovetski
2007-03-22 23:44 ` David Brownell
2007-03-22 23:45 ` Guennadi Liakhovetski
2007-03-22 21:33 ` Rafael J. Wysocki
-- strict thread matches above, loose matches on Subject: below --
2007-03-20 1:58 [PATCH] rework pm_ops pm_disk_modes foo Johannes Berg
2007-03-20 8:46 ` [PATCH v2] " Johannes Berg
2007-03-20 9:31 ` Pavel Machek
2007-03-20 9:36 ` Johannes Berg
2007-03-20 9:43 ` Pavel Machek
2007-03-20 10:17 ` [PATCH] add firmware disk state and clean up Johannes Berg
2007-03-20 10:25 ` Pavel Machek
2007-03-20 11:06 ` [PATCH] implement pm_ops.valid for everybody Johannes Berg
2007-03-20 13:16 ` Pavel Machek
2007-03-20 23:44 ` David Brownell
2007-03-20 22:49 ` Pavel Machek
2007-03-21 21:01 ` Guennadi Liakhovetski
2007-03-21 22:07 ` David Brownell
2007-03-21 22:36 ` Guennadi Liakhovetski
2007-03-21 22:57 ` Pavel Machek
2007-03-21 23:25 ` David Brownell
2007-03-21 23:31 ` Pavel Machek
2007-03-22 10:03 ` Johannes Berg
2007-03-22 17:10 ` David Brownell
2007-03-22 17:18 ` Johannes Berg
2007-03-22 18:13 ` David Brownell
2007-03-22 18:18 ` Johannes Berg
2007-03-21 23:32 ` 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=1174677570.20521.283.camel@Dogbert.NOE.nokia.com \
--to=igor.stoppa@nokia.com \
--cc=alexey.y.starikovskiy@intel.com \
--cc=ben@simtec.co.uk \
--cc=dirk.behme@de.bosch.com \
--cc=g.liakhovetski@gmx.de \
--cc=johannes@sipsolutions.net \
--cc=linux-pm@lists.linux-foundation.org \
--cc=matt@nomadgs.com \
--cc=nico@cam.org \
--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