Restore order of interrupt setup. Minor problems can result by

setting up the interrupts too early:

Reviewed by: mav@
Sponsored by: Netflix
This commit is contained in:
imp 2014-09-06 18:20:50 +00:00
parent ac6b458116
commit 6b8d76a0a6
2 changed files with 9 additions and 7 deletions

View File

@ -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);

View File

@ -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)