Jesse Keating 7a32965
From 2a79554c864ac58fa2ad982f0fcee2cc2aa33eb5 Mon Sep 17 00:00:00 2001
Jesse Keating 7a32965
From: Bastien Nocera <hadess@hadess.net>
Jesse Keating 7a32965
Date: Thu, 20 May 2010 10:30:31 -0400
Jesse Keating 7a32965
Subject: Disable i8042 checks on Intel Apple Macs
Jesse Keating 7a32965
Jesse Keating 7a32965
As those computers never had any i8042 controllers, and the
Jesse Keating 7a32965
current lookup code could potentially lock up/hang/wait for
Jesse Keating 7a32965
timeout for long periods of time.
Jesse Keating 7a32965
Jesse Keating 7a32965
Fixes intermittent hangs on boot on a MacbookAir1,1
Jesse Keating 7a32965
Jesse Keating 7a32965
Signed-off-by: Bastien Nocera <hadess@hadess.net>
Jesse Keating 7a32965
---
Jesse Keating 7a32965
 drivers/input/serio/i8042.c |   22 ++++++++++++++++++++++
Jesse Keating 7a32965
 1 files changed, 22 insertions(+), 0 deletions(-)
Jesse Keating 7a32965
Jesse Keating 7a32965
diff --git a/drivers/input/serio/i8042.c b/drivers/input/serio/i8042.c
Jesse Keating 7a32965
index 6440a8f..4d7cf98 100644
Jesse Keating 7a32965
--- a/drivers/input/serio/i8042.c
Jesse Keating 7a32965
+++ b/drivers/input/serio/i8042.c
Jesse Keating 7a32965
@@ -1451,6 +1451,22 @@ static struct platform_driver i8042_driver = {
Jesse Keating 7a32965
 	.shutdown	= i8042_shutdown,
Jesse Keating 7a32965
 };
Jesse Keating 7a32965
 
Jesse Keating 7a32965
+#ifdef CONFIG_DMI
Jesse Keating 7a32965
+static struct dmi_system_id __initdata dmi_system_table[] = {
Jesse Keating 7a32965
+	{
Jesse Keating 7a32965
+		.matches = {
Jesse Keating 7a32965
+			DMI_MATCH(DMI_BIOS_VENDOR, "Apple Computer, Inc.")
Jesse Keating 7a32965
+		},
Jesse Keating 7a32965
+	},
Jesse Keating 7a32965
+	{
Jesse Keating 7a32965
+		.matches = {
Jesse Keating 7a32965
+			DMI_MATCH(DMI_BIOS_VENDOR, "Apple Inc.")
Jesse Keating 7a32965
+		},
Jesse Keating 7a32965
+	},
Jesse Keating 7a32965
+	{}
Jesse Keating 7a32965
+};
Jesse Keating 7a32965
+#endif /*CONFIG_DMI*/
Jesse Keating 7a32965
+
Jesse Keating 7a32965
 static int __init i8042_init(void)
Jesse Keating 7a32965
 {
Jesse Keating 7a32965
 	struct platform_device *pdev;
Jesse Keating 7a32965
@@ -1458,6 +1474,12 @@ static int __init i8042_init(void)
Jesse Keating 7a32965
 
Jesse Keating 7a32965
 	dbg_init();
Jesse Keating 7a32965
 
Jesse Keating 7a32965
+#ifdef CONFIG_DMI
Jesse Keating 7a32965
+	/* Intel Apple Macs never have an i8042 controller */
Jesse Keating 7a32965
+	if (dmi_check_system(dmi_system_table) > 0)
Jesse Keating 7a32965
+		return -ENODEV;
Jesse Keating 7a32965
+#endif /*CONFIG_DMI*/
Jesse Keating 7a32965
+
Jesse Keating 7a32965
 	err = i8042_platform_init();
Jesse Keating 7a32965
 	if (err)
Jesse Keating 7a32965
 		return err;
Jesse Keating 7a32965
-- 
Jesse Keating 7a32965
1.7.0.1
Jesse Keating 7a32965