提交 5d582b4e 编写于 作者: N Nishanth Aravamudan 提交者: Linus Torvalds

[PATCH] serial/68360serial: replace schedule_timeout() with msleep_interruptible()

Use msleep_interruptible() instead of schedule_timeout() in send_break() to
guarantee the task delays as expected.  Change @duration's units to
milliseconds, and modify arguments in callers appropriately.
Signed-off-by: NNishanth Aravamudan <nacc@us.ibm.com>
Signed-off-by: NDomen Puncer <domen@coderock.org>
Signed-off-by: NAndrew Morton <akpm@osdl.org>
Signed-off-by: NLinus Torvalds <torvalds@osdl.org>
上级 f353488c
...@@ -1394,14 +1394,13 @@ static void end_break(ser_info_t *info) ...@@ -1394,14 +1394,13 @@ static void end_break(ser_info_t *info)
/* /*
* This routine sends a break character out the serial port. * This routine sends a break character out the serial port.
*/ */
static void send_break(ser_info_t *info, int duration) static void send_break(ser_info_t *info, unsigned int duration)
{ {
set_current_state(TASK_INTERRUPTIBLE);
#ifdef SERIAL_DEBUG_SEND_BREAK #ifdef SERIAL_DEBUG_SEND_BREAK
printk("rs_send_break(%d) jiff=%lu...", duration, jiffies); printk("rs_send_break(%d) jiff=%lu...", duration, jiffies);
#endif #endif
begin_break(info); begin_break(info);
schedule_timeout(duration); msleep_interruptible(duration);
end_break(info); end_break(info);
#ifdef SERIAL_DEBUG_SEND_BREAK #ifdef SERIAL_DEBUG_SEND_BREAK
printk("done jiffies=%lu\n", jiffies); printk("done jiffies=%lu\n", jiffies);
...@@ -1436,7 +1435,7 @@ static int rs_360_ioctl(struct tty_struct *tty, struct file * file, ...@@ -1436,7 +1435,7 @@ static int rs_360_ioctl(struct tty_struct *tty, struct file * file,
if (signal_pending(current)) if (signal_pending(current))
return -EINTR; return -EINTR;
if (!arg) { if (!arg) {
send_break(info, HZ/4); /* 1/4 second */ send_break(info, 250); /* 1/4 second */
if (signal_pending(current)) if (signal_pending(current))
return -EINTR; return -EINTR;
} }
...@@ -1448,7 +1447,7 @@ static int rs_360_ioctl(struct tty_struct *tty, struct file * file, ...@@ -1448,7 +1447,7 @@ static int rs_360_ioctl(struct tty_struct *tty, struct file * file,
tty_wait_until_sent(tty, 0); tty_wait_until_sent(tty, 0);
if (signal_pending(current)) if (signal_pending(current))
return -EINTR; return -EINTR;
send_break(info, arg ? arg*(HZ/10) : HZ/4); send_break(info, arg ? arg*100 : 250);
if (signal_pending(current)) if (signal_pending(current))
return -EINTR; return -EINTR;
return 0; return 0;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册