svn commit: r198348 - in stable/8/sys: . amd64/include/xen cddl/contrib/opensolaris contrib/dev/acpica contrib/pf dev/usb/storage dev/xen/xenpci

Andrew Thompson thompsa at FreeBSD.org
Wed Oct 21 19:48:28 UTC 2009


Author: thompsa
Date: Wed Oct 21 19:48:27 2009
New Revision: 198348
URL: http://svn.freebsd.org/changeset/base/198348

Log:
  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)

Modified:
  stable/8/sys/   (props changed)
  stable/8/sys/amd64/include/xen/   (props changed)
  stable/8/sys/cddl/contrib/opensolaris/   (props changed)
  stable/8/sys/contrib/dev/acpica/   (props changed)
  stable/8/sys/contrib/pf/   (props changed)
  stable/8/sys/dev/usb/storage/umass.c
  stable/8/sys/dev/xen/xenpci/   (props changed)

Modified: stable/8/sys/dev/usb/storage/umass.c
==============================================================================
--- stable/8/sys/dev/usb/storage/umass.c	Wed Oct 21 19:39:34 2009	(r198347)
+++ stable/8/sys/dev/usb/storage/umass.c	Wed Oct 21 19:48:27 2009	(r198348)
@@ -2843,8 +2843,9 @@ umass_cam_action(struct cam_sim *sim, un
 {
 	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;
 	}


More information about the svn-src-stable-8 mailing list