lkml.org 
[lkml]   [2005]   [Sep]   [7]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: swsusp doesn't suspend devices
Hi!

> It would seem that swsusp doesn't properly suspend devices, or more
> precisely it wakes them up again before suspending the machine.

Yes, and that's okay.

What happens to devices during swsusp? They seem to be resumed
during system suspend?

A: That's correct. We need to resume them if we want to write image to
disk. Whole sequence goes like

Suspend part
~~~~~~~~~~~~
running system, user asks for suspend-to-disk

user processes are stopped

suspend(PMSG_FREEZE): devices are frozen so that they don't
interfere
with state snapshot

state snapshot: copy of whole used memory is taken with
interrupts disabled

resume(): devices are woken up so that we can write image to
swap

write image to swap

suspend(PMSG_SUSPEND): suspend devices so that we can power off

turn the power off

Resume part
~~~~~~~~~~~
(is actually pretty similar)

running system, user asks for suspend-to-disk

user processes are stopped (in common case there are none, but
with resume-from-initrd, noone k\nows)

read image from disk

suspend(PMSG_FREEZE): devices are frozen so that they don't
interfere
with image restoration

image restoration: rewrite memory with image

resume(): devices are woken up so that system can continue

thaw all user processes

--
if you have sharp zaurus hardware you don't need... you know my address
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2005-09-07 23:10    [W:0.061 / U:0.036 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site