Skip to content

Commit

Permalink
[PATCH] HID read busywait fix
Browse files Browse the repository at this point in the history
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 <greg@kroah.com>
Acked-by: Vojtech Pavlik <vojtech@suse.cz>
Cc: Dmitry Torokhov <dtor_core@ameritech.net>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
  • Loading branch information
Micon, David authored and Linus Torvalds committed May 21, 2006
1 parent 9ccfc29 commit 48d7055
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions drivers/usb/input/hiddev.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit 48d7055

Please sign in to comment.