> Actually it would be interesting to hear counter-arguments to this > position: > > We already HAVE that two-phase thing going on, at > least for swsusp. In phase I a PM_EVENT_FREEZE > gets sent. Then in phase II a PM_EVENT_SUSPEND gets > tries to really suspend things. > > One counter-argument might be that "phase I.5 resumes those devices" > is a problem. Another might be that "FREEZE should not be sent to > the console(s), the swap device, or their parents". I suspect there > are a few more issues mixed up in there too. This is FAQ: Q: I do not understand why you have such strong objections to idea of selective suspend. A: Do selective suspend during runtime power managment, that's okay. But its useless for suspend-to-disk. (And I do not see how you could use it for suspend-to-ram, I hope you do not want that). Lets see, so you suggest to * SUSPEND all but swap device and parents * Snapshot * Write image to disk * SUSPEND swap device and parents * Powerdown Oh no, that does not work, if swap device or its parents uses DMA, you've corrupted data. You'd have to do * SUSPEND all but swap device and parents * FREEZE swap device and parents * Snapshot * UNFREEZE swap device and parents * Write * SUSPEND swap device and parents Which means that you still need that FREEZE state, and you get more complicated code. (And I have not yet introduce details like system devices). -- (english) http://www.livejournal.com/~pavelmachek (cesky, pictures) http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blog.html