Re: [PATCH] Hotplug for device power state changes

From: Russell King
Date: Thu Apr 29 2004 - 16:45:03 EST


On Thu, Apr 29, 2004 at 01:26:54PM -0700, Todd Poynor 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.

Note that we should run this synchronously with userspace - ie, wait
for the userspace hotplug script to finish executing before moving
on to the next device. Why?

Think of the case where we're suspending the complete system. If you
go round and asynchonously try to run userspace scripts, chances are
you'll have the CPU asleep before _any_ of the scripts have run, which
means (eg) your DHCP client couldn't tell the server that its released
its allocation.

Also, should we be telling userspace about suspend before we actually
suspend the device?

--
Russell King
Linux kernel 2.6 ARM Linux - http://www.arm.linux.org.uk/
maintainer of: 2.6 PCMCIA - http://pcmcia.arm.linux.org.uk/
2.6 Serial core
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/