From: David Brownell <david-b-yBeKhBN/0LDR7s880joybQ@public.gmane.org>
To: linux-pm-qjLDD68F18O7TbgM5vRIOg@public.gmane.org
Subject: Re: [RFC] Driver States
Date: Thu, 31 Mar 2005 20:01:15 -0800 [thread overview]
Message-ID: <200503312001.15646.david-b@pacbell.net> (raw)
In-Reply-To: <20050328092925.2c2736de-aftB2sG12IhaqnLngUycEA@public.gmane.org>
[-- Attachment #1: Type: text/plain, Size: 2935 bytes --]
On Monday 28 March 2005 8:29 am, Jordan Crouse wrote:
> > struct device_driver {
>
> Its still in debate, but if we decide to do centralized policy
> management (like DPM), then we will need some way to pass in attributes
> such as device inactivity timeout to the device.
Device inactivity is a good example of something that's _already_ done
in a well-decentralized manner. E.g. X11/DPMS, and hdparm. If you're
after a motivation to adopt the MontaVista DPM model, that undermines
your argument ...
> Personally, I would be
> happy with a call that passed a pointer for flexibility, but it seems
> that recently, people are heavily favoring arguments that can be
> typchecked.
Pointers can easily be type-checked. :)
> [ As an aside, I think that deciding where policy management will live
> will help clear up some of the nagging issues we've been having about
> the role of the drivers vs. the role of the system, etc, etc. ]
I think system policy should live at the system level, and driver policy
should live at the driver level. Simple. ;)
> > A table could be defined that indicates what should be called for each
> > power level transition. *suspend and *resume could handle any extra
> > steps (ex. saving state). As an example, *start and *stop may only be
> > called when power is going to be lost entirely.
>
> I think we discussed this during the IRC meeting. I certainly don't
> favor multiple calls which increase the level of complexity of the
> calling entity.
It's a tradeoff. Needless complexity should be avoided, of course.
Device driver authors should have only a limited slate of system-wide
issues to cope with ... which argues more for keeping complexity in
the core. On the other hand, complex core logic can be hard to maintain
and error prone too.
> I would need one table to tell me what power level the
> device should be at, and a second table to tell me if I need to call
> stop() or start(). Furthermore some devices may go clocks off during
> one S-T-R transition, and then keep clocks on for wake another time.
Same is true for power, not just for clocks: both get switched on/off.
> Our current thinking is to assume that the driver is intelligent enough
> to know what to do for any given power level, and I think a single call
> would suffice for that.
There's also system configuration to think of. A recent example: a
device should turn off several controllers whenever it's not hooked
up to its docking station (with power supply). Regardless of whatever
else the other system power state(s) may be.
Some of these issues are completely orthogonal to other issues about
system state. You're right that these are examples of places where
the intelligence is best kept at the _driver_ level ... in this case,
the driver that handles the "I'm docked!" IRQ is the natural place to
know what devices a given docking configuration should activate.
- Dave
[-- Attachment #2: Type: text/plain, Size: 0 bytes --]
next prev parent reply other threads:[~2005-04-01 4:01 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2005-03-27 22:42 [RFC] Driver States Adam Belay
[not found] ` <1111963367.3503.152.camel-bi+AKbBUZKY6gyzm1THtWbp2dZbC/Bob@public.gmane.org>
2005-03-28 16:29 ` Jordan Crouse
[not found] ` <20050328092925.2c2736de-aftB2sG12IhaqnLngUycEA@public.gmane.org>
2005-04-01 4:01 ` David Brownell [this message]
2005-03-28 17:20 ` apm_console_blank() Jordan Crouse
[not found] ` <20050328102035.5fcd9a61-aftB2sG12IhaqnLngUycEA@public.gmane.org>
2005-03-29 18:51 ` apm_console_blank() Pavel Machek
2005-03-30 5:57 ` [RFC] Driver States Patrick Mochel
[not found] ` <Pine.LNX.4.50.0503292155120.26543-100000-x8k/2hhmB0w5etPau2IXcQ@public.gmane.org>
2005-03-30 22:45 ` Adam Belay
2005-04-05 9:24 ` Pavel Machek
2005-04-06 19:51 ` Adam Belay
2005-04-08 10:31 ` Pavel Machek
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=200503312001.15646.david-b@pacbell.net \
--to=david-b-ybekhbn/0ldr7s880joybq@public.gmane.org \
--cc=linux-pm-qjLDD68F18O7TbgM5vRIOg@public.gmane.org \
/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