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
This commit is contained in:
Christian S.J. Peron 2005-10-31 00:12:19 +00:00
parent 7a81302ce7
commit 1ffe41c1ec
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=151893

View file

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