public inbox for linux-acpi@vger.kernel.org
 help / color / mirror / Atom feed
From: Pavel Machek <pavel@ucw.cz>
To: Henrique de Moraes Holschuh <hmh@hmh.eng.br>
Cc: kernel list <linux-kernel@vger.kernel.org>,
	linux-pm@lists.linux-foundation.org, linux-acpi@vger.kernel.org
Subject: suspending machine from kernel (was Re: [linux-pm] [RFC] why do we need run disk sync before entering S3)
Date: Fri, 15 May 2009 11:08:44 +0200	[thread overview]
Message-ID: <20090515090843.GC32740@elf.ucw.cz> (raw)
In-Reply-To: <20090515010055.GB21718@khazad-dum.debian.net>

On Thu 2009-05-14 22:00:56, Henrique de Moraes Holschuh wrote:
> On Thu, 14 May 2009, Pavel Machek wrote:
> > But remember there are even in-kernel s2ram triggers, for example on
> > zaurus when battery goes critical.
> 
> Are there?  I am quite interested on this!

Yes.

It is a bit of mess, but see

common/sharpsl_pm.c:

   /* Suspend if critical battery level */
        if ((sharpsl_pm.battstat.ac_status != APM_AC_ONLINE)
                        && (sharpsl_pm.battstat.mainbat_status ==
APM_BATTERY_STATUS_CRITICAL)
                        && !(sharpsl_pm.flags & SHARPSL_APM_QUEUED)) {
                sharpsl_pm.flags |= SHARPSL_APM_QUEUED;
                dev_err(sharpsl_pm.dev, "Fatal Off\n");
                apm_queue_event(APM_CRITICAL_SUSPEND);
        }

it eventually triggers regular s2ram paths.

Older versions did suspend on power button press. (You can't really
turn zaurus _off_, AFAICT.)

> Are they safe on x86?

Well, probably safe but definitely would need some cleanup.

> thinkpad-acpi receives some critical alarms from the firmware, for which the
> recommended action by the vendor is to go into S3 immediately.  There is
> also one which requires S4 as the recommended damage control measure.

While s2ram should always work on hardware that supports it (zaurus),
S4 is more tricky. It needs swap to be configured, and userspace
cooperation in uswsusp case.

I guess sending signal to init would be right solution in that
case. (ACPI already does that on overheat.)

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

  reply	other threads:[~2009-05-15  9:08 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-05-13  1:20 [RFC] why do we need run disk sync before entering S3 Zhang Rui
2009-05-13  2:01 ` [linux-pm] " Alan Stern
2009-05-13  8:03   ` Rafael J. Wysocki
2009-05-13  8:45     ` Pavel Machek
2009-05-13  8:53       ` Rafael J. Wysocki
2009-05-13  8:57         ` Pavel Machek
2009-05-13 14:06         ` Alan Stern
2009-05-13 14:16           ` Rafael J. Wysocki
2009-05-14  9:42             ` Pavel Machek
2009-05-15  1:00               ` Henrique de Moraes Holschuh
2009-05-15  9:08                 ` Pavel Machek [this message]
2009-05-15 21:15                   ` suspending machine from kernel (was Re: [linux-pm] [RFC] why do we need run disk sync before entering S3) Henrique de Moraes Holschuh
2009-05-15 14:36               ` [linux-pm] [RFC] why do we need run disk sync before entering S3 Rafael J. Wysocki
2009-05-18  7:25                 ` Zhang Rui
2009-05-22 15:33                   ` Pavel Machek
2009-05-23  7:59                     ` Oliver Neukum
2009-05-23  8:50                       ` [linux-pm] [RFC] why do we need run disk sync before entering?S3 Pavel Machek
2009-05-23  9:05                         ` Oliver Neukum
2009-05-23  9:45                           ` Pavel Machek
2009-05-24 21:02                             ` Oliver Neukum
2009-05-24 21:14                               ` Pavel Machek
2009-05-19  1:03     ` [RFC] why do we need run disk sync before entering S3 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=20090515090843.GC32740@elf.ucw.cz \
    --to=pavel@ucw.cz \
    --cc=hmh@hmh.eng.br \
    --cc=linux-acpi@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-pm@lists.linux-foundation.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