* suspending machine from kernel (was Re: [linux-pm] [RFC] why do we need run disk sync before entering S3)
[not found] ` <20090515010055.GB21718@khazad-dum.debian.net>
@ 2009-05-15 9:08 ` Pavel Machek
2009-05-15 21:15 ` Henrique de Moraes Holschuh
0 siblings, 1 reply; 2+ messages in thread
From: Pavel Machek @ 2009-05-15 9:08 UTC (permalink / raw)
To: Henrique de Moraes Holschuh; +Cc: kernel list, linux-pm, linux-acpi
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
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: suspending machine from kernel (was Re: [linux-pm] [RFC] why do we need run disk sync before entering S3)
2009-05-15 9:08 ` suspending machine from kernel (was Re: [linux-pm] [RFC] why do we need run disk sync before entering S3) Pavel Machek
@ 2009-05-15 21:15 ` Henrique de Moraes Holschuh
0 siblings, 0 replies; 2+ messages in thread
From: Henrique de Moraes Holschuh @ 2009-05-15 21:15 UTC (permalink / raw)
To: Pavel Machek; +Cc: kernel list, linux-pm, linux-acpi
On Fri, 15 May 2009, Pavel Machek wrote:
> > 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.
Yeah, this really calls for issuing some sort of event to userspace that has
the "emergency" connotation, so that desktop enviromnents don't start doing
retarted things like asking the user stupid questions when the machine has
30 seconds left of battery juice, or got waken up from S3 due to a
critically hot thermal alarm.
> I guess sending signal to init would be right solution in that
> case. (ACPI already does that on overheat.)
I will look into this.
--
"One disk to rule them all, One disk to find them. One disk to bring
them all and in the darkness grind them. In the Land of Redmond
where the shadows lie." -- The Silicon Valley Tarot
Henrique Holschuh
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2009-05-15 21:15 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
[not found] <Pine.LNX.4.44L0.0905131000360.3004-100000@iolanthe.rowland.org>
[not found] ` <200905131616.27334.rjw@sisk.pl>
[not found] ` <20090514094249.GG6417@elf.ucw.cz>
[not found] ` <20090515010055.GB21718@khazad-dum.debian.net>
2009-05-15 9:08 ` suspending machine from kernel (was Re: [linux-pm] [RFC] why do we need run disk sync before entering S3) Pavel Machek
2009-05-15 21:15 ` Henrique de Moraes Holschuh
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®