Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 130272
b: refs/heads/master
c: e57db7b
h: refs/heads/master
v: v3
  • Loading branch information
Rafael J. Wysocki authored and Jeff Garzik committed Jan 27, 2009
1 parent 4093be6 commit bc86d72
Show file tree
Hide file tree
Showing 2 changed files with 36 additions and 2 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 1fd684346d41f6be2487c161f60d03a7feb68911
refs/heads/master: e57db7bde7bff95ae812736ca00c73bd5271455b
36 changes: 35 additions & 1 deletion trunk/drivers/ata/sata_sil.c
Original file line number Diff line number Diff line change
Expand Up @@ -695,11 +695,38 @@ static void sil_init_controller(struct ata_host *host)
}
}

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;
Expand All @@ -713,6 +740,13 @@ static int sil_init_one(struct pci_dev *pdev, const struct pci_device_id *ent)
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;
Expand Down

0 comments on commit bc86d72

Please sign in to comment.