diff options
author | Alan Cox <alan@lxorguk.ukuu.org.uk> | 2008-05-02 18:13:39 -0400 |
---|---|---|
committer | Jeff Garzik <jgarzik@redhat.com> | 2008-05-06 11:43:44 -0400 |
commit | 05177f178efe1459d2d0ac05430027ba201889a4 (patch) | |
tree | 5102edb75980d79c352965f451ee91b8410ac4e5 | |
parent | 22bfc6d5e19b72d50535ce32fd6dee2ce2e75775 (diff) |
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>
-rw-r--r-- | drivers/ata/ata_generic.c | 6 | ||||
-rw-r--r-- | drivers/ata/pata_acpi.c | 6 |
2 files changed, 12 insertions, 0 deletions
diff --git a/drivers/ata/ata_generic.c b/drivers/ata/ata_generic.c index 47aeccd52fa9..75a406f5e694 100644 --- a/drivers/ata/ata_generic.c +++ b/drivers/ata/ata_generic.c | |||
@@ -152,6 +152,12 @@ static int ata_generic_init_one(struct pci_dev *dev, const struct pci_device_id | |||
152 | if (dev->vendor == PCI_VENDOR_ID_AL) | 152 | if (dev->vendor == PCI_VENDOR_ID_AL) |
153 | ata_pci_bmdma_clear_simplex(dev); | 153 | ata_pci_bmdma_clear_simplex(dev); |
154 | 154 | ||
155 | if (dev->vendor == PCI_VENDOR_ID_ATI) { | ||
156 | int rc = pcim_enable_device(dev); | ||
157 | if (rc < 0) | ||
158 | return rc; | ||
159 | pcim_pin_device(dev); | ||
160 | } | ||
155 | return ata_pci_sff_init_one(dev, ppi, &generic_sht, NULL); | 161 | return ata_pci_sff_init_one(dev, ppi, &generic_sht, NULL); |
156 | } | 162 | } |
157 | 163 | ||
diff --git a/drivers/ata/pata_acpi.c b/drivers/ata/pata_acpi.c index c5f91e629945..fbe605711554 100644 --- a/drivers/ata/pata_acpi.c +++ b/drivers/ata/pata_acpi.c | |||
@@ -259,6 +259,12 @@ static int pacpi_init_one (struct pci_dev *pdev, const struct pci_device_id *id) | |||
259 | .port_ops = &pacpi_ops, | 259 | .port_ops = &pacpi_ops, |
260 | }; | 260 | }; |
261 | const struct ata_port_info *ppi[] = { &info, NULL }; | 261 | const struct ata_port_info *ppi[] = { &info, NULL }; |
262 | if (pdev->vendor == PCI_VENDOR_ID_ATI) { | ||
263 | int rc = pcim_enable_device(pdev); | ||
264 | if (rc < 0) | ||
265 | return rc; | ||
266 | pcim_pin_device(pdev); | ||
267 | } | ||
262 | return ata_pci_sff_init_one(pdev, ppi, &pacpi_sht, NULL); | 268 | return ata_pci_sff_init_one(pdev, ppi, &pacpi_sht, NULL); |
263 | } | 269 | } |
264 | 270 | ||