From: Micon, David Date: Sat, 20 May 2006 21:59:59 +0000 (-0700) Subject: [PATCH] HID read busywait fix X-Git-Tag: v2.6.17-rc5~67 X-Git-Url: https://err.no/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=48d705522da4fa04bb0169a7ca3c9ab92e28b613;p=linux-2.6 [PATCH] HID read busywait fix Make 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. Cc: Greg KH Acked-by: Vojtech Pavlik Cc: Dmitry Torokhov Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- diff --git a/drivers/usb/input/hiddev.c b/drivers/usb/input/hiddev.c index 6dd6666961..c4670e1d46 100644 --- a/drivers/usb/input/hiddev.c +++ b/drivers/usb/input/hiddev.c @@ -317,6 +317,7 @@ static ssize_t hiddev_read(struct file * file, char __user * buffer, size_t coun } schedule(); + set_current_state(TASK_INTERRUPTIBLE); } set_current_state(TASK_RUNNING);