[PATCH] to make HID read block

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



This patch makes a read of a HID device block until data is available.
Without it, the read goes into a busy-wait loop until data is available.
 
Signed-off-by: David Micon [email protected]
 
diff -rupN linux-2.6.16.16.orig/drivers/usb/input/hiddev.c
linux-2.6.16.16/drivers/usb/input/hiddev.c
--- linux-2.6.16.16.orig/drivers/usb/input/hiddev.c 2006-03-19
21:53:29.000000000 -0800
+++ linux-2.6.16.16/drivers/usb/input/hiddev.c 2006-05-12 
+++ 16:39:08.000000000 -0700
@@ -318,6 +318,7 @@ static ssize_t hiddev_read(struct file *
     }
 
     schedule();
+    set_current_state(TASK_INTERRUPTIBLE);
    }
 
    set_current_state(TASK_RUNNING);


Confidentiality Notice:

The information contained in this transmission is legally privileged and confidential, intended only for the use of the individual(s) or entities named above.  This email and any files transmitted with it are the property of Pelco.  If the reader of this message is not the intended recipient, or an employee or agent responsible for delivering this message to the intended recipient, you are hereby notified that any review, disclosure, copying, distribution, retention, or any action taken or omitted to be taken in reliance on it is prohibited and may be unlawful. 

If you receive this communication in error, please notify us immediately by telephone call to +1-559-292-1981 or forward the e-mail to [email protected] and then permanently delete the e-mail and destroy all soft and hard copies of the message and any attachments. Thank you for your cooperation.
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[Index of Archives]     [Kernel Newbies]     [Netfilter]     [Bugtraq]     [Photo]     [Stuff]     [Gimp]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Video 4 Linux]     [Linux for the blind]     [Linux Resources]
  Powered by Linux