Re: [PATCH 2/2] Fix console handling during suspend/resume

Linus Torvalds
2006-06-16T02:28:52Z

On Fri, 16 Jun 2006, Benjamin Herrenschmidt wrote:
>
> You can't save a consistent system image if your drivers aren't all
> stopped and DMA is stopped.

Read the whole thread to an end.

You don't _need_ to save a consistent system image. There's no "single
snapshot in time" needed.

The only thing needed is to save a _workign_ system image, and that's very
different.

> Example is USB for example: to save a consistent state, the USB host
> controller must stop DMA processing (for both STD and kexec). But that
> means it can't process requests.

No. It means no such thing. It just means that trying to save a total
snapshot is insane and fundamentally impossible.

Instead, you save a snapshot of the stuff you care about afterwards. All
the while realizing that when you resume, you cannot rely on any temporary
data structures (that did get saved off - because trying to teach the STD
logic the meaning of all memory is obviously _also_ insane) in the
drivers.

But you have a perfect callback for that. It's called the "resume" part.
The driver _knows_ which parts of its data it changes on its own as part
of normal operation, and it re-creates those parts rather than depend on
them being saved away atomically, since doing it atomically is
_impossible_.

Why can't people accept that simple statement? If you give up on doing the
impossible, suddenly everything else becomes much easier. Don't work so
hard at doing something that must not be done in the first place!

Linus