On Tue, Mar 14, 2006 at 12:07:54PM -0600, Paul Fulghum wrote: > On Tue, 2006-03-14 at 09:05 -0800, Greg KH wrote: > > Ah, wait, that's the issue right there. You need to increment the > > reference count of the object on open and then decrement it on close. > > That way the last close will drop the last reference, and you do that > > _after_ the tty cleanup. > > acm_probe() gets a reference to acm->control->dev > just before calling tty_register_device(), and it holds that > reference until just after calling tty_unregister_device(). > > sysfs also takes a reference to acm->control->dev > as the target of a symlink > > So there should be at least two references pinning > acm->control->dev on entry to tty_unregister_device. > > The printk patch I asked Bob to try should tell us > the actual reference counts. Maybe the counts get > out of wack someplace else. > > Adding extra reference on tty open may work, > but may just cover an existing reference count problem.
Well, we have a "used" count that is trying to handle the cleanup properly for us when we have the port open yet it is gone already. But it really would be easier to reference count the whole thing, but I'll wait for what you find out with your last patch... thanks, greg k-h ------------------------------------------------------- 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