Commit a8fbbeb8 authored by Domen Puncer's avatar Domen Puncer Committed by Linus Torvalds

[PATCH] char/sx: replace schedule_timeout() with msleep_interruptible()

Use msleep_interruptible() instead of schedule_timeout() to guarantee
consistent timing regardless of HZ value.  schedule_timeout(1) will vary
between 10 and 1 milliseconds, depending on the value of HZ (100 or 1000
respectively).  For consistent behavior, msleep_interruptible() should be
used.
Signed-off-by: default avatarNishanth Aravamudan <nacc@us.ibm.com>
Signed-off-by: default avatarDomen Puncer <domen@coderock.org>
Signed-off-by: default avatarAndrew Morton <akpm@osdl.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@osdl.org>
parent 6eeee1a9
......@@ -1515,13 +1515,9 @@ static void sx_close (void *ptr)
sx_reconfigure_port(port);
sx_send_command (port, HS_CLOSE, 0, 0);
while (to-- && (sx_read_channel_byte (port, hi_hstat) != HS_IDLE_CLOSED)) {
set_current_state(TASK_INTERRUPTIBLE);
schedule_timeout (1);
if (signal_pending (current))
break;
}
current->state = TASK_RUNNING;
while (to-- && (sx_read_channel_byte (port, hi_hstat) != HS_IDLE_CLOSED))
if (msleep_interruptible(10))
break;
if (sx_read_channel_byte (port, hi_hstat) != HS_IDLE_CLOSED) {
if (sx_send_command (port, HS_FORCE_CLOSED, -1, HS_IDLE_CLOSED) != 1) {
printk (KERN_ERR
......
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