Bug 387

Summary: poll on usb device does not return immediatly when device is unplugged
Product: Drivers Reporter: Andreas Jellinghaus (aj)
Component: USBAssignee: Greg Kroah-Hartman (greg)
Status: CLOSED CODE_FIX    
Severity: low CC: nacc
Priority: P2    
Hardware: i386   
OS: Linux   
Kernel Version: 2.5.60 Subsystem:
Regression: --- Bisected commit-id:
Attachments: test app. call with /proc/bus/usb/.... filename (maybe in an strace), remove device, poll does not return.
patch to signal waitqueues in usbfs that file is being removed.

Description Andreas Jellinghaus 2003-02-21 00:45:46 UTC
Any USB device.
open the /proc/bus/usb/... device, poll on it for changes,
unplug the device manual. The poll call does return the right values,
but only when it times out. Poll calls without a timeout seem to
return never.
Comment 1 Greg Kroah-Hartman 2003-06-27 16:18:19 UTC
Do you have a small userspace program that I can use to test this?

Also, does the same thing happen on 2.4?
Comment 2 Andreas Jellinghaus 2003-06-28 03:12:52 UTC
Created attachment 469 [details]
test app. call with /proc/bus/usb/.... filename (maybe in an strace), remove device, poll does not return.

same problem with 2.4.20 stock and 2.5.73
Comment 3 Nishanth Aravamudan 2004-11-23 15:47:10 UTC
Does this problem still exist in 2.6.9/2.6.10-rc*?
Comment 4 Andreas Jellinghaus 2004-11-24 00:13:51 UTC
2.6.10-rc1: still the same problem. 
shall I try rc2? 
Comment 5 Nishanth Aravamudan 2004-11-24 10:19:52 UTC
I don't think there will be any change in rc2, to be honest. I will take a look
at this problem today.
Comment 6 Nishanth Aravamudan 2004-12-08 15:50:10 UTC
Created attachment 4248 [details]
patch to signal waitqueues in usbfs that file is being removed.

Please try the attached patch, which should fix the bug. We were not properly
waking up the waitqueues that may have been watching the usbfs files.
Comment 7 Andreas Jellinghaus 2004-12-12 02:52:18 UTC
the patch fixes the issue. thanks!