Commit bd8a148a authored by Nishanth Aravamudan's avatar Nishanth Aravamudan Committed by Greg Kroah-Hartman

[PATCH] usb/hid-core: add set_current_state() before schedule_timeout()

Add set_current_state() before schedule_timeout() so that the task
delays as expected. Without the addition, schedule_timeout() will return
immediately on subsequent iterations of the while-loop.
Signed-off-by: default avatarGreg Kroah-Hartman <greg@kroah.com>
parent 0ae8fe6f
......@@ -1258,8 +1258,10 @@ int hid_wait_io(struct hid_device *hid)
add_wait_queue(&hid->wait, &wait);
while (timeout && (test_bit(HID_CTRL_RUNNING, &hid->iofl) ||
test_bit(HID_OUT_RUNNING, &hid->iofl)))
test_bit(HID_OUT_RUNNING, &hid->iofl))) {
set_current_state(TASK_UNINTERRUPTIBLE);
timeout = schedule_timeout(timeout);
}
set_current_state(TASK_RUNNING);
remove_wait_queue(&hid->wait, &wait);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment