Hi,

A read to an HID device can cause the inner loop in hiddev_read to become a
polling loop instead of blocking.  This is because after the first time
through the loop, the task state stays at TASK_RUNNING and the call to
schedule() does not block.

Please incorporate this patch to fix it.

Dave

==================================================================

--- old/drivers/usb/input/hiddev.c      2004-03-17 05:02:08.000000000 -0800
+++ new/drivers/usb/input/hiddev.c      2005-01-24 15:50:11.000000000 -0800
@@ -321,9 +321,9 @@
        while (retval == 0) {
                if (list->head == list->tail) {
                        add_wait_queue(&list->hiddev->wait, &wait);
-                       set_current_state(TASK_INTERRUPTIBLE);
                        
                        while (list->head == list->tail) {
+                               set_current_state(TASK_INTERRUPTIBLE);
                                if (file->f_flags & O_NONBLOCK) {
                                        retval = -EAGAIN;
                                        break;




-------------------------------------------------------
This SF.Net email is sponsored by: IntelliVIEW -- Interactive Reporting
Tool for open source databases. Create drag-&-drop reports. Save time
by over 75%! Publish reports on the web. Export to DOC, XLS, RTF, etc.
Download a FREE copy at http://www.intelliview.com/go/osdn_nl
_______________________________________________
[email protected]
To unsubscribe, use the last form field at:
https://lists.sourceforge.net/lists/listinfo/linux-usb-devel

Reply via email to