1 May 2004 02:03
Re: [PATCH] Hotplug for device power state changes
Nigel Cunningham <ncunningham <at> linuxmail.org>
2004-05-01 00:03:26 GMT
2004-05-01 00:03:26 GMT
Hi. Sorry for getting in on this conversion a little late; I've only just noticed it. The usual way in which userspace notification of suspending/resuming is handled at the moment is via scripts which are run prior to suspending and after resuming. As has been noted, the first thing the kernel side implementations does is freeze userspace, keeping things static until post resume. This seems to me to be a good, simple model. DHCP releases can be handled from user space, prior to echo 4 > /proc/acpi/sleep (or alternatives) and the whole difficulty regarding interactions between userspace and kernelspace just goes away. Note too that the actual invocation of a suspend can still be in response to kernel events. An ACPI event can be sent to the userspace ACPI daemon, which does userspace preparations and then invokes the kernel suspend mechanism. After resume, it can also do userspace reinitialisation. Given this model, I would suggest that hotplug should silently drop any events that happen while suspending, and queue events that occur while resuming until the kernelspace part of resuming is complete and userspace can run as normal. It shouldn't rely upon device suspend/resume notifications because they can and do happen while we're still in the process of suspending and resuming. The means to detect whether we're suspending or resuming or running normally could be implemented as a simple function that could test the status of the different suspend implementations. Is that at all helpful?(Continue reading)
RSS Feed