Am Dienstag, 14. März 2006 22:47 schrieb Alan Stern:
> On Tue, 14 Mar 2006, Oliver Neukum wrote:
> 
> > Am Dienstag, 14. März 2006 22:24 schrieb Alan Stern:
> > > On Tue, 14 Mar 2006, Alan Stern wrote:
> > > 
> > > > > > acm_tty_close tty=cd254af8 filp=ce96511c acm=ce24eca0
> > > > > > acm_tty_close acm->used=1 acm->dev=00000000
> > > > > atm_tty_close called from tty_io.c:release_dev()
> > > > > acm->used=1 on entry, decrements to zero == final close
> > > > > acm->dev is NULL (unplugged) so call tty_unregister_device()
> > > > 
> > > > The disconnect routine shouldn't need to set acm->dev to NULL.  The fact
> > > > that the first disconnect has already occurred can be detected by the 
> > > > fact
> > > > that acm = usb_get_intfdata(intf) will itself be NULL.
> > > > 
> > > > Will everything work if you simply delete the line
> > > > 
> > > >         acm->dev = NULL;
> > > > 
> > > > from acm_disconnect()?
> > > 
> > > After looking at the code, I see that it won't.  The acm_tty_close() 
> > > routine uses acm->dev to tell whether or not the USB device has been 
> > > disconnected.  The problem is that when acm->dev is NULL, it calls 
> > > acm_tty_unregister() which requires acm->dev to be non-NULL.
> > 
> > Maybe I am dense, but what is acm->dev used for in acm_tty_unregister()?
> 
> It isn't.  I was wrong.  Sorry.
> 
> What Paul needs to track is the refcount for acm->dev.  It should be 
> incremented and decremented appropriately -- which means that acm->dev had 
> better not be NULL when acm_tty_unregister runs.

The devices's control interface's refcount is bumped. Are you saying this is
not enough and the device's refcount must also be manipulated?
In which regard should the pointer be significant?

        Regards
                Oliver


-------------------------------------------------------
This SF.Net email is sponsored by xPML, a groundbreaking scripting language
that extends applications into web and mobile media. Attend the live webcast
and join the prime developer group breaking into this new coding territory!
http://sel.as-us.falkag.net/sel?cmd=lnk&kid0944&bid$1720&dat1642
_______________________________________________
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