On Thu, 29 Jul 2004 17:02:42 -0400 (EDT)
Alan Stern <[EMAIL PROTECTED]> wrote:

> On Thu, 29 Jul 2004, Greg KH wrote:
> 
> > On Thu, Jul 29, 2004 at 10:59:09AM -0700, Pete Zaitcev wrote:
> > > 
> > > The patch attached to OSDL 3108 does not look good to me. The right
> > > approach would be to do usb_dev_get to prevent disconnect from pulling
> > > things from under you, then submit URBs.
> > 
> > I agree.
> 
> Remember also that disconnect() occuring while an URB is active will cause 
> the URB to be aborted.  So it ought to be enough to unlock the device 
> before submitting the URB.

What if the disconnect thread has time to free the device struct while
your usb_submit_urb is being processed, but before the urb is settled
with HC driver, so that it can be aborted?

I should note that this oops is hard to trigger, because the device
struct is freed only after its disconnect method has completed. So,
the path between the up() and the last dereference of the device
before HCD does dev_get() on it races against the path which has to
enter the disconnect method and exit it. Obviously, the first is shorter.
But I would really hate to rely on this, especially if, god forbid,
hyperthreading manages to stall one of them.

I think one of the reasons Bladecenter shakes all this crap out of
our USB stack so effectively is partly due to having several
hyperthreaded CPUs (and partly due to having a bunch of USB devices
which come and go together at a press of a single button).

Dropping semaphores inside functions is a big red flag. Duncan has
to justify it very thoroughly, and the materials attached to the bug
do not do it.

-- Pete


-------------------------------------------------------
This SF.Net email is sponsored by OSTG. Have you noticed the changes on
Linux.com, ITManagersJournal and NewsForge in the past few weeks? Now,
one more big change to announce. We are now OSTG- Open Source Technology
Group. Come see the changes on the new OSTG site. www.ostg.com
_______________________________________________
[EMAIL PROTECTED]
To unsubscribe, use the last form field at:
https://lists.sourceforge.net/lists/listinfo/linux-usb-devel

Reply via email to