Am Donnerstag, 24. Oktober 2002 09:48 schrieb Greg KH:
> On Thu, Oct 24, 2002 at 09:34:02AM +0200, Oliver Neukum wrote:
> > > Think of it as a proof-by-induction that shutdown will work.  When
> > > there's a point past which no more activities can be started (like
> > > when device state becomes GONE), and existing activities all get
> > > canceled, shutdown will clearly work.  With no such point, the exotic
> > > failure modes can prevent shutdown from working.
> >
> > Correct, but incomplete.
> > You see, the full transition on unplugging is twofold from
> > WORKING to GONE to <NONE AT ALL>. The last state is caused
> > by kfree on the device descriptor. Preventing submission in the second
> > state is no problem. That's not the case for the last state
> > unfortunately.
>
> No, the last state will happen when the last reference count of the
> device is removed.  So as long as someone (driver, core, who ever) has
> called usb_get_dev(), the device will stick around.  In short, we can
> control this.

Control it we can, prevent it we can't. You see a driver will have to call
it at some point, probably in disconnect. If you really want to do this,
the drivers have to switch to usb_get_dev() on open() and usb_put_dev()
on flush(). That actually might be the best solution now that I think of it.

What do you think?

        Regards
                Oliver



-------------------------------------------------------
This sf.net email is sponsored by: Influence the future
of Java(TM) technology. Join the Java Community
Process(SM) (JCP(SM)) program now.
http://ad.doubleclick.net/clk;4729346;7592162;s?http://www.sun.com/javavote
_______________________________________________
[EMAIL PROTECTED]
To unsubscribe, use the last form field at:
https://lists.sourceforge.net/lists/listinfo/linux-usb-devel

Reply via email to