[linux-pm] Runtime device power management in userspace

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Sat, 24 Dec 2005, Pavel Machek wrote:

> On Pá 23-12-05 07:12:35, Patrick Mochel wrote:

> > Please note that D3 is only relevant for PCI devices and for ACPI devices.
> > The fact that it's the same value for every device in the system is a
> > design flaw. Please be aware that the value to write to the device file
> > could change, and will be dependent on the type (bus) of device, and quite
> > possibly on the device itself. It may not even be '3' for all PCI devices
> > in the future, or may be a string rather than 1 character, or simply a '1'
> > into a different file.
>
> Is there enough locking in driver core to make this safe?

The issue I stated is actually orthogonal to locking the device; but the
answer to your question is: probably not. We should probably be taking the
per-device semaphore to prevent against competing events that are trying
to add/remove a device or driver.

> Ouch and BTW *right* value is _2_, today... because state_store() uses
> value from user as a pm_message_t.event. We should at least supply
> some hint that it is runtime suspend in pm_message_t.flags --
> unfortunately we do not have pm_message_t.flags yet.

And I don't think that we want it. I think that we want a completely
different API for doing runtime PM. Using the same API will make the
drivers more complicated by having to have a repeated control sequence for
determing what state (and under what conditions) the device is entering.

Also, recall that the actual states the device and driver support could be
different than any other device or driver (even when the device or driver
are the same). What we need is a way for a driver to easily export the
states that it supports and a way to enter those exported states (e.g. an
array or linked list of state names and callbacks, like has been mentioned
a few times before).

To that effect, the per-device power file and its semantics should go away
completely and replaced with something that supports this new API.

> > Also, is there source available?
>
> Should be, we are trying to do *Open*SUSE these days ;-))).

Heh, but where? (And, actually nevermind, Holger pointed them out..  :-)

Thanks,


	Patrick



[Index of Archives]     [Linux ACPI]     [Netdev]     [Ethernet Bridging]     [Linux Wireless]     [CPU Freq]     [Kernel Newbies]     [Fedora Kernel]     [Security]     [Linux for Hams]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux Admin]     [Samba]

  Powered by Linux