Here is the list of 2.4.20 drivers broken by the introduction of a lock in video_unregister_device() in 2.4.19: (a reboot and extensive fscking is needed after the user subseqently logs out of an X-session (and the system hangs), after a usb disconnect while open). (This is probably far worse than the effects of the race that was cured!) All defer unregistering the video_device to the v4l close() funxtion if the device was unplugged while open. cpia ov511 pwc-if se401 stv680 which driver is a good model for "doing it right" when it comes to the usb cable being yanked? maybe usbvideo.c ? ** is it in fact necessary to kfree() the video device struct after unregistering, as pwc-if.c does? (pwc-if.c appears to believe this is stopping a memory leak, but no othe driver seems to do it) On 09-Dec-2002 Alan Cox wrote: >> Is there any reason for this, or was it just over-zealous lock-adding >> that actually breaks the procedures for dealing with unplugged >> open devices? > > Fixing a race. > >> Could someone test what actually happens when the usb cable is yanked on >> some other open webcams on 2.4.19 or later? > > You need to remove the cable out of interrupt context, eg using schedule_work > in 2.5 > > > > -- > video4linux-list mailing list > Unsubscribe mailto:video4linux-list-request@xxxxxxxxxx?subject=unsubscribe > https://listman.redhat.com/mailman/listinfo/video4linux-list ---------------------------------- E-Mail: Duncan Haldane <f.duncan.m.haldane@xxxxxxxxxxxxxxxx> Date: 09-Dec-2002 Time: 12:53:05 This message was sent by XFMail ----------------------------------