Date: Tue, 20 Oct 2009 21:29:47 +0000 (UTC) From: Andrew Thompson <thompsa@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r198307 - head/sys/dev/usb/storage Message-ID: <200910202129.n9KLTlXO079051@svn.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: thompsa Date: Tue Oct 20 21:29:46 2009 New Revision: 198307 URL: http://svn.freebsd.org/changeset/base/198307 Log: 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. This is intended to be a quick workaround to the problem without touching CAM so it can be merged to 8.0. Suggested by: mav MFC after: 3 days Modified: head/sys/dev/usb/storage/umass.c Modified: head/sys/dev/usb/storage/umass.c ============================================================================== --- head/sys/dev/usb/storage/umass.c Tue Oct 20 21:27:03 2009 (r198306) +++ head/sys/dev/usb/storage/umass.c Tue Oct 20 21:29:46 2009 (r198307) @@ -2860,8 +2860,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; }
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200910202129.n9KLTlXO079051>