From: Len Brown <lenb@kernel.org>
To: "Rafael J. Wysocki" <rjw@sisk.pl>
Cc: Andrew Morton <akpm@linux-foundation.org>,
ACPI Devel Maling List <linux-acpi@vger.kernel.org>,
LKML <linux-kernel@vger.kernel.org>, Pavel Machek <pavel@ucw.cz>,
pm list <linux-pm@lists.linux-foundation.org>
Subject: Re: [PATCH -mm 2/3] PM: More fine grained ACPI handling during suspend and hibernation (rev. 3)
Date: Tue, 28 Aug 2007 15:48:45 -0400 [thread overview]
Message-ID: <200708281548.45912.lenb@kernel.org> (raw)
In-Reply-To: <200708272351.10882.rjw@sisk.pl>
On Monday 27 August 2007 17:51, Rafael J. Wysocki wrote:
> According to the ACPI specification (eg. ACPI 2.0c, sec. 7.3.1, 7.3.3,
> ACPI 3.0b, sec. 7.3.1, 7.3.3) the _GTS and _BFS global control methods should
> be executed, respectively, right before entering a sleep state (S1-S4) and right
> after leaving it, but we don't follow this reqirement. Namely, in our
> implementation the nonboot CPUs are disabled after executing _GTS and enabled
> before executing _BFS, which doesn't seem to be correct.
I've never encountered a BIOS that actually implements _GTS or _BFS,
so I expect that changing how they are invoked may be somewhat academic.
> [In fact, the ACPI
> specification requires that no physical I/O and interrupt servicing be performed
> after the sleep state has been left and before _BFS is executed as well as after
> executing _GTS and before the sleep state is entered, but we can't follow this
> requirement literally,
> since our AML interpreter needs to run with interrupts
> enabled and we need to carry out some operations with interrupts disabled before
> entering the sleep state and after leaving it.]
This is sort of a myth.
The real requirement is that the ACPI interpreter must be able to call kmalloc().
It does this today via acpi_os_allocate(), which does this:
kmalloc(size, irqs_disabled()? GFP_ATOMIC : GFP_KERNEL);
No, we don't actually run the interpreter during device interrupts,
but we need to be able to run it with interrupts off for boot,
suspend, and resume.
So how did boot work before this hack was added?
kmalloc() does a might_sleep(), but deep down in
cond_sleep, there is a handy little check for
if (system_state == SYSTEM_RUNNING)
to disable the run-time oops.
I suggested that since it works during boot, and resume is in many
ways similar to boot, we should just re-use system_state for early resume.
But at the time, akpm told me not to use system_state, and so we have the hack above.
I don't recall his reasoning -- it might be something that should
be re-visited. I don't like disabling the may_sleep() check all the time,
I'd rather just disable it during the critical boot/suspend/resume states.
> Moreover, acpi_enable() called
> after restoring the system memory state from a hibernation image should really
> be executed before enabling the nonboot CPUs, since functional ACPI may be
> needed for that. All of this means that we need to handle ACPI in a more fine
> grained manner during suspend and hibernation.
I don't follow the requirement to boot an ACPI-enabled resume image
from a non-ACPI-enabled boot kernel. Certainly this isn't a scenario
described by the ACPI spec, which transitions between G1(S4) and G0(S0) without
going through an ACPI-disabled state.
-Len
next prev parent reply other threads:[~2007-08-28 19:49 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-08-27 21:47 [PATCH -mm 0/3] PM: Improve ACPI handling during suspend and hibernation (rev. 3) Rafael J. Wysocki
2007-08-27 21:49 ` [PATCH -mm 1/3] Hibernation: Enter platform hibernation state in a consistent way " Rafael J. Wysocki
2007-08-27 21:51 ` [PATCH -mm 2/3] PM: More fine grained ACPI handling during suspend and hibernation " Rafael J. Wysocki
2007-08-28 19:48 ` Len Brown [this message]
2007-08-28 21:35 ` Rafael J. Wysocki
2007-08-29 15:22 ` Rafael J. Wysocki
2007-08-27 21:53 ` [PATCH -mm 3/3] PM: Improve handling of ACPI system state indicator " Rafael J. Wysocki
2007-08-28 19:57 ` Moore, Robert
2007-08-28 22:05 ` Rafael J. Wysocki
2007-08-29 16:54 ` Moore, Robert
2007-08-29 19:40 ` Rafael J. Wysocki
2007-08-29 15:26 ` [linux-pm] " Rafael J. Wysocki
2007-08-29 22:31 ` [linux-pm] [PATCH -mm 0/3] PM: Improve ACPI handling during suspend and hibernation " Rafael J. Wysocki
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=200708281548.45912.lenb@kernel.org \
--to=lenb@kernel.org \
--cc=akpm@linux-foundation.org \
--cc=linux-acpi@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-pm@lists.linux-foundation.org \
--cc=pavel@ucw.cz \
--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