From 4093be61ebe6a15f92279ffdf3811cc04a77d887 Mon Sep 17 00:00:00 2001 From: "Rafael J. Wysocki" Date: Mon, 19 Jan 2009 20:57:36 +0100 Subject: [PATCH] --- yaml --- r: 130271 b: refs/heads/master c: 1fd684346d41f6be2487c161f60d03a7feb68911 h: refs/heads/master i: 130269: db55748991bc609d941da6dc4f8c87a750c59a0e 130267: f5484536d3d699db731d49a92712df7c8f0607ca 130263: fe6736cb561741c227d0ba01e2c7d35475b5bcfe 130255: 924146e7dd708c0cfa9753a61494ea95e5951efc 130239: a4471477e837b1b1c47a502bc7c7a036fb47b7c8 v: v3 --- [refs] | 2 +- trunk/drivers/ata/ahci.c | 32 ++++++++++++++++++++++++++++++++ 2 files changed, 33 insertions(+), 1 deletion(-) diff --git a/[refs] b/[refs] index aa0fbb820ac9..b9fa4f242e94 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: 2a6e58d2731dcc05dafa7f976d935e0f0627fcd7 +refs/heads/master: 1fd684346d41f6be2487c161f60d03a7feb68911 diff --git a/trunk/drivers/ata/ahci.c b/trunk/drivers/ata/ahci.c index 96039671e3b9..77bba4c083cb 100644 --- a/trunk/drivers/ata/ahci.c +++ b/trunk/drivers/ata/ahci.c @@ -2548,6 +2548,32 @@ static void ahci_p5wdh_workaround(struct ata_host *host) } } +static bool ahci_broken_system_poweroff(struct pci_dev *pdev) +{ + static const struct dmi_system_id broken_systems[] = { + { + .ident = "HP Compaq nx6310", + .matches = { + DMI_MATCH(DMI_SYS_VENDOR, "Hewlett-Packard"), + DMI_MATCH(DMI_PRODUCT_NAME, "HP Compaq nx6310"), + }, + /* PCI slot number of the controller */ + .driver_data = (void *)0x1FUL, + }, + + { } /* 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 ahci_init_one(struct pci_dev *pdev, const struct pci_device_id *ent) { static int printed_version; @@ -2647,6 +2673,12 @@ static int ahci_init_one(struct pci_dev *pdev, const struct pci_device_id *ent) } } + if (ahci_broken_system_poweroff(pdev)) { + pi.flags |= ATA_FLAG_NO_POWEROFF_SPINDOWN; + dev_info(&pdev->dev, + "quirky BIOS, skipping spindown on poweroff\n"); + } + /* CAP.NP sometimes indicate the index of the last enabled * port, at other times, that of the last possible port, so * determining the maximum port number requires looking at