Date: Wed, 7 Jan 2009 13:27:15 GMT From: Hans Petter Selasky <hselasky@FreeBSD.org> To: Perforce Change Reviews <perforce@FreeBSD.org> Subject: PERFORCE change 155755 for review Message-ID: <200901071327.n07DRFt5091936@repoman.freebsd.org>
next in thread | raw e-mail | index | archive | help
http://perforce.freebsd.org/chv.cgi?CH=155755 Change 155755 by hselasky@hselasky_laptop001 on 2009/01/07 13:26:37 Fix a race causing the explore thread to hang when tearing down USB transfers at detach. Affected files ... .. //depot/projects/usb/src/sys/dev/usb2/core/usb2_transfer.c#36 edit Differences ... ==== //depot/projects/usb/src/sys/dev/usb2/core/usb2_transfer.c#36 (text+ko) ==== @@ -1915,8 +1915,7 @@ /* * Check if we got started after that we got cancelled, but - * before we managed to do the callback. Check if we are - * draining. + * before we managed to do the callback. */ if ((!xfer->flags_int.open) && (xfer->flags_int.started) && @@ -1924,13 +1923,19 @@ /* try to loop, but not recursivly */ usb2_command_wrapper(&info->done_q, xfer); return; - } else if (xfer->flags_int.draining && + } + +done: + /* + * Check if we are draining. + */ + if (xfer->flags_int.draining && (!xfer->flags_int.transferring)) { /* "usb2_transfer_drain()" is waiting for end of transfer */ xfer->flags_int.draining = 0; usb2_cv_broadcast(&xfer->usb2_root->cv_drain); } -done: + /* do the next callback, if any */ usb2_command_wrapper(&info->done_q, info->done_q.curr);
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200901071327.n07DRFt5091936>