From: Christian Hofstaedtler <ch@zeha.at>
To: x86@kernel.org
Cc: hpa@zytor.com, lenb@kernel.org, tglx@linutronix.de,
linux-acpi@vger.kernel.org, venkatesh.pallipadi@intel.com,
arjan@infradead.org, bruce.w.allan@intel.com,
linux-kernel@vger.kernel.org, Christian Hofstaedtler <ch@zeha.at>
Subject: [PATCH 2/2] Default to ACPI reboots on newish X86 hardware
Date: Thu, 21 Jan 2010 18:18:43 +0100 [thread overview]
Message-ID: <1264094323-7187-2-git-send-email-ch@zeha.at> (raw)
In-Reply-To: <1264094323-7187-1-git-send-email-ch@zeha.at>
Newer hardware reportedly can no longer successfully reboot using the
keyboard controller, but needs to use ACPI instead.
To not cause problems with older hardware, only hardware with a BIOS
date 2003 or newer is considered for this choice.
Broken BIOSes (no DMI BIOS date, or BIOS date of 0) also get ACPI
reboots, but those will auto fallback to KBD reboots, as ACPI won't get
enabled without acpi=force.
---
arch/x86/kernel/reboot.c | 32 ++++++++++++++++++++++++++++++--
1 files changed, 30 insertions(+), 2 deletions(-)
diff --git a/arch/x86/kernel/reboot.c b/arch/x86/kernel/reboot.c
index 36f0c86..919453a 100644
--- a/arch/x86/kernel/reboot.c
+++ b/arch/x86/kernel/reboot.c
@@ -453,10 +453,33 @@ static struct dmi_system_id __initdata reboot_dmi_table_all[] = {
{ }
};
+/* See if the Hardware is new enough to support ACPI reboots. */
+static int __init reboot_acpi_likey_supported(void)
+{
+ int year;
+
+ /* No BIOS date? We can safely say "Yes" here, because ACPI-reboot
+ * will only work when acpi=force was specified, else it falls back
+ * to KBD-reboots anyway. */
+ if (!dmi_get_date(DMI_BIOS_DATE, &year, NULL, NULL)) {
+ return 1;
+ }
+ if (year == 0) {
+ return 1;
+ }
+
+ /* 2003 was decided as the cut-off year. */
+ if (year < 2003) {
+ return 0;
+ }
+ return 1;
+}
+
/* Decide how we will reboot:
* - Check the X86_32-only quirks table.
* - Check the generic quirks table.
- * - Default to old-style Keyboard Controller reboot.
+ * - Check if we could use ACPI-based reboot.
+ * - Fall back to old-style Keyboard Controller reboot.
*/
static int __init reboot_init(void)
{
@@ -472,7 +495,12 @@ static int __init reboot_init(void)
if (reboot_type != BOOT_UNDECIDED)
return 0;
- reboot_type = BOOT_KBD;
+ if (reboot_acpi_likey_supported()) {
+ reboot_type = BOOT_ACPI;
+ } else {
+ printk(KERN_INFO "Selecting old-style reboot for older hardware\n");
+ reboot_type = BOOT_KBD;
+ }
return 0;
}
--
1.6.4.4
next prev parent reply other threads:[~2010-01-21 17:20 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <alpine.LFD.2.00.1001061433260.4086@localhost.localdomain>
[not found] ` <1262894593-25563-1-git-send-email-ch@zeha.at>
[not found] ` <alpine.LFD.2.00.1001200007560.4265@localhost.localdomain>
2010-01-21 17:18 ` [PATCH 1/2] x86: Unify reboot_type selection Christian Hofstaedtler
2010-01-21 17:18 ` Christian Hofstaedtler [this message]
2010-01-23 19:57 ` [PATCH 2/2] Default to ACPI reboots on newish X86 hardware Len Brown
2010-01-21 18:29 ` [PATCH 1/2] x86: Unify reboot_type selection H. Peter Anvin
2010-01-21 17:24 ` [PATCH] Default to ACPI reboots on newish X86 hardware Christian Hofstaedtler
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=1264094323-7187-2-git-send-email-ch@zeha.at \
--to=ch@zeha.at \
--cc=arjan@infradead.org \
--cc=bruce.w.allan@intel.com \
--cc=hpa@zytor.com \
--cc=lenb@kernel.org \
--cc=linux-acpi@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=tglx@linutronix.de \
--cc=venkatesh.pallipadi@intel.com \
--cc=x86@kernel.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
all inboxes | Powered by JetHome®