On Wed, 15 Mar 2006, Paul Fulghum wrote: > On Wed, 2006-03-15 at 16:17 +0100, Oliver Neukum wrote: > > > Yes, this is removing the back link to the > > > tty class device which also has a good reference count. > > > So device (really the associated kobject) reference counting > > > is not the problem. > > > > This is an unproven conjecture. Kobjects have their own refcounts. > > Could you extend the debugging printks to them? > > Conjecture? > > kobject is used to provide reference counting for device objects. > Look at the printk patch. It prints the reference value of dev->kobj. > > The values in Bob's syslog output *are* the kobject reference counts. > > Look at drivers/core/core.c for put_device/get_device
Maybe what's going on is that the symlink is being removed twice. The first time is when the USB device is disconnected. The interface is unregistered, which causes its embedded device's kobject to be deleted. This calls sysfs_remove_dir(), which removes the directory where the symlink exists. sysfs_remove_dir() contains a loop which calls sysfs_drop_dentry() for every member of the directory being removed, which includes the symlink. Then later on the class device is removed. This calls sysfs_remove_link(), which tries to remove the symlink a second time. Now I'm not an expert on all the subtleties of sysfs and filesystem drivers, so maybe I've missed something important. But it looks like the loop in sysfs_hash_and_remove() should never succeed in finding the name, since the symlink has already been deleted. 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