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

Linus Torvalds
2006-06-20T22:06:23Z

On Sun, 18 Jun 2006, David Brownell wrote:
>
> Do you see the case of consoles staying usable as being like no-spindown?
> Or something different? (Some of what you've said implied to me switching
> to a different model than freezing driver stacks...)

I don't think it's necessarily so much about consoles per se. I suspect
99% of all console-devices wouldn't even have a freeze/unfreeze action,
since they generally don't do DMA anyway (but I think it would be best to
call "console_suspend()/console_resume()" around the actual disk writing
anyway).

I think the spindown example isn't even special. A lot of devices would do
suspend by just shutting off, and a lot of devices take several
milliseconds to power up and discover, even in the absense of any moving
media.

The fact is, "shut down" and "freeze for a moment" are just fundamentally
different ops. Not just to disks.

Think just about any USB device. suspend might try to keep power active
(hey, if you want the keyboard to wake thigns up, it had better), but if
you have a USB camera, a "freeze" is potentially totally different from a
"suspend". A "freeze" would do absolutely nothing (it's a USB host
controller issue), while a suspend might actually shut the dang thing
down.

Yeah, for suspend-to-disk and a camera, maybe you don't care. But my point
is, that disks are NOT special. The only thing that makes them special
at all in your world-view has nothing to do with the device itself, or the
action itself, but simply that you realize that "suspend-to-disk" will
need to wake it up afterwards.

But for all you know, the suspend-to-disk will need the random USB device
too - security signatures from USB keycard readers etc to enable disk
access aren't actually all that sci-fi (and some day it may even be the
camera that validates you).

So once you get over that hump, you realize that the "freeze" thing
actually _is_ different from "shut down".

> > And the special cases may not even be hard. For example, take the disk
> > case above. Disks are generally _trivial_ to suspend. You just basicallyt
> > tell them to. You're done.
>
> Most pieces of hardware are pretty easy to stick into low power states.
> What's hard is getting everything quiesced, and ready to be suspended.
> (Which is the guts of what a freeze does.)

That's not even true. A lot of hardware needs _lots_ of care to come back
from a real low-power event. Like reloading firmware etc.

Linus