diff options
author | csjp <csjp@FreeBSD.org> | 2005-10-31 00:12:19 +0000 |
---|---|---|
committer | csjp <csjp@FreeBSD.org> | 2005-10-31 00:12:19 +0000 |
commit | 0dd5d190ee9d04b14383687e8026a83961f177ee (patch) | |
tree | 721464268966499b0b2882ae178fe59427790e76 /sys/dev | |
parent | 363ab5c5662f36c68f5120d8974cbc31004815b0 (diff) | |
download | FreeBSD-src-0dd5d190ee9d04b14383687e8026a83961f177ee.zip FreeBSD-src-0dd5d190ee9d04b14383687e8026a83961f177ee.tar.gz |
Pickup I/O lock in aac_get_bus_info, as this code will call
aac_alloc_sync_fib(). aac_alloc_sync_fib() will assert that the I/O locks
are held. This fixes a panic on system boot up when the aac(4) device's
bus_generic_attach() routine is called.
Reviewed by: scottl
Diffstat (limited to 'sys/dev')
-rw-r--r-- | sys/dev/aac/aac.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/sys/dev/aac/aac.c b/sys/dev/aac/aac.c index 1c42d4e..14932e9 100644 --- a/sys/dev/aac/aac.c +++ b/sys/dev/aac/aac.c @@ -3428,6 +3428,7 @@ aac_get_bus_info(struct aac_softc *sc) device_t child; int i, found, error; + mtx_lock(&sc->aac_io_lock); aac_alloc_sync_fib(sc, &fib); c_cmd = (struct aac_ctcfg *)&fib->data[0]; bzero(c_cmd, sizeof(struct aac_ctcfg)); @@ -3442,6 +3443,7 @@ aac_get_bus_info(struct aac_softc *sc) device_printf(sc->aac_dev, "Error %d sending " "VM_ContainerConfig command\n", error); aac_release_sync_fib(sc); + mtx_unlock(&sc->aac_io_lock); return; } @@ -3450,6 +3452,7 @@ aac_get_bus_info(struct aac_softc *sc) device_printf(sc->aac_dev, "VM_ContainerConfig returned 0x%x\n", c_resp->Status); aac_release_sync_fib(sc); + mtx_unlock(&sc->aac_io_lock); return; } @@ -3470,6 +3473,7 @@ aac_get_bus_info(struct aac_softc *sc) device_printf(sc->aac_dev, "Error %d sending VMIoctl command\n", error); aac_release_sync_fib(sc); + mtx_unlock(&sc->aac_io_lock); return; } @@ -3478,11 +3482,13 @@ aac_get_bus_info(struct aac_softc *sc) device_printf(sc->aac_dev, "VM_Ioctl returned %d\n", vmi_resp->Status); aac_release_sync_fib(sc); + mtx_unlock(&sc->aac_io_lock); return; } bcopy(&vmi_resp->BusInf, &businfo, sizeof(struct aac_getbusinf)); aac_release_sync_fib(sc); + mtx_unlock(&sc->aac_io_lock); found = 0; for (i = 0; i < businfo.BusCount; i++) { |