When a umass storage device is unplugged there might be pending requests
authorMatthew Dillon <dillon@dragonflybsd.org>
Wed, 15 Sep 2004 01:38:13 +0000 (01:38 +0000)
committerMatthew Dillon <dillon@dragonflybsd.org>
Wed, 15 Sep 2004 01:38:13 +0000 (01:38 +0000)
commit0a20710b9c2500ca60cd3784fbbe64dd5d85b420
tree67f0c7c74acd3947f2bc0054111f1648edd0b1e3
parent01a09a7792aa589b136ab0a14fd52bbd1a2433c9
When a umass storage device is unplugged there might be pending requests
which either fail or wind up in limbo.  The state machine will attempt to
issue a BBB RESET, but since this does not occur on our bulk or interrupt
pipes simply aborting the pipes is not sufficient to ensure that all of our
xfer requests have been idled.

We must also wait for any in-progress RESET's to complete, which is
accomplished by testing sc->transfer_state.  Otherwise we may wind up
freeing an active xfer request and blow up.
sys/dev/usbmisc/umass/umass.c