aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--drivers/ide/amd74xx.c11
-rw-r--r--drivers/ide/ide-iops.c3
-rw-r--r--drivers/ide/ide-probe.c3
-rw-r--r--include/linux/ide.h8
4 files changed, 22 insertions, 3 deletions
diff --git a/drivers/ide/amd74xx.c b/drivers/ide/amd74xx.c
index 81ec73134eda..c6bcd3014a29 100644
--- a/drivers/ide/amd74xx.c
+++ b/drivers/ide/amd74xx.c
@@ -3,7 +3,7 @@
3 * IDE driver for Linux. 3 * IDE driver for Linux.
4 * 4 *
5 * Copyright (c) 2000-2002 Vojtech Pavlik 5 * Copyright (c) 2000-2002 Vojtech Pavlik
6 * Copyright (c) 2007 Bartlomiej Zolnierkiewicz 6 * Copyright (c) 2007-2008 Bartlomiej Zolnierkiewicz
7 * 7 *
8 * Based on the work of: 8 * Based on the work of:
9 * Andre Hedrick 9 * Andre Hedrick
@@ -263,6 +263,15 @@ static int __devinit amd74xx_probe(struct pci_dev *dev, const struct pci_device_
263 d.udma_mask = ATA_UDMA5; 263 d.udma_mask = ATA_UDMA5;
264 } 264 }
265 265
266 /*
267 * It seems that on some nVidia controllers using AltStatus
268 * register can be unreliable so default to Status register
269 * if the device is in Compatibility Mode.
270 */
271 if (dev->vendor == PCI_VENDOR_ID_NVIDIA &&
272 ide_pci_is_in_compatibility_mode(dev))
273 d.host_flags |= IDE_HFLAG_BROKEN_ALTSTATUS;
274
266 printk(KERN_INFO "%s %s: UDMA%s controller\n", 275 printk(KERN_INFO "%s %s: UDMA%s controller\n",
267 d.name, pci_name(dev), amd_dma[fls(d.udma_mask) - 1]); 276 d.name, pci_name(dev), amd_dma[fls(d.udma_mask) - 1]);
268 277
diff --git a/drivers/ide/ide-iops.c b/drivers/ide/ide-iops.c
index 5d6ba14e211d..142b9573d64c 100644
--- a/drivers/ide/ide-iops.c
+++ b/drivers/ide/ide-iops.c
@@ -468,7 +468,8 @@ int drive_is_ready (ide_drive_t *drive)
468 * an interrupt with another pci card/device. We make no assumptions 468 * an interrupt with another pci card/device. We make no assumptions
469 * about possible isa-pnp and pci-pnp issues yet. 469 * about possible isa-pnp and pci-pnp issues yet.
470 */ 470 */
471 if (hwif->io_ports.ctl_addr) 471 if (hwif->io_ports.ctl_addr &&
472 (hwif->host_flags & IDE_HFLAG_BROKEN_ALTSTATUS) == 0)
472 stat = hwif->tp_ops->read_altstatus(hwif); 473 stat = hwif->tp_ops->read_altstatus(hwif);
473 else 474 else
474 /* Note: this may clear a pending IRQ!! */ 475 /* Note: this may clear a pending IRQ!! */
diff --git a/drivers/ide/ide-probe.c b/drivers/ide/ide-probe.c
index 1649ea54f76c..c55bdbd22314 100644
--- a/drivers/ide/ide-probe.c
+++ b/drivers/ide/ide-probe.c
@@ -266,7 +266,8 @@ static int actual_try_to_identify (ide_drive_t *drive, u8 cmd)
266 /* take a deep breath */ 266 /* take a deep breath */
267 msleep(50); 267 msleep(50);
268 268
269 if (io_ports->ctl_addr) { 269 if (io_ports->ctl_addr &&
270 (hwif->host_flags & IDE_HFLAG_BROKEN_ALTSTATUS) == 0) {
270 a = tp_ops->read_altstatus(hwif); 271 a = tp_ops->read_altstatus(hwif);
271 s = tp_ops->read_status(hwif); 272 s = tp_ops->read_status(hwif);
272 if ((a ^ s) & ~ATA_IDX) 273 if ((a ^ s) & ~ATA_IDX)
diff --git a/include/linux/ide.h b/include/linux/ide.h
index 54525be4b5f8..010fb26a1579 100644
--- a/include/linux/ide.h
+++ b/include/linux/ide.h
@@ -1296,6 +1296,13 @@ extern int __ide_pci_register_driver(struct pci_driver *driver, struct module *o
1296#define ide_pci_register_driver(d) pci_register_driver(d) 1296#define ide_pci_register_driver(d) pci_register_driver(d)
1297#endif 1297#endif
1298 1298
1299static inline int ide_pci_is_in_compatibility_mode(struct pci_dev *dev)
1300{
1301 if ((dev->class >> 8) == PCI_CLASS_STORAGE_IDE && (dev->class & 5) != 5)
1302 return 1;
1303 return 0;
1304}
1305
1299void ide_pci_setup_ports(struct pci_dev *, const struct ide_port_info *, int, 1306void ide_pci_setup_ports(struct pci_dev *, const struct ide_port_info *, int,
1300 hw_regs_t *, hw_regs_t **); 1307 hw_regs_t *, hw_regs_t **);
1301void ide_setup_pci_noise(struct pci_dev *, const struct ide_port_info *); 1308void ide_setup_pci_noise(struct pci_dev *, const struct ide_port_info *);
@@ -1375,6 +1382,7 @@ enum {
1375 IDE_HFLAG_IO_32BIT = (1 << 24), 1382 IDE_HFLAG_IO_32BIT = (1 << 24),
1376 /* unmask IRQs */ 1383 /* unmask IRQs */
1377 IDE_HFLAG_UNMASK_IRQS = (1 << 25), 1384 IDE_HFLAG_UNMASK_IRQS = (1 << 25),
1385 IDE_HFLAG_BROKEN_ALTSTATUS = (1 << 26),
1378 /* serialize ports if DMA is possible (for sl82c105) */ 1386 /* serialize ports if DMA is possible (for sl82c105) */
1379 IDE_HFLAG_SERIALIZE_DMA = (1 << 27), 1387 IDE_HFLAG_SERIALIZE_DMA = (1 << 27),
1380 /* force host out of "simplex" mode */ 1388 /* force host out of "simplex" mode */