]> git.hungrycats.org Git - linux/commitdiff
pata_atiixp: Don't disable
authorAlan Cox <alan@lxorguk.ukuu.org.uk>
Fri, 18 Jul 2008 23:13:02 +0000 (19:13 -0400)
committerGreg Kroah-Hartman <gregkh@suse.de>
Fri, 1 Aug 2008 18:50:44 +0000 (11:50 -0700)
Commit 05177f178efe1459d2d0ac05430027ba201889a4 upstream

pata_atiixp: Don't disable

A couple of distributions (Fedora, Ubuntu) were having weird problems with the
ATI IXP series PATA controllers being reported as simplex.  At the heart of
the problem is that both distros ignored the recommendations to load pata_acpi
and ata_generic *AFTER* specific host drivers.

The underlying cause however is that if you D3 and then D0 an ATI IXP it
helpfully throws away some configuration and won't let you rewrite it.

Add checks to ata_generic and pata_acpi to pin ATIIXP devices.  Possibly the
real answer here is to quirk them and pin them, but right now we can't do that
before they've been pcim_enable()'d by a driver.

I'm indebted to David Gero for this.  His bug report not only reported the
problem but identified the cause correctly and he had tested the right values
to prove what was going on

[If you backport this for 2.6.24 you will need to pull in the 2.6.25
removal of the bogus WARN_ON() in pcim_enagle]

Signed-off-by: Alan Cox <alan@redhat.com>
Tested-by: David Gero <davidg@havidave.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Jeff Garzik <jgarzik@redhat.com>
drivers/ata/ata_generic.c
drivers/ata/pata_acpi.c

index 20534202fc79b28c5e93f944fe3224a460016318..a3ede491f30ab00b2378c1c2037b7d472e2b376b 100644 (file)
@@ -193,6 +193,12 @@ static int ata_generic_init_one(struct pci_dev *dev, const struct pci_device_id
        if (dev->vendor == PCI_VENDOR_ID_AL)
                ata_pci_clear_simplex(dev);
 
+       if (dev->vendor == PCI_VENDOR_ID_ATI) {
+               int rc = pcim_enable_device(dev);
+               if (rc < 0)
+                       return rc;
+               pcim_pin_device(dev);
+       }
        return ata_pci_init_one(dev, ppi);
 }
 
index bdc3b9d7395c9ff0481dee0aa5a27d7d039e2b17..ea354a5b907c2da2eba03d738996c7fe2883cb6d 100644 (file)
@@ -314,6 +314,12 @@ static int pacpi_init_one (struct pci_dev *pdev, const struct pci_device_id *id)
                .port_ops       = &pacpi_ops,
        };
        const struct ata_port_info *ppi[] = { &info, NULL };
+       if (pdev->vendor == PCI_VENDOR_ID_ATI) {
+               int rc = pcim_enable_device(pdev);
+               if (rc < 0)
+                       return rc;
+               pcim_pin_device(pdev);
+       }
        return ata_pci_init_one(pdev, ppi);
 }