When deregistering a bus, pending device bus scan timeouts are not deleted
authorMatthew Dillon <dillon@dragonflybsd.org>
Mon, 15 Mar 2004 05:43:52 +0000 (05:43 +0000)
committerMatthew Dillon <dillon@dragonflybsd.org>
Mon, 15 Mar 2004 05:43:52 +0000 (05:43 +0000)
commit0a9d9dcf3cbd1810990fdc15f0ef5c18137ef693
tree264c0edbaa42fb93c62b8d4f143db525fd508767
parent521cf4d2bd2694659037341aa7ce7306001a8079
When deregistering a bus, pending device bus scan timeouts are not deleted
and pending ccb's are not necessary aborted/processed prior to the sim
potentially being destroyed.  Adjust AC_LOST_DEVICE to release any pending
timeouts (and it should also restart the command queue).  This may interlock
against the detaching device (e.g. UMASS) having set a flag in its softc
that causes all future commands to fail immediately.  Note that we have to
also run any pending ISRs synchronously before xpt_bus_deregister() can
safely return.

When freeing a device queue, print a warning if the device queue contains
active commands.  If a device queue is freed while holding active commands
all sorts of bad things can happen, including the machine locking up on
boot while waiting for CAM to finish scanning its SCSI busses.
sys/bus/cam/cam_queue.c
sys/bus/cam/cam_xpt.c