]>
Commit | Line | Data |
---|---|---|
00e5a55c BS |
1 | From 6cb195762fb4acc79ab5153452be5d44a40419dc Mon Sep 17 00:00:00 2001 |
2 | From: Rafael J. Wysocki <rjw@sisk.pl> | |
3 | Date: Mon, 3 Nov 2008 19:01:07 +0900 | |
4 | Subject: [PATCH] SATA PIIX: Blacklist system that spins off disks during ACPI power off | |
5 | References: bnc#441721 | |
6 | ||
7 | Some notebooks from HP have the problem that their BIOSes attempt to | |
8 | spin down hard drives before entering ACPI system states S4 and S5. | |
9 | This leads to a yo-yo effect during system power-off shutdown and the | |
10 | last phase of hibernation when the disk is first spun down by the | |
11 | kernel and then almost immediately turned on and off by the BIOS. | |
12 | This, in turn, may result in shortening the disk's life times. | |
13 | ||
14 | To prevent this from happening we can blacklist the affected systems | |
15 | using DMI information. | |
16 | ||
17 | Blacklist HP 2510p that uses the ata_piix driver. | |
18 | ||
19 | Signed-off-by: Rafael J. Wysocki <rjw@sisk.pl> | |
20 | Signed-off-by: Tejun Heo <tj@kernel.org> | |
21 | Signed-off-by: Jeff Garzik <jgarzik@redhat.com> | |
22 | Signed-off-by: Tejun Heo <teheo@suse.de> | |
23 | --- | |
24 | drivers/ata/ata_piix.c | 34 ++++++++++++++++++++++++++++++++++ | |
25 | 1 file changed, 34 insertions(+) | |
26 | ||
27 | --- a/drivers/ata/ata_piix.c | |
28 | +++ b/drivers/ata/ata_piix.c | |
29 | @@ -1409,6 +1409,32 @@ static void piix_iocfg_bit18_quirk(struc | |
30 | } | |
31 | } | |
32 | ||
33 | +static bool piix_broken_system_poweroff(struct pci_dev *pdev) | |
34 | +{ | |
35 | + static const struct dmi_system_id broken_systems[] = { | |
36 | + { | |
37 | + .ident = "HP Compaq 2510p", | |
38 | + .matches = { | |
39 | + DMI_MATCH(DMI_SYS_VENDOR, "Hewlett-Packard"), | |
40 | + DMI_MATCH(DMI_PRODUCT_NAME, "HP Compaq 2510p"), | |
41 | + }, | |
42 | + /* PCI slot number of the controller */ | |
43 | + .driver_data = (void *)0x1FUL, | |
44 | + }, | |
45 | + | |
46 | + { } /* terminate list */ | |
47 | + }; | |
48 | + const struct dmi_system_id *dmi = dmi_first_match(broken_systems); | |
49 | + | |
50 | + if (dmi) { | |
51 | + unsigned long slot = (unsigned long)dmi->driver_data; | |
52 | + /* apply the quirk only to on-board controllers */ | |
53 | + return slot == PCI_SLOT(pdev->devfn); | |
54 | + } | |
55 | + | |
56 | + return false; | |
57 | +} | |
58 | + | |
59 | /** | |
60 | * piix_init_one - Register PIIX ATA PCI device with kernel services | |
61 | * @pdev: PCI device to register | |
62 | @@ -1444,6 +1470,14 @@ static int __devinit piix_init_one(struc | |
63 | if (!in_module_init) | |
64 | return -ENODEV; | |
65 | ||
66 | + if (piix_broken_system_poweroff(pdev)) { | |
67 | + piix_port_info[ent->driver_data].flags |= | |
68 | + ATA_FLAG_NO_POWEROFF_SPINDOWN | | |
69 | + ATA_FLAG_NO_HIBERNATE_SPINDOWN; | |
70 | + dev_info(&pdev->dev, "quirky BIOS, skipping spindown " | |
71 | + "on poweroff and hibernation\n"); | |
72 | + } | |
73 | + | |
74 | port_info[0] = piix_port_info[ent->driver_data]; | |
75 | port_info[1] = piix_port_info[ent->driver_data]; | |
76 |