Cc: Nigel Cunningham <nigel@...>, Benjamin Herrenschmidt <benh@...>, Pavel Machek <pavel@...>, Rafael J. Wysocki <rjw@...>, Matthew Garrett <mjg59@...>, <linux-kernel@...>, <linux-pm@...>
But it _is_ about the freezer; see the "Remove process freezer" part.
:-) Since the freezer is used during hibernation, hibernation is a
legitimate topic.
Your short and simple list omits a few crucial items:
A) Decide what to do about remote wakeup requests.
B) Prevent I/O requests from resuming devices that have been
suspended.
C) Prevent devices and drivers from being registered or unregistered;
in particular decide what to do about hot-plug or hot-unplug events.
D) Block driver bind or unbind calls.
Any of these things is capable of screwing up the course of events.
(In fact A _should_ be allowed to abort a suspend.)
So what happens if a new subdevice arrives at the wrong time? Do you
block instead of binding it? While holding a mutex needed to suspend
the parent device?
What about drivers trying to bind to existing devices?
What happens to I/O requests submitted after the "no_io" flag is set?
The driver will have to block them, effectively creating its own little
"freezer".
This is a lot like what we already do. The differences are:
There is nothing corresponding to your "no-bind" flag.
Most drivers don't have anything like your "no_io" flag;
they assume that nobody will be around to submit an I/O
request.
Nobody doubts that suspend can be made to work without the freezer.
The point is that doing it this way dumps a bunch of extra
responsibility on drivers.
Alan Stern
-