aboutsummaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorBartlomiej Zolnierkiewicz <bzolnier@gmail.com>2008-12-02 14:40:03 -0500
committerBartlomiej Zolnierkiewicz <bzolnier@gmail.com>2008-12-02 14:40:03 -0500
commit6636487e8dc49a1c43fed336bdc4a2f3d7ce6881 (patch)
treef23a8f126cd63a199907bd8c20f3d2f4423ca006 /drivers
parentf9e3326dce0ef117308872cd234b903aa19aa40f (diff)
amd74xx: workaround unreliable AltStatus register for nVidia controllers
It seems that on some nVidia controllers using AltStatus register can be unreliable so default to Status register if the PCI device is in Compatibility Mode. In order to achieve this: * Add ide_pci_is_in_compatibility_mode() inline helper to <linux/ide.h>. * Add IDE_HFLAG_BROKEN_ALTSTATUS host flag and set it in amd74xx host driver for nVidia controllers in Compatibility Mode. * Teach actual_try_to_identify() and drive_is_ready() about the new flag. This fixes the regression caused by removal of CONFIG_IDEPCI_SHARE_IRQ config option in 2.6.25 and using AltStatus register unconditionally when available (kernel.org bugs #11659 and #10216). [ Moreover for CONFIG_IDEPCI_SHARE_IRQ=y (which is what most people and distributions use) it never worked correctly. ] Thanks to Remy LABENE and Lars Winterfeld for help with debugging the problem. More info at: http://bugzilla.kernel.org/show_bug.cgi?id=11659 http://bugzilla.kernel.org/show_bug.cgi?id=10216 Reported-by: Remy LABENE <remy.labene@free.fr> Tested-by: Remy LABENE <remy.labene@free.fr> Tested-by: Lars Winterfeld <lars.winterfeld@tu-ilmenau.de> Acked-by: Borislav Petkov <petkovbb@gmail.com> Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/ide/amd74xx.c11
-rw-r--r--drivers/ide/ide-iops.c3
-rw-r--r--drivers/ide/ide-probe.c3
3 files changed, 14 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)