projects/linux·commit 48d70552

[PATCH] HID read busywait fix

48d70552 · Micon, David <[email protected]> · 2006-05-20 14:59:59 -07:00

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 <[email protected]>
Acked-by: Vojtech Pavlik <[email protected]>
Cc: Dmitry Torokhov <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
Commit
48d705522da4fa04bb0169a7ca3c9ab92e28b613
Parents
9ccfc29c

Changes

1 files changed · +1 −0

FileStatusAddDelContent
drivers/usb/input/hiddev.cmodified+1−0View file

drivers/usb/input/hiddev.c

View file
diff --git a/drivers/usb/input/hiddev.c b/drivers/usb/input/hiddev.c
index 6dd6666..c4670e1 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);