From: "Rafael J. Wysocki" <rjw@sisk.pl>
To: Matthew Garrett <mjg@redhat.com>
Cc: linux-acpi@vger.kernel.org, lenb@kernel.org,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH] acpi: Unconditionally set SCI_EN on resume
Date: Tue, 11 May 2010 20:27:36 +0200 [thread overview]
Message-ID: <201005112027.36923.rjw@sisk.pl> (raw)
In-Reply-To: <1273600165-16681-1-git-send-email-mjg@redhat.com>
On Tuesday 11 May 2010, Matthew Garrett wrote:
> The ACPI spec tells us that the firmware will reenable SCI_EN on resume.
> Reality disagrees in some cases. The ACPI spec tells us that the only way
> to set SCI_EN is via an SMM call.
> https://bugzilla.kernel.org/show_bug.cgi?id=13745 shows us that doing so
> may break machines. Tracing the ACPI calls made by Windows shows that it
> unconditionally sets SCI_EN on resume with a direct register write, and
> therefore the overwhelming probability is that everything is fine with
> this behaviour.
>
> Signed-off-by: Matthew Garrett <mjg@redhat.com>
> ---
> arch/x86/kernel/acpi/sleep.c | 2 -
> drivers/acpi/sleep.c | 157 +-----------------------------------------
> include/linux/acpi.h | 1 -
> 3 files changed, 2 insertions(+), 158 deletions(-)
>
> diff --git a/arch/x86/kernel/acpi/sleep.c b/arch/x86/kernel/acpi/sleep.c
> index f996103..82e5086 100644
> --- a/arch/x86/kernel/acpi/sleep.c
> +++ b/arch/x86/kernel/acpi/sleep.c
> @@ -162,8 +162,6 @@ static int __init acpi_sleep_setup(char *str)
> #endif
> if (strncmp(str, "old_ordering", 12) == 0)
> acpi_old_suspend_ordering();
> - if (strncmp(str, "sci_force_enable", 16) == 0)
> - acpi_set_sci_en_on_resume();
> str = strchr(str, ',');
> if (str != NULL)
> str += strspn(str, ", \t");
> diff --git a/drivers/acpi/sleep.c b/drivers/acpi/sleep.c
> index baa76bb..4ab2275 100644
> --- a/drivers/acpi/sleep.c
> +++ b/drivers/acpi/sleep.c
> @@ -80,22 +80,6 @@ static int acpi_sleep_prepare(u32 acpi_state)
>
> #ifdef CONFIG_ACPI_SLEEP
> static u32 acpi_target_sleep_state = ACPI_STATE_S0;
> -/*
> - * According to the ACPI specification the BIOS should make sure that ACPI is
> - * enabled and SCI_EN bit is set on wake-up from S1 - S3 sleep states. Still,
> - * some BIOSes don't do that and therefore we use acpi_enable() to enable ACPI
> - * on such systems during resume. Unfortunately that doesn't help in
> - * particularly pathological cases in which SCI_EN has to be set directly on
> - * resume, although the specification states very clearly that this flag is
> - * owned by the hardware. The set_sci_en_on_resume variable will be set in such
> - * cases.
> - */
> -static bool set_sci_en_on_resume;
> -
> -void __init acpi_set_sci_en_on_resume(void)
> -{
> - set_sci_en_on_resume = true;
> -}
>
> /*
> * ACPI 1.0 wants us to execute _PTS before suspending devices, so we allow the
> @@ -253,11 +237,8 @@ static int acpi_suspend_enter(suspend_state_t pm_state)
> break;
> }
>
> - /* If ACPI is not enabled by the BIOS, we need to enable it here. */
> - if (set_sci_en_on_resume)
> - acpi_write_bit_register(ACPI_BITREG_SCI_ENABLE, 1);
> - else
> - acpi_enable();
> + /* This violates the spec but is required for bug compatibility. */
> + acpi_write_bit_register(ACPI_BITREG_SCI_ENABLE, 1);
No, this breaks my MSI Wind U100 right away.
If you called acpi_enable() before that and do that depending on its result,
_that_ would work.
Thanks,
Rafael
next prev parent reply other threads:[~2010-05-11 18:26 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-05-11 17:49 [PATCH] acpi: Unconditionally set SCI_EN on resume Matthew Garrett
2010-05-11 18:27 ` Rafael J. Wysocki [this message]
2010-05-11 18:33 ` Matthew Garrett
2010-05-11 18:41 ` Rafael J. Wysocki
2010-05-11 18:41 ` Matthew Garrett
2010-05-12 5:19 ` Len Brown
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=201005112027.36923.rjw@sisk.pl \
--to=rjw@sisk.pl \
--cc=lenb@kernel.org \
--cc=linux-acpi@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=mjg@redhat.com \
/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