Cc: Kyle Moffett <mrmacman_g4@...>, Nigel Cunningham <nigel@...>, Pavel Machek <pavel@...>, Rafael J. Wysocki <rjw@...>, Matthew Garrett <mjg59@...>, <linux-kernel@...>, <linux-pm@...>
Spinning in the driver with the lock not held is impossible, since the
driver is called with the lock already acquired.
Failing with -ERETRY is non-transparent. I would prefer to block such
requests at their source, before the lock is acquired. Perhaps in the
driver core, perhaps even earlier.
(And rather than trying to manage a waitqueue or struct completion, it
would be easiest to jump directly into the freezer! The driver or the
core wouldn't have to worry about waking up all these blocked threads.)
You're missing the point. If the driver and the freezer are both
solid, there's no reason they can't share the work. If many drivers
can pass off part of their workload to the single freezer, it's a net
win.
So it isn't a question of how solid the drivers are; it's a question
of how solid the freezer is. And bear in mind that if you convince
people the freezer is not solid enough to be used, then you will have
to find an alternative for purposes of hibernation.
<... Long and cogent argument which I will skip over for now ...>
I'm willing to try, although I think it will be a tremendous amount of
work to verify that every driver does the right thing. There's lots of
support missing. For example, don't you think we should block all
sysfs I/O during suspend? And likewise for insmod/rmmod?
What about systems with no BIOS? I think this would be very hard or
even impossible to make work.
Alan Stern
-