All of lore.kernel.org
 help / color / mirror / Atom feed
From: Pavel Machek <pavel@ucw.cz>
To: Len Brown <lenb@kernel.org>
Cc: linux-pm@lists.linux-foundation.org, linux-pm <linux-pm@lists.osdl.org>
Subject: Re: [RFC] dynamic device power management proposal
Date: Thu, 22 Mar 2007 14:20:52 +0100	[thread overview]
Message-ID: <20070322132052.GA7221@elf.ucw.cz> (raw)
In-Reply-To: <200703220042.20471.lenb@kernel.org>

Hi!

> > > Runtime device power management or dynamic device power management
> > > (dpm).
> > > 
> > > Why dpm: 
> > >      1. put an idle device into low power state to save power 
> > >      2. speed up S3/S4. In resume time, we could resume devices only as
> > >         the devices are used. In suspend time, we could skip suspended
> > >         devices. (suspend/resume a device equals to change device state)
> 
> Today on system suspend we suspend all devices.
> Today on system resume, we resume all devices.

That's not how it works.

On system suspend, we _tell_ all devices to suspend

If device driver auto-suspended, it will of course not do anything. I
believe we want to keep it designed like that.

> Instead I think we should focus on exporting the appropriate APIs
> so that a management application with platform specific knowledge can
> efficiently get the kernel/drivers to implement its policies.

Please... pick one driver for whatever hardware you like... MMC card
reader in x60? And add runtime suspend/resume to that.

You'll probably find out that no new APIs are needed.

> > > My proposal: 
> > >      1. device’s power parameters. If a device’s power state depends on
> > >         several parameters, we can map different parameters combining
> > >          to a single index, which looks like ACPI Dx state. In this way,
> > >         dpm framework and policy have a generic interface to get/set
> > >         device’s state. Each state exports some info, including this
> > >         state’s power consumption/latency. Device driver can export
> > >         extra info to policy, dpm framework doesn’t handle the extra
> > >         info, but policy can. 
> 
> I don't think it is realistic for devices to export power numbers to user-space.
> Sure, it would be great, I just don't think it is realistic.
> 
> Latencies?  maybe.

Not sure about latencies. So open() on soundcard takes few miliseconds
more... userspace will not even notice.

> In general, no API has a chance until somebody actually tries it out
> and programs to it.

Yes... please.

> > >      3. detect if a device is idle. The idea is each device has a busy
> > >         timestamp. Every time the driver wants to handle the device,
> > >         driver will update the timestamp. Policy can poll the timestamp
> > >         to determine if the device is idle. 
> > 
> > That's not how the USB implementation works.  Although a timestamp like 
> > the one you describe is going to be added.
> 
> I sort of like this idea -- it seems that it is low overhead.
> Of course it requires every device driver to be changed.
> Instead we could maybe hook the generic driver entry points
> and do this in the framework -- dunno if that is viable.

No, you can't get around changing all the drivers.

Generic entry points are for _system_ suspend, and if you try to abuse
them for runtime PM, you'll have to audit/change all the drivers.

> > (This is cutting-edge stuff, not all present even in the development
> > trees.  But we're getting there.)
> > 
> > The API design is documented, so far as it exists, by the kerneldoc in 
> > drivers/usb/core/driver.c.
> 
> This is the "intelligent device driver" model -- the driver actually has a clue
> and can do the work internally.  Probably we need some combination of this
> plus the simple timeout/user-policy-manager for dumber drivers if we are to
> cover the whole system.

You simply turn dumber drivers to more inteligent ones for devices you
care about. As I explained above, you have to touch the drivers
anyway.

Maybe some helpers to make that job easier are possible...
									Pavel
-- 
(english) http://www.livejournal.com/~pavelmachek
(cesky, pictures) http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blog.html

  parent reply	other threads:[~2007-03-22 13:20 UTC|newest]

Thread overview: 42+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-03-19  9:08 [RFC] dynamic device power management proposal Shaohua Li
2007-03-19 15:44 ` Alan Stern
2007-03-20  1:06   ` Shaohua Li
2007-03-20 14:58     ` Alan Stern
2007-03-21  1:43       ` Shaohua Li
2007-03-21 14:44         ` Alan Stern
2007-03-22  4:42   ` Len Brown
2007-03-22 11:56     ` Jim Gettys
2007-03-22 19:28       ` David Brownell
2007-03-22 13:20     ` Pavel Machek [this message]
2007-03-22 13:44       ` Oliver Neukum
2007-03-22 13:56         ` Pavel Machek
2007-03-22 14:18           ` Oliver Neukum
2007-03-22 14:22             ` Pavel Machek
2007-03-22 14:26               ` Oliver Neukum
2007-03-22 14:35                 ` Pavel Machek
2007-03-22 19:41     ` David Brownell
2007-03-22 19:58   ` David Brownell
2007-03-20 18:30 ` Pavel Machek
2007-03-21  1:34   ` Shaohua Li
2007-03-21 15:21     ` Amit Kucheria
2007-03-21 21:49       ` Dmitry Krivoschekov
2007-03-21 22:54         ` Pavel Machek
2007-03-21 21:39     ` Pavel Machek
2007-03-22  3:09       ` Shaohua Li
2007-03-22 13:13         ` Pavel Machek
2007-03-22 19:20       ` David Brownell
2007-03-22 20:32         ` Alan Stern
2007-03-22 20:02 ` David Brownell
2007-03-22 22:10   ` Greg KH
  -- strict thread matches above, loose matches on Subject: below --
2007-03-21 20:19 Scott E. Preece
2007-03-21 21:45 ` Pavel Machek
2007-03-26 13:53 ` Amit Kucheria
2007-03-22 13:39 Scott E. Preece
2007-03-22 13:48 ` Oliver Neukum
2007-03-22 14:01 ` Pavel Machek
2007-03-22 14:45 ` Alan Stern
2007-03-22 18:53   ` David Brownell
2007-03-22 19:05 Scott E. Preece
2007-03-27 12:05 ` Pavel Machek
2007-03-27 12:19   ` Oliver Neukum
2007-03-22 19:18 Scott E. Preece

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=20070322132052.GA7221@elf.ucw.cz \
    --to=pavel@ucw.cz \
    --cc=lenb@kernel.org \
    --cc=linux-pm@lists.linux-foundation.org \
    --cc=linux-pm@lists.osdl.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.