aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/ata/ahci.c
diff options
context:
space:
mode:
authorRafael J. Wysocki <rjw@sisk.pl>2009-01-19 14:57:36 -0500
committerJeff Garzik <jgarzik@redhat.com>2009-01-27 02:15:51 -0500
commit1fd684346d41f6be2487c161f60d03a7feb68911 (patch)
tree95d388b9965850cb5db8264603b6b1bba97ee37a /drivers/ata/ahci.c
parent2a6e58d2731dcc05dafa7f976d935e0f0627fcd7 (diff)
SATA AHCI: Blacklist system that spins off disks during ACPI power off
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 nx6310 that uses the AHCI driver. Signed-off-by: Rafael J. Wysocki <rjw@sisk.pl> Signed-off-by: Jeff Garzik <jgarzik@redhat.com>
Diffstat (limited to 'drivers/ata/ahci.c')
-rw-r--r--drivers/ata/ahci.c32
1 files changed, 32 insertions, 0 deletions
diff --git a/drivers/ata/ahci.c b/drivers/ata/ahci.c
index 96039671e3b9..77bba4c083cb 100644
--- a/drivers/ata/ahci.c
+++ b/drivers/ata/ahci.c
@@ -2548,6 +2548,32 @@ static void ahci_p5wdh_workaround(struct ata_host *host)
2548 } 2548 }
2549} 2549}
2550 2550
2551static bool ahci_broken_system_poweroff(struct pci_dev *pdev)
2552{
2553 static const struct dmi_system_id broken_systems[] = {
2554 {
2555 .ident = "HP Compaq nx6310",
2556 .matches = {
2557 DMI_MATCH(DMI_SYS_VENDOR, "Hewlett-Packard"),
2558 DMI_MATCH(DMI_PRODUCT_NAME, "HP Compaq nx6310"),
2559 },
2560 /* PCI slot number of the controller */
2561 .driver_data = (void *)0x1FUL,
2562 },
2563
2564 { } /* terminate list */
2565 };
2566 const struct dmi_system_id *dmi = dmi_first_match(broken_systems);
2567
2568 if (dmi) {
2569 unsigned long slot = (unsigned long)dmi->driver_data;
2570 /* apply the quirk only to on-board controllers */
2571 return slot == PCI_SLOT(pdev->devfn);
2572 }
2573
2574 return false;
2575}
2576
2551static int ahci_init_one(struct pci_dev *pdev, const struct pci_device_id *ent) 2577static int ahci_init_one(struct pci_dev *pdev, const struct pci_device_id *ent)
2552{ 2578{
2553 static int printed_version; 2579 static int printed_version;
@@ -2647,6 +2673,12 @@ static int ahci_init_one(struct pci_dev *pdev, const struct pci_device_id *ent)
2647 } 2673 }
2648 } 2674 }
2649 2675
2676 if (ahci_broken_system_poweroff(pdev)) {
2677 pi.flags |= ATA_FLAG_NO_POWEROFF_SPINDOWN;
2678 dev_info(&pdev->dev,
2679 "quirky BIOS, skipping spindown on poweroff\n");
2680 }
2681
2650 /* CAP.NP sometimes indicate the index of the last enabled 2682 /* CAP.NP sometimes indicate the index of the last enabled
2651 * port, at other times, that of the last possible port, so 2683 * port, at other times, that of the last possible port, so
2652 * determining the maximum port number requires looking at 2684 * determining the maximum port number requires looking at