Messages in this thread | | | Date | Fri, 30 Apr 2004 09:30:12 +0100 | From | Russell King <> | Subject | Re: [PATCH] Hotplug for device power state changes |
| |
On Fri, Apr 30, 2004 at 10:50:26AM +1000, Benjamin Herrenschmidt wrote: > This is dangerous. > > If the device you are suspending is on the VM path in any way, > beeing synchronous with a userland call can deadlock you solid.
And not being synchronous means that there's no point in calling userland, because userland won't run before the machine has suspended, so there's no point in calling it in the first place. Also consider the case where you suspend, and asynchronously queue up all these suspend scripts to run. Then you resume and queue up the resume scripts to run. What order do the suspend and resume scripts ultimately end up being run?
What if the scripts have side effects like releasing and re-acquiring your DHCP allocation - what would be the effect of the suspend script completing after the resume script?
What about the case where suspend/resume scripts bring up/tear down any communication protocol?
Maybe we should have a two-pass approach, where the first pass synchronously tells userspace about the suspend, and the second pass does the actual suspend. Then for resume the opposite.
-- 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@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
| |