Bug 387 - poll on usb device does not return immediatly when device is unplugged
Summary: poll on usb device does not return immediatly when device is unplugged
Status: CLOSED CODE_FIX
Alias: None
Product: Drivers
Classification: Unclassified
Component: USB (show other bugs)
Hardware: i386 Linux
: P2 low
Assignee: Greg Kroah-Hartman
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2003-02-21 00:45 UTC by Andreas Jellinghaus
Modified: 2004-12-12 12:29 UTC (History)
1 user (show)

See Also:
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. (834 bytes, text/x-csrc)
2003-06-28 03:12 UTC, Andreas Jellinghaus
Details
patch to signal waitqueues in usbfs that file is being removed. (433 bytes, patch)
2004-12-08 15:50 UTC, Nishanth Aravamudan
Details | Diff

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! 
 

Note You need to log in before you can comment on or make changes to this bug.