On Fri, Apr 29, 2005 at 02:34:59PM -0400, Alan Stern wrote:
> Yes, we do.  Okay, are you still concerned about the new code being
> asymmetric somehow?

No :)

> Does the patch look good?  If you like it, I'll submit it to Greg.

Yes it looks reasonable.  At the moment I can't test the problematic
multi-interface USB device case where that bug revealed itself, which
was observed by Duncan Sands; I'm attaching a simple test case we've
been using to trigger the problem, so you may want to try it out before
submitting.  To do that, you need to load the test driver giving vendor and
product IDs of your multi-interface device as module parameters, and
then rmmod the driver while the device is still plugged in: it used to
spin forever (BTW it still does with 2.6.12-rc3, should I resend my
patch fixing it for non-klist case?)

> > > As it
> > > is now, it relies on internal knowledge of how the driver-model core
> > > works,
> >
> > Agreed.  IMHO if the driver model strives to take care of everything on
> > caller's behalf, it also has to gracefully handle recursive calls of one
> > of its exported interfaces, device_release_driver().
> 
> A simple way to do it would be for __device_release_driver to set 
> dev->driver to NULL _before_ calling dev->remove instead of after.  But 
> would this be safe?

That was also the first idea which came to my mind, but I didn't (and
still don't) feel like auditinig tons of code on whether it's safe...

> Can you think of a better way?

It may make sense to add some convention (e.g. explicit flag) to
indicate the state of the device wrt driver binding (bound, unbound,
transitioning from one to the other), and use it everywhere
consistently.  It'd be also useful to export it in sysfs.  But that's a
big piece work...

Cheers,
  Roman.


-------------------------------------------------------
This SF.Net email is sponsored by: NEC IT Guy Games.
Get your fingers limbered up and give it your best shot. 4 great events, 4
opportunities to win big! Highest score wins.NEC IT Guy Games. Play to
win an NEC 61 plasma display. Visit http://www.necitguy.com/?r=20
_______________________________________________
linux-usb-devel@lists.sourceforge.net
To unsubscribe, use the last form field at:
https://lists.sourceforge.net/lists/listinfo/linux-usb-devel

Reply via email to