On Tue, 14 Mar 2006, Paul Fulghum wrote:

> > usb 1-2: USB disconnect, address 6
> Unplug detected
> 
> > acm_disconnect intf=ce99f720 acm=ce24eca0 usb_dev=ce24f4b8
> > acm_disconnect acm->used=1 acm->dev=ce24f4b8 acm->tty=cd254af8
> acm_disconnect
> acm->used is 1 (tty open, defer acm_tty_unregister)
> set acm->dev = NULL to indicate unplug
> call tty_hangup() to kill connection
> 
> > acm_disconnect intf=cefb6760 acm=00000000 usb_dev=ce24f4b8
> acm_disconnect, no interface data so do nothing (why no data?)

Like Oliver said, this is an artificial situation.  Since the driver is 
bound to two interfaces its disconnect routine will get called two times.  
However the driver needs to do its work only once, so it sets acm->dev to 
NULL to indicate that the second call of the disconnect routine can return 
immediately.  I think that's the source of the problem.

> > 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()?

Alan Stern



-------------------------------------------------------
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&kid=110944&bid=241720&dat=121642
_______________________________________________
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