On Wed, 15 Mar 2006, Oliver Neukum wrote:

> > You know, another possibility is that cdc_acm should call
> > tty_unregister_device as soon as the USB device is disconnected.  It would
> > make sense; no point leaving a tty visible in sysfs if it's no longer
> > accessible (except through already-opened file descriptors). However I
> > don't know whether the tty subsystem is designed to work that way.
> 
> The whole point of having a kref in the device structure is delayed free,
> isn't it?

Yes.  I'm not familiar with the tty subsystem either.  What I meant
was: Do the equivalent of a "remove" on the tty class device during USB
disconnect, and then do the final "put" when the last file descriptor
is closed.  As opposed what the code does now, which is (I assume) the 
equivalent of "remove" and "put" together during the final close.

The "remove" would get rid of all the sysfs entries, including the 
troublesome symlink, at a time when it's still safe.

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