From: Bernard Blackham <bernard-4vSAtV5O1nc0n/F98K4Iww@public.gmane.org>
To: acpi-devel-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org
Subject: S4 sleep woes
Date: Fri, 30 Jul 2004 13:06:15 +0800 [thread overview]
Message-ID: <20040730050615.GA24597@blackham.com.au> (raw)
The following bug was observed when using Software Suspend 2
(softwaresuspend.berlios.de), but the bug itself lies in the ACPI
code (neither in-kernel suspend-to-disk implementations work on my
laptop, so I can't test it).
Recent versions of Software Suspend 2 have an option to use ACPI S4
support to halt the machine, that (indirectly) calls
acpi_pm_prepare(4) and acpi_pm_enter(4).
The problem is that by default, this makes my machine hang with the
sleep light flashing instead of powering off.
In 2.6.7:
>From drivers/acpi/sleep/main.c (acpi_sleep_init):
if (i == ACPI_STATE_S4) {
if (acpi_gbl_FACS->S4bios_f) {
sleep_states[i] = 1;
printk(" S4bios");
acpi_pm_ops.pm_disk_mode = PM_DISK_FIRMWARE; <---
} else if (sleep_states[i])
acpi_pm_ops.pm_disk_mode = PM_DISK_PLATFORM; <---
}
With reference to the lines pointed out, if the machine claims that
its BIOS supports S4 itself, then pm_disk_mode is set to
PM_DISK_FIRMWARE.
Later on, in acpi_pm_enter:
case PM_SUSPEND_DISK:
if (acpi_pm_ops.pm_disk_mode == PM_DISK_PLATFORM)
status = acpi_enter_sleep_state(acpi_state);
else
do_suspend_lowlevel_s4bios();
break;
Hence, if pm_disk_mode is PM_DISK_FIRMWARE (because the BIOS claims
it can do S4), then do_suspend_lowlevel_s4bios() is called.
Now, according to the ACPI spec (2.0c, section 9.1.4.2 - The S4BIOS
transition), "the BIOS then saves the appropriate memory and chip
set context, and then places the platform into the S4 state (power
off to all devices)."
In the pmdisk/swsusp/software-suspend-2 case, this clearly isn't
desirable, as we've just saved memory ourselves.
If I force pm_disk_mode = PM_DISK_PLATFORM, then my machine uses
acpi_enter_sleep_state in order to sleep, and all works well. It
does shutdown as intended, and even better, shaves about 10 seconds
off the 30 second BIOS boot time when resuming.
>From what I gather, with pmdisk or swsusp, pm_disk_mode should never
be PM_DISK_FIRMWARE, as that essentially asks the BIOS to do S4 for
us.
Thoughts?
Bernard.
--
Bernard Blackham <bernard at blackham dot com dot au>
-------------------------------------------------------
This SF.Net email is sponsored by OSTG. Have you noticed the changes on
Linux.com, ITManagersJournal and NewsForge in the past few weeks? Now,
one more big change to announce. We are now OSTG- Open Source Technology
Group. Come see the changes on the new OSTG site. www.ostg.com
next reply other threads:[~2004-07-30 5:06 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2004-07-30 5:06 Bernard Blackham [this message]
[not found] ` <20040730050615.GA24597-4vSAtV5O1nc0n/F98K4Iww@public.gmane.org>
2004-07-31 15:01 ` S4 sleep woes Karol Kozimor
[not found] ` <20040731150112.GA480-DETuoxkZsSqrDJvtcaxF/A@public.gmane.org>
2004-07-31 18:46 ` Bernard Blackham
[not found] ` <20040731184636.GG3443-4vSAtV5O1nc0n/F98K4Iww@public.gmane.org>
2004-08-01 23:32 ` Nigel Cunningham
2004-08-16 10:01 ` Pavel Machek
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=20040730050615.GA24597@blackham.com.au \
--to=bernard-4vsatv5o1nc0n/f98k4iww@public.gmane.org \
--cc=acpi-devel-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.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