aboutsummaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorAlan Cox <alan@lxorguk.ukuu.org.uk>2006-09-12 12:14:03 -0400
committerJeff Garzik <jeff@garzik.org>2006-09-12 12:01:46 -0400
commit76ff3c6e3b389a5a7692811dd456e0ff58340cac (patch)
treea004a3ba02a2182f64803d9fdcf46846cd32162a /drivers
parentaf323a2fb508b0fa1c1fa91cbc6ec86fb0879c07 (diff)
[PATCH] pata_amd: Check enable bits on Nvidia
A couple of people reported long delays on probe with the newer kernels and Nvidia PATA. This turned out to be because the Nvidia path forgot to check the enable bits so probed empty ports. Signed-off-by: Alan Cox <alan@redhat.com> Signed-off-by: Jeff Garzik <jeff@garzik.org>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/ata/pata_amd.c13
1 files changed, 12 insertions, 1 deletions
diff --git a/drivers/ata/pata_amd.c b/drivers/ata/pata_amd.c
index b3f60fdb02d0..3293cf9a7eb5 100644
--- a/drivers/ata/pata_amd.c
+++ b/drivers/ata/pata_amd.c
@@ -25,7 +25,7 @@
25#include <linux/libata.h> 25#include <linux/libata.h>
26 26
27#define DRV_NAME "pata_amd" 27#define DRV_NAME "pata_amd"
28#define DRV_VERSION "0.2.2" 28#define DRV_VERSION "0.2.3"
29 29
30/** 30/**
31 * timing_setup - shared timing computation and load 31 * timing_setup - shared timing computation and load
@@ -253,11 +253,22 @@ static void amd133_set_dmamode(struct ata_port *ap, struct ata_device *adev)
253 253
254static int nv_pre_reset(struct ata_port *ap) { 254static int nv_pre_reset(struct ata_port *ap) {
255 static const u8 bitmask[2] = {0x03, 0xC0}; 255 static const u8 bitmask[2] = {0x03, 0xC0};
256 static const struct pci_bits nv_enable_bits[] = {
257 { 0x50, 1, 0x02, 0x02 },
258 { 0x50, 1, 0x01, 0x01 }
259 };
256 260
257 struct pci_dev *pdev = to_pci_dev(ap->host->dev); 261 struct pci_dev *pdev = to_pci_dev(ap->host->dev);
258 u8 ata66; 262 u8 ata66;
259 u16 udma; 263 u16 udma;
260 264
265 if (!pci_test_config_bits(pdev, &nv_enable_bits[ap->port_no])) {
266 ata_port_disable(ap);
267 printk(KERN_INFO "ata%u: port disabled. ignoring.\n", ap->id);
268 return 0;
269 }
270
271
261 pci_read_config_byte(pdev, 0x52, &ata66); 272 pci_read_config_byte(pdev, 0x52, &ata66);
262 if (ata66 & bitmask[ap->port_no]) 273 if (ata66 & bitmask[ap->port_no])
263 ap->cbl = ATA_CBL_PATA80; 274 ap->cbl = ATA_CBL_PATA80;