[PATCH] to make HID read block

From: Micon, David
Date: Mon May 15 2006 - 20:16:32 EST


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.

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);



Signed-off-by: David Micon dmicon@xxxxxxxxx


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 administrator@xxxxxxxxx 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 majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/