summaryrefslogtreecommitdiffstats
path: root/sys/dev/ata/ata-pci.c
diff options
context:
space:
mode:
authormav <mav@FreeBSD.org>2010-07-16 17:27:43 +0000
committermav <mav@FreeBSD.org>2010-07-16 17:27:43 +0000
commit8b6b10d281e559f6de56a2af1090815c580899de (patch)
tree4a671d1fe13e5459b9bd53ba7b65ec22ac5ba648 /sys/dev/ata/ata-pci.c
parenteaa89e0fcedee70c482e6dec411fde5eaabc8a74 (diff)
downloadFreeBSD-src-8b6b10d281e559f6de56a2af1090815c580899de.zip
FreeBSD-src-8b6b10d281e559f6de56a2af1090815c580899de.tar.gz
Make legacy ATA emulation detection more strict. This should fix false
positive legacy detection and attach failure/panic for Marvell 88SX6141 controller and potentially some others. PR: kern/145064
Diffstat (limited to 'sys/dev/ata/ata-pci.c')
-rw-r--r--sys/dev/ata/ata-pci.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/sys/dev/ata/ata-pci.c b/sys/dev/ata/ata-pci.c
index f3c2a27..c847e90 100644
--- a/sys/dev/ata/ata-pci.c
+++ b/sys/dev/ata/ata-pci.c
@@ -769,7 +769,8 @@ DRIVER_MODULE(ata, atapci, ata_pcichannel_driver, ata_devclass, 0, 0);
int
ata_legacy(device_t dev)
{
- return (((pci_read_config(dev, PCIR_PROGIF, 1)&PCIP_STORAGE_IDE_MASTERDEV)&&
+ return (((pci_read_config(dev, PCIR_SUBCLASS, 1) == PCIS_STORAGE_IDE) &&
+ (pci_read_config(dev, PCIR_PROGIF, 1)&PCIP_STORAGE_IDE_MASTERDEV)&&
((pci_read_config(dev, PCIR_PROGIF, 1) &
(PCIP_STORAGE_IDE_MODEPRIM | PCIP_STORAGE_IDE_MODESEC)) !=
(PCIP_STORAGE_IDE_MODEPRIM | PCIP_STORAGE_IDE_MODESEC))) ||
OpenPOWER on IntegriCloud