diff options
author | remko <remko@FreeBSD.org> | 2008-07-09 15:10:53 +0000 |
---|---|---|
committer | remko <remko@FreeBSD.org> | 2008-07-09 15:10:53 +0000 |
commit | c490da6d2678016039a02b7fbe09affbc616e9f9 (patch) | |
tree | bbd0e34603a9a2db3aba0cded7a2c06a0735aa97 /sys/dev | |
parent | 3787712497316bddcc5ace2fbb127ec3c8fe604e (diff) | |
download | FreeBSD-src-c490da6d2678016039a02b7fbe09affbc616e9f9.zip FreeBSD-src-c490da6d2678016039a02b7fbe09affbc616e9f9.tar.gz |
Driver failed to allocate MMIO resources. Attached patch adds a fallback path.
It uses generic IDE facilities if sii-specific allocations failed
PR: 125421
Submitted by: Andrey V. Elsukov <bu7cher at yandex dot ru>
Approved by: imp (mentor, implicit)
MFC after: 1 week
Diffstat (limited to 'sys/dev')
-rw-r--r-- | sys/dev/ata/ata-chipset.c | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/sys/dev/ata/ata-chipset.c b/sys/dev/ata/ata-chipset.c index 6fa4b57..5cd1f34 100644 --- a/sys/dev/ata/ata-chipset.c +++ b/sys/dev/ata/ata-chipset.c @@ -4989,12 +4989,15 @@ ata_sii_chipinit(device_t dev) ctlr->r_type2 = SYS_RES_MEMORY; ctlr->r_rid2 = PCIR_BAR(5); if (!(ctlr->r_res2 = bus_alloc_resource_any(dev, ctlr->r_type2, - &ctlr->r_rid2, RF_ACTIVE))) - return ENXIO; + &ctlr->r_rid2, RF_ACTIVE))) { + if (ctlr->chip->chipid != ATA_SII0680 || + (pci_read_config(dev, 0x8a, 1) & 1)) + return ENXIO; + } if (ctlr->chip->cfg2 & SIISETCLK) { if ((pci_read_config(dev, 0x8a, 1) & 0x30) != 0x10) - pci_write_config(dev, 0x8a, + pci_write_config(dev, 0x8a, (pci_read_config(dev, 0x8a, 1) & 0xcf)|0x10,1); if ((pci_read_config(dev, 0x8a, 1) & 0x30) != 0x10) device_printf(dev, "%s could not set ATA133 clock\n", @@ -5014,7 +5017,9 @@ ata_sii_chipinit(device_t dev) /* enable PCI interrupt as BIOS might not */ pci_write_config(dev, 0x8a, (pci_read_config(dev, 0x8a, 1) & 0x3f), 1); - ctlr->allocate = ata_sii_allocate; + if (ctlr->r_res2) + ctlr->allocate = ata_sii_allocate; + if (ctlr->chip->max_dma >= ATA_SA150) { ctlr->reset = ata_sii_reset; ctlr->setmode = ata_sata_setmode; |