- ich7-sci_en-quirk-required-for-macbook.patch removed from -mm tree

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



The patch titled

     ICH7 SCI_EN quirk required for Macbook

has been removed from the -mm tree.  Its filename is

     ich7-sci_en-quirk-required-for-macbook.patch

This patch was dropped because Linus did the same thing, only for all machines

------------------------------------------------------
Subject: ICH7 SCI_EN quirk required for Macbook
From: Ryan Lortie <desrt@xxxxxxxx>


I've been working on getting my Macbook to sleep and wake up properly
lately.  This email directly follows my earlier posting to the linux-acpi
list on the same subject ::

http://marc.theaimsgroup.com/?l=3Dlinux-acpi&m=3D114957637501557&w=3D2

The problem is that on resume the SCI_EN bit of the hardware power
management control register is not set.  This causes an endless stream of
unacknowledged IRQ9s.  This causes the kernel to ignore IRQ9 and prevents
ACPI from working.

Fixing the problem is as simple as re-enabling the SCI_EN bit early in the
resume process (before IRQs are enabled).

To this end, I've written a patch that enables the SCI_EN bit soon after
resume on machines that need it (I do it for all ICH7-based Intel Apple
machines since an email from Frederic Riss tells me that he has similar
problems with his Mac Mini and my hack fixed it for him too).


This patch enables the SCI_EN bit on return from sleep on Intel-based
Apple machines with the ICH7 chipset (where for some reason this bit
gets disabled by sleep).  This is required to prevent an endless stream
of unacknowledged IRQ9s.

Signed-off-by: Ryan Lortie <desrt@xxxxxxxx>
Cc: Matthew Garrett <mjg59@xxxxxxxxxxxxx>
Cc: Ben Collins <bcollins@xxxxxxxxxx>
Cc: Frederic Riss <frederic.riss@xxxxxxxxx>
Cc: "Brown, Len" <len.brown@xxxxxxxxx>
Cc: "Yu, Luming" <luming.yu@xxxxxxxxx>
Signed-off-by: Andrew Morton <akpm@xxxxxxxx>
---

 drivers/acpi/sleep/main.c |   31 +++++++++++++++++++++++++++++++
 1 file changed, 31 insertions(+)

diff -puN drivers/acpi/sleep/main.c~ich7-sci_en-quirk-required-for-macbook drivers/acpi/sleep/main.c
--- a/drivers/acpi/sleep/main.c~ich7-sci_en-quirk-required-for-macbook
+++ a/drivers/acpi/sleep/main.c
@@ -17,6 +17,7 @@
 #include <linux/suspend.h>
 #include <acpi/acpi_bus.h>
 #include <acpi/acpi_drivers.h>
+#include <linux/pci.h>
 #include "sleep.h"
 
 u8 sleep_states[ACPI_S_STATE_COUNT];
@@ -34,6 +35,7 @@ static u32 acpi_suspend_states[] = {
 };
 
 static int init_8259A_after_S1;
+static int ich7_sci_en_quirk_enabled;
 
 /**
  *	acpi_pm_prepare - Do preliminary suspend work.
@@ -92,6 +94,10 @@ static int acpi_pm_enter(suspend_state_t
 
 	case PM_SUSPEND_MEM:
 		do_suspend_lowlevel();
+
+		if (ich7_sci_en_quirk_enabled)
+			acpi_set_register(ACPI_BITREG_SCI_ENABLE, 1,
+					  ACPI_MTX_DO_NOT_LOCK);
 		break;
 
 	case PM_SUSPEND_DISK:
@@ -191,12 +197,37 @@ static int __init init_ints_after_s1(str
 	return 0;
 }
 
+/*
+ * Apple Macbook comes back from sleep with the SCI_EN bit disabled
+ * causing a flood of unacknowledged IRQ9s.  We need to set SCI_EN
+ * as soon as we come back.
+ */
+static int __init init_ich7_sci_en_quirk(struct dmi_system_id *d)
+{
+	/* Ensure that we have an ICH7 (this is subdevice :1f.0) */
+	if (!pci_find_device(PCI_VENDOR_ID_INTEL,
+				PCI_DEVICE_ID_INTEL_ICH7_1, NULL))
+		return 0;
+
+	/* Intel-based Apple with ICH7 chipset.  Enable the quirk. */
+	printk(KERN_WARNING "%s detected (ICH7 SCI_EN quirk enabled)\n",
+		d->ident);
+	ich7_sci_en_quirk_enabled = 1;
+
+	return 0;
+}
+
 static struct dmi_system_id __initdata acpisleep_dmi_table[] = {
 	{
 	 .callback = init_ints_after_s1,
 	 .ident = "Toshiba Satellite 4030cdt",
 	 .matches = {DMI_MATCH(DMI_PRODUCT_NAME, "S4030CDT/4.3"),},
 	 },
+	{
+	 .callback = init_ich7_sci_en_quirk,
+	 .ident = "Intel Apple",
+	 .matches = {DMI_MATCH(DMI_SYS_VENDOR, "Apple Computer"),},
+	 },
 	{},
 };
 
_

Patches currently in -mm which might be from desrt@xxxxxxxx are

ich7-sci_en-quirk-required-for-macbook.patch

-
To unsubscribe from this list: send the line "unsubscribe mm-commits" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Kernel Newbies FAQ]     [Kernel Archive]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [Bugtraq]     [Photo]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]

  Powered by Linux