From: ambx1-IBH0VoN/3vPQT0dZR+AlfA@public.gmane.org (Adam Belay)
To: Pavel Machek <pavel-+ZI9xUNit7I@public.gmane.org>
Cc: Matthew Garrett <mjg59-1xO5oi07KQx4cg9Nei1l7Q@public.gmane.org>,
acpi-devel-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org
Subject: Re: Shutting down PCI devices on suspend
Date: Sun, 12 Dec 2004 19:11:25 -0500 [thread overview]
Message-ID: <20041213001125.GD2661@neo.rr.com> (raw)
In-Reply-To: <20041212230157.GH6272-I/5MKhXcvmPrBKCeMvbIDA@public.gmane.org>
Hi,
On Mon, Dec 13, 2004 at 12:01:57AM +0100, Pavel Machek wrote:
> Hi!
>
> > Because the power management design should be layered:
> >
> > device power off request -->
> >
> > (start)
> > |
> > | class - disable user space interfaces, stop timers etc
> > |
> > | driver - save hardware state, prepare hardware for poweroff
> > |
> > | bus - power off physical device
> > |
> > | firmware (ex ACPI) - additional power logic (ex external device components
> > | may need to be powered off.
> > | This will typically involve Dx
> > | states)
> > /
> > (finish)
>
> Driver needs to be in control. For every rule, there's exception
> (buggy hw?). It is fine if classes or buses provide helpers, but
> ultimately it needs to be driver's suspend using those helpers.
>
> > | driver (*suspend) - tell class to stop logical device (often large amounts
> > | of duplicate code between drivers)
>
> Well, then feel free to move that duplicate code into helper
> functions. I do think that I'd notice that large amounts of duplicate
> code, but feel free to prove me wrong.
>
> > | - totally ignore ACPI firmware Dx states (how could we
> > | handle them, we don't know enough about the layers below
> > | us. ACPI may not be compiled into the kernel, the device
> > | may not have ACPI extensions etc.)
>
> Helpers can do that, right?
Maybe, something really needs to be done about it in the short run.
Why must the driver be in complete control? We can't ensure every driver will
behave consistently. Why have a driver model at all if we can't break tasks
into layers of responsibility?
Yes, layering has small losses in flexability, but the advantage of ensuring
uniform behavior and capabilities is very important. With layering, code
repitition is minimal and everything in the kernel is all around more
simplistic and easy to maintain. I think we can have a higher average quality
of functionality and stability with this approach. Also less work will be
required when developing new drivers or adding new functionality. For
example, a developer could update class level code without breaking or needing
to change driver and bus level code.
Basically each component in the stack should not know or care about what the
components above or below it are going to do. Each should be autonomous and
only concerned with completing its own well defined goal along the chain of
the process. This can apply to most problems, including power management.
>
> > > Saving/restoring state is way more work than actual power state
> > > transitions. Provide nice helpers so that power state transitions are
> > > easy, but leave the work on the drivers, so that drivers may do
> > > something special if required.
> >
> > Could you provide an example of a special case? I'm not sure if we should
> > design our model around the least common denominator of standard
> > compliance.
>
> Well, if you want your network card to do wake-on-lan, you need to
> keep it powered on... And the driver is the piece of code that knows
> if you want to do wake-on-lan, right?
Firmware like ACPI will tell us what wake-on-lan capabilities we have. The
bus layer also handles much of the physical aspects. The user will say that
he or she wants the logical device "eth1", as an example, to wake up the
computer if any traffic is incoming. So really all of the layers play some
role in wake-on-lan, right? Is a device useful for wake-on-lan without a
corresponding logical ethernet device?
Furthermore, it can be more complicated than just keeping it powered on. A
device might need a seperate power domain to be used for wake-on-lan than
normal operation. ACPI could help with this.
Thanks,
Adam
-------------------------------------------------------
SF email is sponsored by - The IT Product Guide
Read honest & candid reviews on hundreds of IT Products from real users.
Discover which products truly live up to the hype. Start reading now.
http://productguide.itmanagersjournal.com/
next prev parent reply other threads:[~2004-12-13 0:11 UTC|newest]
Thread overview: 19+ messages / expand[flat|nested] mbox.gz Atom feed top
2004-12-11 15:37 Shutting down PCI devices on suspend Matthew Garrett
2004-12-11 19:50 ` Nate Lawson
[not found] ` <41BB4F70.9060606-Y6VGUYTwhu0@public.gmane.org>
2004-12-11 22:41 ` Matthew Garrett
2004-12-11 23:20 ` Nate Lawson
[not found] ` <41BB80C6.1020404-Y6VGUYTwhu0@public.gmane.org>
2004-12-12 1:44 ` Arjen Verweij
2004-12-11 21:31 ` Arjen Verweij
2004-12-12 16:44 ` Pavel Machek
[not found] ` <20041212164422.GD6286-I/5MKhXcvmPrBKCeMvbIDA@public.gmane.org>
2004-12-12 17:01 ` Matthew Garrett
2004-12-12 17:15 ` Pavel Machek
[not found] ` <20041212171521.GC6272-I/5MKhXcvmPrBKCeMvbIDA@public.gmane.org>
2004-12-12 19:29 ` Adam Belay
[not found] ` <20041212192913.GB2661-IBH0VoN/3vPQT0dZR+AlfA@public.gmane.org>
2004-12-12 20:18 ` Pavel Machek
[not found] ` <20041212201810.GE6272-I/5MKhXcvmPrBKCeMvbIDA@public.gmane.org>
2004-12-12 22:36 ` Adam Belay
[not found] ` <20041212223655.GC2661-IBH0VoN/3vPQT0dZR+AlfA@public.gmane.org>
2004-12-12 23:01 ` Pavel Machek
[not found] ` <20041212230157.GH6272-I/5MKhXcvmPrBKCeMvbIDA@public.gmane.org>
2004-12-13 0:11 ` Adam Belay [this message]
[not found] ` <20041213001125.GD2661-IBH0VoN/3vPQT0dZR+AlfA@public.gmane.org>
2004-12-13 11:09 ` Pavel Machek
2004-12-12 23:23 ` Matthew Garrett
2004-12-13 10:52 ` Pavel Machek
-- strict thread matches above, loose matches on Subject: below --
2004-12-13 1:59 Li, Shaohua
[not found] ` <16A54BF5D6E14E4D916CE26C9AD30575C12271-4yWAQGcml66iAffOGbnezLfspsVTdybXVpNB7YpNyf8@public.gmane.org>
2004-12-13 11:11 ` 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=20041213001125.GD2661@neo.rr.com \
--to=ambx1-ibh0von/3vpqt0dzr+alfa@public.gmane.org \
--cc=acpi-devel-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org \
--cc=mjg59-1xO5oi07KQx4cg9Nei1l7Q@public.gmane.org \
--cc=pavel-+ZI9xUNit7I@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