All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] x86: Add quirk to make Apple MacBook5,2 use reboot=pci
@ 2009-08-03 12:47 Paul Mackerras
  2009-08-03 17:12 ` [tip:x86/urgent] " tip-bot for Paul Mackerras
  2009-08-03 21:47 ` tip-bot for Paul Mackerras
  0 siblings, 2 replies; 6+ messages in thread
From: Paul Mackerras @ 2009-08-03 12:47 UTC (permalink / raw)
  To: Ingo Molnar, H. Peter Anvin, Thomas Gleixner; +Cc: linux-kernel

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>
---
diff --git a/arch/x86/kernel/reboot.c b/arch/x86/kernel/reboot.c
index d2d1ce8..2106985 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
@@ -396,6 +396,38 @@ EXPORT_SYMBOL(machine_real_restart);
 
 #endif /* CONFIG_X86_32 */
 
+/*
+ * Apple MacBook5,2 (2009 MacBook) needs reboot=p
+ */
+static int __init set_pci_reboot(const struct dmi_system_id *d)
+{
+	if (reboot_type != BOOT_CF9) {
+		reboot_type = BOOT_CF9;
+		printk(KERN_INFO "%s series board detected. "
+		       "Selecting PCI-method for reboots.\n", d->ident);
+	}
+	return 0;
+}
+
+static struct dmi_system_id __initdata pci_reboot_dmi_table[] = {
+	{	/* Handle problems with rebooting on Apple MacBook5,2 */
+		.callback = set_pci_reboot,
+		.ident = "Apple MacBook",
+		.matches = {
+			DMI_MATCH(DMI_SYS_VENDOR, "Apple Inc."),
+			DMI_MATCH(DMI_PRODUCT_NAME, "MacBook5,2"),
+		},
+	},
+	{ }
+};
+
+static int __init pci_reboot_init(void)
+{
+	dmi_check_system(pci_reboot_dmi_table);
+	return 0;
+}
+core_initcall(pci_reboot_init);
+
 static inline void kb_wait(void)
 {
 	int i;

^ permalink raw reply related	[flat|nested] 6+ messages in thread

* [tip:x86/urgent] x86: Add quirk to make Apple MacBook5,2 use reboot=pci
  2009-08-03 12:47 [PATCH] x86: Add quirk to make Apple MacBook5,2 use reboot=pci Paul Mackerras
@ 2009-08-03 17:12 ` tip-bot for Paul Mackerras
  2009-08-03 17:40   ` Ozan Çağlayan
  2009-08-03 21:47 ` tip-bot for Paul Mackerras
  1 sibling, 1 reply; 6+ messages in thread
From: tip-bot for Paul Mackerras @ 2009-08-03 17:12 UTC (permalink / raw)
  To: linux-tip-commits; +Cc: linux-kernel, paulus, hpa, mingo, tglx

Commit-ID:  1961b971360c685e15dff59929c39ced6c46e171
Gitweb:     http://git.kernel.org/tip/1961b971360c685e15dff59929c39ced6c46e171
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 08:07:18 -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);
 
 #endif /* CONFIG_X86_32 */
 
+/*
+ * Apple MacBook5,2 (2009 MacBook) needs reboot=p
+ */
+static int __init set_pci_reboot(const struct dmi_system_id *d)
+{
+	if (reboot_type != BOOT_CF9) {
+		reboot_type = BOOT_CF9;
+		printk(KERN_INFO "%s series board detected. "
+		       "Selecting PCI-method for reboots.\n", d->ident);
+	}
+	return 0;
+}
+
+static struct dmi_system_id __initdata pci_reboot_dmi_table[] = {
+	{	/* Handle problems with rebooting on Apple MacBook5,2 */
+		.callback = set_pci_reboot,
+		.ident = "Apple MacBook",
+		.matches = {
+			DMI_MATCH(DMI_SYS_VENDOR, "Apple Inc."),
+			DMI_MATCH(DMI_PRODUCT_NAME, "MacBook5,2"),
+		},
+	},
+	{ }
+};
+
+static int __init pci_reboot_init(void)
+{
+	dmi_check_system(pci_reboot_dmi_table);
+	return 0;
+}
+core_initcall(pci_reboot_init);
+
 static inline void kb_wait(void)
 {
 	int i;

^ permalink raw reply related	[flat|nested] 6+ messages in thread

* Re: [tip:x86/urgent] x86: Add quirk to make Apple MacBook5,2 use reboot=pci
  2009-08-03 17:12 ` [tip:x86/urgent] " tip-bot for Paul Mackerras
@ 2009-08-03 17:40   ` Ozan Çağlayan
  2009-08-03 18:39     ` H. Peter Anvin
  0 siblings, 1 reply; 6+ messages in thread
From: Ozan Çağlayan @ 2009-08-03 17:40 UTC (permalink / raw)
  To: mingo, hpa, paulus, linux-kernel, tglx; +Cc: linux-tip-commits

tip-bot for Paul Mackerras wrote:
> Commit-ID:  1961b971360c685e15dff59929c39ced6c46e171
> Gitweb:     http://git.kernel.org/tip/1961b971360c685e15dff59929c39ced6c46e171
> 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 08:07:18 -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.
>   

MacBookPro5,1 has also this problem. I booted with reboot=pci on
2.6.30.4 and now it rebooted without problem.
That would be nice if you could add another quirk entry for it:

System Information
        Manufacturer: Apple Inc.
        Product Name: MacBookPro5,1

Thanks!
Ozan Caglayan

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [tip:x86/urgent] x86: Add quirk to make Apple MacBook5,2 use reboot=pci
  2009-08-03 17:40   ` Ozan Çağlayan
@ 2009-08-03 18:39     ` H. Peter Anvin
  2009-08-03 20:17       ` Ozan Çağlayan
  0 siblings, 1 reply; 6+ messages in thread
From: H. Peter Anvin @ 2009-08-03 18:39 UTC (permalink / raw)
  To: Ozan Çağlayan
  Cc: mingo, paulus, linux-kernel, tglx, linux-tip-commits

On 08/03/2009 10:40 AM, Ozan Çağlayan wrote:
> 
> MacBookPro5,1 has also this problem. I booted with reboot=pci on
> 2.6.30.4 and now it rebooted without problem.
> That would be nice if you could add another quirk entry for it:
> 
> System Information
>         Manufacturer: Apple Inc.
>         Product Name: MacBookPro5,1
> 

Please write, test, and send a patch to do this.

	-hpa

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [tip:x86/urgent] x86: Add quirk to make Apple MacBook5,2 use reboot=pci
  2009-08-03 18:39     ` H. Peter Anvin
@ 2009-08-03 20:17       ` Ozan Çağlayan
  0 siblings, 0 replies; 6+ messages in thread
From: Ozan Çağlayan @ 2009-08-03 20:17 UTC (permalink / raw)
  To: H. Peter Anvin; +Cc: mingo, paulus, linux-kernel, tglx, linux-tip-commits

H. Peter Anvin wrote:
> On 08/03/2009 10:40 AM, Ozan Çağlayan wrote:
>   
>> MacBookPro5,1 has also this problem. I booted with reboot=pci on
>> 2.6.30.4 and now it rebooted without problem.
>> That would be nice if you could add another quirk entry for it:
>>
>> System Information
>>         Manufacturer: Apple Inc.
>>         Product Name: MacBookPro5,1
>>
>>     
>
> Please write, test, and send a patch to do this.
>   
Okay will do that way, thanks for your fast reply.

^ permalink raw reply	[flat|nested] 6+ messages in thread

* [tip:x86/urgent] x86: Add quirk to make Apple MacBook5,2 use reboot=pci
  2009-08-03 12:47 [PATCH] x86: Add quirk to make Apple MacBook5,2 use reboot=pci Paul Mackerras
  2009-08-03 17:12 ` [tip:x86/urgent] " tip-bot for Paul Mackerras
@ 2009-08-03 21:47 ` tip-bot for Paul Mackerras
  1 sibling, 0 replies; 6+ messages in thread
From: tip-bot for Paul Mackerras @ 2009-08-03 21:47 UTC (permalink / raw)
  To: linux-tip-commits; +Cc: linux-kernel, paulus, hpa, mingo, tglx

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);
 
 #endif /* CONFIG_X86_32 */
 
+/*
+ * Apple MacBook5,2 (2009 MacBook) needs reboot=p
+ */
+static int __init set_pci_reboot(const struct dmi_system_id *d)
+{
+	if (reboot_type != BOOT_CF9) {
+		reboot_type = BOOT_CF9;
+		printk(KERN_INFO "%s series board detected. "
+		       "Selecting PCI-method for reboots.\n", d->ident);
+	}
+	return 0;
+}
+
+static struct dmi_system_id __initdata pci_reboot_dmi_table[] = {
+	{	/* Handle problems with rebooting on Apple MacBook5,2 */
+		.callback = set_pci_reboot,
+		.ident = "Apple MacBook",
+		.matches = {
+			DMI_MATCH(DMI_SYS_VENDOR, "Apple Inc."),
+			DMI_MATCH(DMI_PRODUCT_NAME, "MacBook5,2"),
+		},
+	},
+	{ }
+};
+
+static int __init pci_reboot_init(void)
+{
+	dmi_check_system(pci_reboot_dmi_table);
+	return 0;
+}
+core_initcall(pci_reboot_init);
+
 static inline void kb_wait(void)
 {
 	int i;

^ permalink raw reply related	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2009-08-03 21:47 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-08-03 12:47 [PATCH] x86: Add quirk to make Apple MacBook5,2 use reboot=pci Paul Mackerras
2009-08-03 17:12 ` [tip:x86/urgent] " tip-bot for Paul Mackerras
2009-08-03 17:40   ` Ozan Çağlayan
2009-08-03 18:39     ` H. Peter Anvin
2009-08-03 20:17       ` Ozan Çağlayan
2009-08-03 21:47 ` tip-bot for Paul Mackerras

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.