Re: suspend2 merge (was Re: [Suspend2-devel] Re: CFS and suspend2: hang in atomic copy)

Pavel Machek
2007-04-25T20:27:59Z

Hi!

_Can we get a suspend-to-RAM maintainer_?

Noone cares about s2ram these days. I do care a little, seife
maintains whitelist, you care for mac mini, Len/Andrew/Intel acpi team
helps sometimes... But I feel we should have someone listed in the
MAINTAINERS file. Patrick was close, but...

> > Any working suspend-to-disk method takes care of that for me. (I'm
> > really not sure why Linus hates S2D so much, though. Back in the day
> > there was a lot more BIOS support, but that's been years now.)
>
> The really sad part is that APM actually did this better..

I agree that APM STR worked better than current ACPI STR. I think
swsusp already works better than APM STD, but...

> I think you could do STD right too, but:
>
> - if you think it's about suspending devices, you are immediately
> disqualified. If you call the device driver "suspend" or "resume"
> functions, you are doing something wrong.
>
> - "suspend" is: snapshot memory, and anything you do *after* the snapshot
> is totally irrelevant. You MUST NOT suspend devices before, since
> devices are what that snapshot should be written out to, and you MUST
> NOT suspend devices afterwards either, because that shows that you are
> a moron who didn't understand the "machine will be turned off" part.

Can I get you on IRC somewhere? No, I do not think I'm a moron, and
yes, I need to suspend^Wsnapshot the devices before, so I have that in
the snapshot. Of course, I'll need to resume^Wrestore the devices
before writing snapshot. That's okay, it does not take long.

> - "resume" is basically: get image into memory, turn *off* every device,

Exactly. I need to turn devices *off* before restoring image, and I
need them *off* before saving image, too -- DMAs are dangerous.

I currently do that using "suspend" and "resume" hooks, before they
turn DMAs / IRQs off as a sideeffect.

> put image into its proper location, and call the "startup" function. If
> you call a device "resume()" function, you again show that you are a
> moron, because you're not resuming anything at all, you're resetting
> the device from scratch. You _reinitialize_ the device. You don't
> resume it, and somebody may hve (and indeed, *WILL HAVE* used the
> device in between). There should be absolutely zero shared code, and
> the *last* thing you should do is to call the device with the same
> function, and give it a flag to tell it to do one thing or the other.

Well, "startup" function or how you want to call it has to deal with
device not initialized (s2disk driver is module, s2ram with hw powered
off) and has to deal with device initialized (s2disk driver in kernel
case, s2ram device was powered).

I fear that "resume"/"restore" functions need to be pretty robust,
anyway...

> And THAT is why I hate the kernel STD. It is fundamentally confused. In
> ways that APM was not, I'd like to point out.

Ok, yes, it is confused/confusing.

> I'd love to get it fixed. But the first fix is to not call it "suspend",
> because language *does* matter, and using that term is what I'm convinced
> has confused so many people.

> If it had been called "snapshot + restore", I suspect a lot of
> people

snapshot/restore sounds okay to me.
Pavel
--
(english) http://www.livejournal.com/~pavelmachek
(cesky, pictures) http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blog.html