On Tue, 9 Aug 2005, Stefan Richter wrote: > > It already is in the core. If you're interested, read > > drivers/usb/core/usb.c:usb_lock_device_for_reset(). > > I was actually browsing the usb/storage/scsiglue.c, but only > old code at lxr.linux.no, 2.6.11 in fact. Sorry, I see now that > this is way too old to look at. However the scsiglue.c's > device_reset and bus_reset in Linus' tree are still using down(). 2.6.11 isn't too old. The code hasn't really changed since then. However, you're looking at the wrong semaphore. (Yes, the call to down(&(us->dev_semaphore)); in bus_reset() would also create a deadlock, but it's not really needed and I'm going to take it out.) You should instead be looking at the call to usb_lock_device_for_reset() -- notice how it uses usb_trylock_device(). Alan Stern - : send the line "unsubscribe linux-scsi" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html