Re: [RFC] New Driver Model for 2.5

Jeff Garzik
2001-10-18T20:40:08Z

Patrick Mochel wrote:
> When the driver gets a save_state request, that is its notification that
> it is going to sleep. It should then stop/finish all I/O requests. It
> should then prevent itself from taking any more - by setting a flag or
> whatever. Then, device save state.
>
> From that point in, it should know not to take any requests, theoretically
> preserving state.
>
> When it gets the restore_state() call, it should first restore device
> state. Once it does that, it knows that it can take I/O requests again.
>
> That should work, right?

Seems reasonable. If a save_state is refused, I assume you
restore_state for all other devices and bring the system from a
half-working state [at the time the suspend was rejected] to a
full-working state?

Consider that it will take some amount of time to stop pending I/O
requests. You might want to walk the tree, and tell devices "start
saving", and then walk the tree again and say "finish saving."

Jeff

--
Jeff Garzik | Only so many songs can be sung
Building 1024 | with two lips, two lungs, and one tongue.
MandrakeSoft | - nomeansno