All of lore.kernel.org
 help / color / mirror / Atom feed
From: Pavel Machek <pavel@ucw.cz>
To: Pierre Ossman <drzeus-list@drzeus.cx>
Cc: LKML <linux-kernel@vger.kernel.org>, linux-pm@osdl.org
Subject: Re: swsusp doesn't suspend devices
Date: Wed, 7 Sep 2005 23:06:51 +0200	[thread overview]
Message-ID: <20050907210651.GA2878@elf.ucw.cz> (raw)
In-Reply-To: <431ECCE3.8080408@drzeus.cx>

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

      parent reply	other threads:[~2005-09-07 21:06 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-09-07 11:20 swsusp doesn't suspend devices Pierre Ossman
2005-09-07 20:03 ` Rafael J. Wysocki
2005-09-07 20:03   ` Rafael J. Wysocki
2005-09-07 20:17   ` Pierre Ossman
2005-09-07 20:40     ` Rafael J. Wysocki
2005-09-07 20:40       ` Rafael J. Wysocki
2005-09-07 21:06 ` Pavel Machek [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20050907210651.GA2878@elf.ucw.cz \
    --to=pavel@ucw.cz \
    --cc=drzeus-list@drzeus.cx \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-pm@osdl.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.