]> git.ipfire.org Git - people/teissler/ipfire-2.x.git/blobdiff - src/patches/suse-2.6.27.25/patches.drivers/libata-sata_sil-blacklist-double-spin-off
Updated xen patches taken from suse.
[people/teissler/ipfire-2.x.git] / src / patches / suse-2.6.27.25 / patches.drivers / libata-sata_sil-blacklist-double-spin-off
diff --git a/src/patches/suse-2.6.27.25/patches.drivers/libata-sata_sil-blacklist-double-spin-off b/src/patches/suse-2.6.27.25/patches.drivers/libata-sata_sil-blacklist-double-spin-off
new file mode 100644 (file)
index 0000000..3e9add7
--- /dev/null
@@ -0,0 +1,84 @@
+From 285ddd34af077acb9148bba2569947c7af41b8ce Mon Sep 17 00:00:00 2001
+From: Rafael J. Wysocki <rjw@sisk.pl>
+Date: Mon, 3 Nov 2008 19:01:06 +0900
+Subject: [PATCH] SATA Sil: Blacklist system that spins off disks during ACPI power off
+References: bnc#441721
+
+Some notebooks from HP have the problem that their BIOSes attempt to
+spin down hard drives before entering ACPI system states S4 and S5.
+This leads to a yo-yo effect during system power-off shutdown and the
+last phase of hibernation when the disk is first spun down by the
+kernel and then almost immediately turned on and off by the BIOS.
+This, in turn, may result in shortening the disk's life times.
+
+To prevent this from happening we can blacklist the affected systems
+using DMI information.
+
+Blacklist HP nx6325 that uses the sata_sil driver.
+
+Signed-off-by: Rafael J. Wysocki <rjw@sisk.pl>
+Signed-off-by: Tejun Heo <tj@kernel.org>
+Signed-off-by: Jeff Garzik <jgarzik@redhat.com>
+Signed-off-by: Tejun Heo <teheo@suse.de>
+---
+ drivers/ata/sata_sil.c |   36 +++++++++++++++++++++++++++++++++++-
+ 1 file changed, 35 insertions(+), 1 deletion(-)
+
+Index: linux-2.6.27/drivers/ata/sata_sil.c
+===================================================================
+--- linux-2.6.27.orig/drivers/ata/sata_sil.c
++++ linux-2.6.27/drivers/ata/sata_sil.c
+@@ -603,11 +603,38 @@ static void sil_init_controller(struct a
+       }
+ }
++static bool sil_broken_system_poweroff(struct pci_dev *pdev)
++{
++      static const struct dmi_system_id broken_systems[] = {
++              {
++                      .ident = "HP Compaq nx6325",
++                      .matches = {
++                              DMI_MATCH(DMI_SYS_VENDOR, "Hewlett-Packard"),
++                              DMI_MATCH(DMI_PRODUCT_NAME, "HP Compaq nx6325"),
++                      },
++                      /* PCI slot number of the controller */
++                      .driver_data = (void *)0x12UL,
++              },
++
++              { }     /* terminate list */
++      };
++      const struct dmi_system_id *dmi = dmi_first_match(broken_systems);
++
++      if (dmi) {
++              unsigned long slot = (unsigned long)dmi->driver_data;
++              /* apply the quirk only to on-board controllers */
++              return slot == PCI_SLOT(pdev->devfn);
++      }
++
++      return false;
++}
++
+ static int sil_init_one(struct pci_dev *pdev, const struct pci_device_id *ent)
+ {
+       static int printed_version;
+       int board_id = ent->driver_data;
+-      const struct ata_port_info *ppi[] = { &sil_port_info[board_id], NULL };
++      struct ata_port_info pi = sil_port_info[board_id];
++      const struct ata_port_info *ppi[] = { &pi, NULL };
+       struct ata_host *host;
+       void __iomem *mmio_base;
+       int n_ports, rc;
+@@ -621,6 +648,13 @@ static int sil_init_one(struct pci_dev *
+       if (board_id == sil_3114)
+               n_ports = 4;
++      if (sil_broken_system_poweroff(pdev)) {
++              pi.flags |= ATA_FLAG_NO_POWEROFF_SPINDOWN |
++                                      ATA_FLAG_NO_HIBERNATE_SPINDOWN;
++              dev_info(&pdev->dev, "quirky BIOS, skipping spindown "
++                              "on poweroff and hibernation\n");
++      }
++
+       host = ata_host_alloc_pinfo(&pdev->dev, ppi, n_ports);
+       if (!host)
+               return -ENOMEM;