diff options
author | imp <imp@FreeBSD.org> | 2014-09-06 18:20:50 +0000 |
---|---|---|
committer | imp <imp@FreeBSD.org> | 2014-09-06 18:20:50 +0000 |
commit | 6b8d76a0a671e76eb5cbea47ef7a66e5383b034a (patch) | |
tree | 0fdfde0890cbe192a5d9873a9a1f6ead71569e6e | |
parent | ac6b458116d226c44dfd85f86c403186bdf481df (diff) | |
download | FreeBSD-src-6b8d76a0a671e76eb5cbea47ef7a66e5383b034a.zip FreeBSD-src-6b8d76a0a671e76eb5cbea47ef7a66e5383b034a.tar.gz |
Restore order of interrupt setup. Minor problems can result by
setting up the interrupts too early:
Reviewed by: mav@
Sponsored by: Netflix
-rw-r--r-- | sys/dev/ahci/ahci.c | 9 | ||||
-rw-r--r-- | sys/dev/ahci/ahci_pci.c | 7 |
2 files changed, 9 insertions, 7 deletions
diff --git a/sys/dev/ahci/ahci.c b/sys/dev/ahci/ahci.c index 95ce61f..61be530 100644 --- a/sys/dev/ahci/ahci.c +++ b/sys/dev/ahci/ahci.c @@ -229,6 +229,15 @@ ahci_attach(device_t dev) ahci_ctlr_setup(dev); + /* Setup interrupts. */ + if (ahci_setup_interrupt(dev)) { + bus_dma_tag_destroy(ctlr->dma_tag); + bus_release_resource(dev, SYS_RES_MEMORY, ctlr->r_rid, + ctlr->r_mem); + rman_fini(&ctlr->sc_iomem); + return ENXIO; + } + i = 0; for (u = ctlr->ichannels; u != 0; u >>= 1) i += (u & 1); diff --git a/sys/dev/ahci/ahci_pci.c b/sys/dev/ahci/ahci_pci.c index e9a0d75..6572e4c 100644 --- a/sys/dev/ahci/ahci_pci.c +++ b/sys/dev/ahci/ahci_pci.c @@ -417,13 +417,6 @@ ahci_pci_attach(device_t dev) ctlr->numirqs = 1; } - if (ahci_setup_interrupt(dev)) { - if (ctlr->msi) - pci_release_msi(dev); - bus_release_resource(dev, SYS_RES_MEMORY, ctlr->r_rid, ctlr->r_mem); - return ENXIO; - } - error = ahci_attach(dev); if (error != 0) if (ctlr->msi) |