提交 6a72c7ba 编写于 作者: N Nishanth Aravamudan 提交者: Linus Torvalds

[PATCH] serial/68328serial: 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>
上级 5d582b4e
...@@ -992,18 +992,17 @@ static int get_lsr_info(struct m68k_serial * info, unsigned int *value) ...@@ -992,18 +992,17 @@ static int get_lsr_info(struct m68k_serial * info, unsigned int *value)
/* /*
* This routine sends a break character out the serial port. * This routine sends a break character out the serial port.
*/ */
static void send_break( struct m68k_serial * info, int duration) static void send_break(struct m68k_serial * info, unsigned int duration)
{ {
m68328_uart *uart = &uart_addr[info->line]; m68328_uart *uart = &uart_addr[info->line];
unsigned long flags; unsigned long flags;
if (!info->port) if (!info->port)
return; return;
set_current_state(TASK_INTERRUPTIBLE);
save_flags(flags); save_flags(flags);
cli(); cli();
#ifdef USE_INTS #ifdef USE_INTS
uart->utx.w |= UTX_SEND_BREAK; uart->utx.w |= UTX_SEND_BREAK;
schedule_timeout(duration); msleep_interruptible(duration);
uart->utx.w &= ~UTX_SEND_BREAK; uart->utx.w &= ~UTX_SEND_BREAK;
#endif #endif
restore_flags(flags); restore_flags(flags);
...@@ -1033,14 +1032,14 @@ static int rs_ioctl(struct tty_struct *tty, struct file * file, ...@@ -1033,14 +1032,14 @@ static int rs_ioctl(struct tty_struct *tty, struct file * file,
return retval; return retval;
tty_wait_until_sent(tty, 0); tty_wait_until_sent(tty, 0);
if (!arg) if (!arg)
send_break(info, HZ/4); /* 1/4 second */ send_break(info, 250); /* 1/4 second */
return 0; return 0;
case TCSBRKP: /* support for POSIX tcsendbreak() */ case TCSBRKP: /* support for POSIX tcsendbreak() */
retval = tty_check_change(tty); retval = tty_check_change(tty);
if (retval) if (retval)
return retval; return retval;
tty_wait_until_sent(tty, 0); tty_wait_until_sent(tty, 0);
send_break(info, arg ? arg*(HZ/10) : HZ/4); send_break(info, arg ? arg*(100) : 250);
return 0; return 0;
case TIOCGSOFTCAR: case TIOCGSOFTCAR:
error = put_user(C_CLOCAL(tty) ? 1 : 0, error = put_user(C_CLOCAL(tty) ? 1 : 0,
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册