linux-hotplug.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Todd Poynor <tpoynor@mvista.com>
To: Patrick Mochel <mochel@digitalimplant.org>
Cc: linux-hotplug-devel@lists.sourceforge.net, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] Hotplug for device power state changes
Date: Tue, 04 May 2004 20:36:40 +0000	[thread overview]
Message-ID: <4097FED8.3020003@mvista.com> (raw)
In-Reply-To: <Pine.LNX.4.50.0405040819490.3562-100000@monsoon.he.net>

Patrick Mochel wrote:
>>A patch to call a hotplug device-power agent when the power state of a
>>device is modified at runtime (that is, individually via sysfs or by a
>>driver call, not as part of a system suspend/resume).  Allows a power
>>management application to be informed of changes in device power needs.
>>This can be useful on platforms with dependencies between system
>>clock/voltage settings and operation of certain devices (such as
>>PXA27x), or, for example, on a cell phone where voiceband or network
>>devices going inactive signals an opportunity to lower platform power
>>levels to conserve battery life.
> 
> 
> Why? If the device is powered down at runtime via sysfs, then the app that
> did that already exists in userspace, like the ones you're trying to
> notify via /sbin/hotplug. It would be much simpler for the first app to
> generate e.g. a d-bus message to notify other apps, rather than creating
> this conduit through the kernel.

The ability to do this was originally requested in the context of a 
driver managing the power state of its devices (according to some 
unspecified logic); agreed that state changes requested via sysfs are a 
less compelling usage scenario.  Small battery-powered gadgets often 
implement drivers that are more actively involved in managing power 
state than the desktop/notebook/server norm, invoking LDM suspend 
routines when an opportunity to power down arises.  But it is also 
common in wall-plug-wired systems to have a few power state transitions 
that result from things under kernel control, such as blanking a display 
device after a timer expires.

In many cases, the opportunity to move to a lower-power state may be 
triggered by userspace activity and would make a good candidate for a 
purely userspace notification method.  However, a kernel-to-userspace 
notification method is suggested for this to cover potential cases where 
a device power state change might not be directly caused by, or may be a 
non-obvious side effect of, an application action.  Display blanking is 
an example; other devices that can enter a low-power state due to 
inactivity or due to changes in power state of other upstream or 
downstream devices could also use this.  If anyone reading this has 
concrete examples that they would like to have considered then please do 
speak up.

It may be the case that most useful scenarios for userspace actions in 
response to device power state changes could be handled through a 
suitable implementation of D-BUS messages between applications, and I'd 
certainly support use of that model wherever possible.  Returning errors 
through the system call interface for an operation on a device file 
descriptor, as I believe you've suggested, may also help cover most 
useful cases.  I will continue to encourage the developers who have 
asked me for driver power state notifiers to chime in here with more 
details on their needs.

> Besides, if one process has a device open, then the driver should refuse
> any requests to power it down.

I'd suggest some latitude in driver handling of low-power device states 
wrt open file descriptors, such as for display blanking.  But yes, this 
is usually true (at least in the non-system-suspend case).


-- 
Todd Poynor
MontaVista Software



-------------------------------------------------------
This SF.Net email is sponsored by: Oracle 10g
Get certified on the hottest thing ever to hit the market... Oracle 10g. 
Take an Oracle 10g class now, and we'll give you the exam FREE. 
http://ads.osdn.com/?ad_id149&alloc_idÅ66&op=click
_______________________________________________
Linux-hotplug-devel mailing list  http://linux-hotplug.sourceforge.net
Linux-hotplug-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linux-hotplug-devel

  parent reply	other threads:[~2004-05-04 20:36 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <20040429202654.GA9971@dhcp193.mvista.com>
2004-04-29 21:42 ` [PATCH] Hotplug for device power state changes Russell King
2004-04-29 22:36   ` Todd Poynor
2004-04-30  0:50     ` Benjamin Herrenschmidt
2004-04-30  8:30       ` Russell King
2004-04-30 19:59         ` Todd Poynor
2004-04-30 21:56           ` Greg KH
2004-05-01  1:16             ` Todd Poynor
2004-05-01  1:48               ` Greg KH
2004-05-03 21:33                 ` Todd Poynor
2004-05-01  0:03           ` Nigel Cunningham
2004-05-03 22:04             ` Todd Poynor
2004-04-30 19:07       ` Todd Poynor
2004-05-15  1:40   ` Nicolas Pitre
2004-05-15 23:34     ` Pavel Machek
     [not found] ` <Pine.LNX.4.50.0405040819490.3562-100000@monsoon.he.net>
2004-05-04 20:36   ` Todd Poynor [this message]
     [not found]     ` <Pine.LNX.4.50.0405042110440.30304-100000@monsoon.he.net>
2004-05-06  1:08       ` Todd Poynor
2004-05-14  2:50         ` Pavel Machek
2004-05-15  2:08           ` Todd Poynor

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=4097FED8.3020003@mvista.com \
    --to=tpoynor@mvista.com \
    --cc=linux-hotplug-devel@lists.sourceforge.net \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mochel@digitalimplant.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;
as well as URLs for NNTP newsgroup(s).