[tip:x86/urgent] x86: Add quirk to make Apple MacBook5,2 use reboot=pci

tip-bot for Paul Mackerras
2009-08-03T21:47:43Z

Commit-ID: 6c6c51e4cc11a5456fb1172008f7c69d955af9f6
Gitweb: http://git.kernel.org/tip/6c6c51e4cc11a5456fb1172008f7c69d955af9f6
Author: Paul Mackerras <paulus@samba.org>
AuthorDate: Mon, 3 Aug 2009 22:47:32 +1000
Committer: H. Peter Anvin <hpa@zytor.com>
CommitDate: Mon, 3 Aug 2009 13:34:24 -0700

x86: Add quirk to make Apple MacBook5,2 use reboot=pci

The latest Apple MacBook (MacBook5,2) doesn't reboot successfully
under Linux; neither the EFI reboot method nor the default method
using the keyboard controller works (the system just hangs and doesn't
reset). However, the method using the "PCI reset register" at 0xcf9
does work.

This adds a quirk to detect this machine via DMI and force the
reboot_type to BOOT_CF9. With this it reboots successfully without
requiring a command-line option. Note that the EFI code forces
reboot_type to BOOT_EFI when the machine is booted via EFI, but this
overrides that since the core_initcall runs after the EFI
initialization code.

Signed-off-by: Paul Mackerras <paulus@samba.org>
LKML-Reference: <19062.56420.501516.316181@cargo.ozlabs.ibm.com>
Signed-off-by: H. Peter Anvin <hpa@zytor.com>

---
arch/x86/kernel/reboot.c | 34 +++++++++++++++++++++++++++++++++-
1 files changed, 33 insertions(+), 1 deletions(-)

diff --git a/arch/x86/kernel/reboot.c b/arch/x86/kernel/reboot.c
index 508e982..834c9da 100644
--- a/arch/x86/kernel/reboot.c
+++ b/arch/x86/kernel/reboot.c
@@ -3,6 +3,7 @@
#include <linux/init.h>
#include <linux/pm.h>
#include <linux/efi.h>
+#include <linux/dmi.h>
#include <acpi/reboot.h>
#include <asm/io.h>
#include <asm/apic.h>
@@ -17,7 +18,6 @@
#include <asm/cpu.h>

#ifdef CONFIG_X86_32
-# include <linux/dmi.h>
# include <linux/ctype.h>
# include <linux/mc146818rtc.h>
#else
@@ -404,6 +404,38 @@ EXPORT_SYMBOL(machine_real_restart);