mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Pavel Machek <pavel@suse.cz>
To: Patrick Mochel <mochel@osdl.org>
Cc: kernel list <linux-kernel@vger.kernel.org>
Subject: Re: -test7: /sys/power/disk not reading right data?
Date: Mon, 13 Oct 2003 19:30:58 +0200	[thread overview]
Message-ID: <20031013173058.GI15441@elf.ucw.cz> (raw)
In-Reply-To: <Pine.LNX.4.44.0310130946150.17450-100000@cherise>

Hi!

> > What advantages does disk/ state separation have? I believe that echo
> > swsusp > state (or echo s4bios > state or echo disk-firmware > state)
> > is the right interface, and that we want to do echo "s4bios" >
> > on_battery_low or similar interface. (echo "mem" > on_battery_low
> > makes sense, too, toshiba notebooks do that for example).
> 
> The string 's4bios' only makes sense on systems that support it, while 
> 'disk' is concise and obvious, regardless on how your platform implements 
> it. I don't want to have options that are only relevant on a subset of the 
> systems out there. 

So call it disk-firmware.

The two-files interface is accident waiting for happen. (And accident
that already happened, it crashed my machine at least twice).

Assume your user has 'echo platform > /sys/power/disk', and has
suspend partition configured for BIOS.

He's used to suspending by echo disk > /sys/power/state. One day, for
whatever reason (new kernel does not recognize s4bios?) platform
suspend is unavailable. echo > /sys/power/disk is going to fail, but
user is very unlikely to notice that. He is also very unlikely to cat
/sys/power/disk before doing suspend. He does 'echo disk >
/sys/power/disk', machine does swsusp (ouch). He can still save his
data by adding resume=... parameter on next boot, but I guess it is
unlikely to happen.

This looks very much like "trap for user" to me, and that trap already
got me twice (s4bios does not really work here now, and I was trying
to test pmdisk. It took me two fsck-s before I found out whats
happening).

If you want to have concise and obvious interface, do echo
'disk-platform' vs. 'disk-firmware', or whatever, but please do not
use two files.
								Pavel
-- 
When do you have a heart between your knees?
[Johanka's followup: and *two* hearts?]

      reply	other threads:[~2003-10-13 17:31 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-10-10  8:17 Pavel Machek
2003-10-10  9:10 ` Pavel Machek
2003-10-13 16:51   ` Patrick Mochel
2003-10-13 17:30     ` 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=20031013173058.GI15441@elf.ucw.cz \
    --to=pavel@suse.cz \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mochel@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®