aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAndrew Thompson <thompsa@FreeBSD.org>2009-10-21 19:48:27 +0000
committerAndrew Thompson <thompsa@FreeBSD.org>2009-10-21 19:48:27 +0000
commitb1c3c31d58bedbf18442891ff0e8b50631497920 (patch)
tree9e0fe6c4efb1f5fb485b8369281ad0ec2acfd2f7
parent3604d6e3d3d578a4af47019667f926d93d9a72ba (diff)
downloadsrc-b1c3c31d58bedbf18442891ff0e8b50631497920.tar.gz
src-b1c3c31d58bedbf18442891ff0e8b50631497920.zip
MFC r198307
Change from CAM_TID_INVALID to CAM_SEL_TIMEOUT error code when the usb device has been yanked, this works around a cam recounting bug when CAM_DEV_UNCONFIGURED is set late in the detach. In certain conditions the reference to the XPT device would not be released which would cause the usb explore thread to sleep forever on "simfree", preventing any new usb devices to be found/ejected on the bus. Approved by: re (kib)
Notes
Notes: svn path=/stable/8/; revision=198348
-rw-r--r--sys/dev/usb/storage/umass.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/sys/dev/usb/storage/umass.c b/sys/dev/usb/storage/umass.c
index 2e412d98ca3d..3aa128453df1 100644
--- a/sys/dev/usb/storage/umass.c
+++ b/sys/dev/usb/storage/umass.c
@@ -2843,8 +2843,9 @@ umass_cam_action(struct cam_sim *sim, union ccb *ccb)
{
struct umass_softc *sc = (struct umass_softc *)sim->softc;
- if (sc == UMASS_GONE) {
- ccb->ccb_h.status = CAM_TID_INVALID;
+ if (sc == UMASS_GONE ||
+ (sc != NULL && !usbd_device_attached(sc->sc_udev))) {
+ ccb->ccb_h.status = CAM_SEL_TIMEOUT;
xpt_done(ccb);
return;
}