public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Pavel Machek <pavel@ucw.cz>
To: Michael Tokarev <mjt@tls.msk.ru>
Cc: "Rafael J. Wysocki" <rjw@sisk.pl>,
	Kernel Mailing List <linux-kernel@vger.kernel.org>
Subject: Re: hibernate/suspend-to-disk: to turn power or not?
Date: Thu, 31 Jan 2008 15:40:30 +0100	[thread overview]
Message-ID: <20080131144030.GC983@elf.ucw.cz> (raw)
In-Reply-To: <47A10886.5050707@msgid.tls.msk.ru>

Hi!

>  o 2.6.24 kernel fails to suspend properly.  It "saves pages",
>    prints "Suspending console", when prints "Sl" and nothing
>    more happens.  At this time, I can manually poweroff the
>    machine, and resume works.  The same happens when running
>    32bits or 64bits kernel (it's an amd x2-64 system).

Patch welcome, it certainly works here.

>  o uswsusp is unaware of 64bits kernel and 32bits userland.
>    Looking at the source, that's probably (and for sure in
>    certain places) more than just missing compat_ioctl wrappers
>    for those:
> 
>   ioctl32(s2disk:3574): Unknown cmd fd(4) cmd(400c330d){t:'3';sz:12} arg(ffa4578c) on /dev/snapshot
>   ioctl32(s2disk:3574): Unknown cmd fd(4) cmd(4004330a){t:'3';sz:4} arg(00000805) on /dev/snapshot
> 
>    "probably" is where it reads the swap space - it's just
>    my guess that s2disk (and resume) will do some wrong here.
>    "for sure" is vbe code - since 32bits vbetools package
>    fails badly with 64bit kernel, it seems that it is looking
>    at the wrong place in /dev/mem.

Hmm.. yes, it would be nice to fix that.

> It's sad when while working on something you discover that
> "underlying" tools you use also don't work, and start fixing
> those, when discover that something else fails, and so on,
> until you finally gave up and abandom the whole initial
> idea...  Oh well, but c'est la vie...

:-).

> Back to the original question and a proposed solution.
> 
> I'm looking at the uswsusp source (while the kernel compiles),
> and have a question here.  Is it possible to call some external
> application (typically a shell script) to do the final work after
> when the image has been written?  I mean in principle - I
> understand there are some limitations here, but I don't know
> which exactly.

No, you can't exec() anything. That would write mtime back to disk and
cause badness.

> For the given task (send some command to the damn UPS),
> it typically involves writing/reading something to/from
> a given serial port (/dev/ttySxx), or to an USB device,
> or to a network -- depending on the UPS in use.  There
> are so many different UPSes out there, with so many different
> and stupid so-called "protocols", that it's impossible to
> teach s2disk about them all.

Create libups.so, and link s2disk to it?

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

  reply	other threads:[~2008-01-31 14:40 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-01-30 19:18 hibernate/suspend-to-disk: to turn power or not? Michael Tokarev
2008-01-30 20:12 ` Bruno Prémont
2008-01-30 21:03   ` Michael Tokarev
2008-01-30 21:11 ` Rafael J. Wysocki
2008-01-30 23:30   ` Michael Tokarev
2008-01-31 14:40     ` Pavel Machek [this message]
2008-02-01  7:17       ` Michael Tokarev
2008-02-01 11:35         ` Rafael J. Wysocki
2008-07-13 23:26       ` David Fries
2008-07-14  5:43         ` Pavel Machek
2008-01-30 21:25 ` Nigel Cunningham
2008-01-30 23:37   ` Michael Tokarev
2008-01-30 23:58     ` Nigel Cunningham

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=20080131144030.GC983@elf.ucw.cz \
    --to=pavel@ucw.cz \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mjt@tls.msk.ru \
    --cc=rjw@sisk.pl \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox