Re: [PATCH] Hotplug for device power state changes

From: Nigel Cunningham
Date: Fri Apr 30 2004 - 19:17:26 EST


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?

Regards,

Nigel

--
Nigel Cunningham
C/- Westminster Presbyterian Church Belconnen
61 Templeton Street, Cook, ACT 2614, Australia.
+61 (2) 6251 7727 (wk)

At just the right time, while we were still powerless, Christ
died for the ungodly. (Romans 5:6)
-
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/