* [patch 3/3] pata_atiixp: Don't disable
@ 2008-05-02 20:37 akpm
2008-05-02 21:40 ` Alan Cox
0 siblings, 1 reply; 2+ messages in thread
From: akpm @ 2008-05-02 20:37 UTC (permalink / raw)
To: jeff; +Cc: linux-ide, akpm, alan, alan, davidg
From: Alan Cox <alan@lxorguk.ukuu.org.uk>
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>
---
drivers/ata/ata_generic.c | 6 ++++++
drivers/ata/pata_acpi.c | 6 ++++++
drivers/ata/pata_atiixp.c | 3 ---
3 files changed, 12 insertions(+), 3 deletions(-)
diff -puN drivers/ata/ata_generic.c~pata_atiixp-dont-disable drivers/ata/ata_generic.c
--- a/drivers/ata/ata_generic.c~pata_atiixp-dont-disable
+++ a/drivers/ata/ata_generic.c
@@ -152,6 +152,12 @@ static int ata_generic_init_one(struct p
if (dev->vendor == PCI_VENDOR_ID_AL)
ata_pci_bmdma_clear_simplex(dev);
+ if (dev->vendor == PCI_VENDOR_ID_ATI) {
+ int rc = pcim_enable_device(pdev);
+ if (rc < 0)
+ return rc;
+ pcim_pin_device(pdev);
+ }
return ata_pci_sff_init_one(dev, ppi, &generic_sht, NULL);
}
diff -puN drivers/ata/pata_acpi.c~pata_atiixp-dont-disable drivers/ata/pata_acpi.c
--- a/drivers/ata/pata_acpi.c~pata_atiixp-dont-disable
+++ a/drivers/ata/pata_acpi.c
@@ -259,6 +259,12 @@ static int pacpi_init_one (struct pci_de
.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_sff_init_one(pdev, ppi, &pacpi_sht, NULL);
}
diff -puN drivers/ata/pata_atiixp.c~pata_atiixp-dont-disable drivers/ata/pata_atiixp.c
--- a/drivers/ata/pata_atiixp.c~pata_atiixp-dont-disable
+++ a/drivers/ata/pata_atiixp.c
@@ -243,9 +243,6 @@ static int atiixp_init_one(struct pci_de
.port_ops = &atiixp_port_ops
};
const struct ata_port_info *ppi[] = { &info, NULL };
- /* Some of the quirk reconfiguration messes up the simplex flag, so
- clear it again */
- ata_pci_bmdma_clear_simplex(dev);
return ata_pci_sff_init_one(dev, ppi, &atiixp_sht, NULL);
}
_
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: [patch 3/3] pata_atiixp: Don't disable
2008-05-02 20:37 [patch 3/3] pata_atiixp: Don't disable akpm
@ 2008-05-02 21:40 ` Alan Cox
0 siblings, 0 replies; 2+ messages in thread
From: Alan Cox @ 2008-05-02 21:40 UTC (permalink / raw)
To: akpm; +Cc: jeff, linux-ide, alan, alan, davidg
> diff -puN drivers/ata/pata_atiixp.c~pata_atiixp-dont-disable drivers/ata/pata_atiixp.c
> --- a/drivers/ata/pata_atiixp.c~pata_atiixp-dont-disable
> +++ a/drivers/ata/pata_atiixp.c
> @@ -243,9 +243,6 @@ static int atiixp_init_one(struct pci_de
> .port_ops = &atiixp_port_ops
> };
> const struct ata_port_info *ppi[] = { &info, NULL };
> - /* Some of the quirk reconfiguration messes up the simplex flag, so
> - clear it again */
> - ata_pci_bmdma_clear_simplex(dev);
> return ata_pci_sff_init_one(dev, ppi, &atiixp_sht, NULL);
And this segment can be dropped as the original patch that adds it isn't
needed
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2008-05-02 21:41 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-05-02 20:37 [patch 3/3] pata_atiixp: Don't disable akpm
2008-05-02 21:40 ` Alan Cox
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).