On Fri, 24 Sep 2004 00:09:23 -0500, Dmitry Torokhov wrote: > Jan Steinhoff wrote: > > > Hi, > > > > I'm working on a kernel 2.6 driver for Synaptics cPad. With kernel >= > > 2.6.7 'rmmod cpad' hangs if called from xterm. This is because Synaptics > > TouchPad driver for XFree86 holds the evdev device of the cPad open, even > > if read errors like ENODEV occur. When switching to console the device is > > closed an rmmod finally returns. > > > > The same thing happens with usbhid.ko and an ordinary USB mouse, if I hold > > the evdev device open with less. driver_unregister in function > > usb_deregister does not return, although the disconnect function in the > > usb device driver already returned. > > > > Hi, > > I think it is a problem with USB because I can rmmod psmouse while using > Synaptics (PS/2 flavor) in X without any problems (except for loosing the > mouse of course. That means that input core can handle such removal.
psmouse->dev.dev is set to NULL in psmouse_connect() in psmouse-base.c, but in usbmouse.c, mouse->dev.dev is set to &intf->dev. I think the kobject's refcount is then increased by class_simple_device_add() in evdev_connect() for an USB mouse, but not for a ps2 mouse. If the evdev is open, then evdev_disconnect() does not call class_simple_device_remove() (I think the open counter will not work then), so 'rmmod usbhid' hangs until class_simple_device_remove() is called in evdev_release(). I have not the faintest idea if anything should be fixed here. Making a patch for Synaptics XFree driver should be much simpler. Jan ------------------------------------------------------- This SF.Net email is sponsored by: YOU BE THE JUDGE. Be one of 170 Project Admins to receive an Apple iPod Mini FREE for your judgement on who ports your project to Linux PPC the best. Sponsored by IBM. Deadline: Sept. 24. Go here: http://sf.net/ppc_contest.php _______________________________________________ [EMAIL PROTECTED] To unsubscribe, use the last form field at: https://lists.sourceforge.net/lists/listinfo/linux-usb-devel
