diff options
author | Bartlomiej Zolnierkiewicz <bzolnier@gmail.com> | 2008-12-02 14:40:03 -0500 |
---|---|---|
committer | Bartlomiej Zolnierkiewicz <bzolnier@gmail.com> | 2008-12-02 14:40:03 -0500 |
commit | 6636487e8dc49a1c43fed336bdc4a2f3d7ce6881 (patch) | |
tree | f23a8f126cd63a199907bd8c20f3d2f4423ca006 /include/linux/ide.h | |
parent | f9e3326dce0ef117308872cd234b903aa19aa40f (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 'include/linux/ide.h')
-rw-r--r-- | include/linux/ide.h | 8 |
1 files changed, 8 insertions, 0 deletions
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 | ||
1299 | static 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 | |||
1299 | void ide_pci_setup_ports(struct pci_dev *, const struct ide_port_info *, int, | 1306 | void 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 **); |
1301 | void ide_setup_pci_noise(struct pci_dev *, const struct ide_port_info *); | 1308 | void 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 */ |