[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: Nishanth Aravamudan <nacc@us.ibm.com>
Signed-off-by: Domen Puncer <domen@coderock.org>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>

authored by Nishanth Aravamudan and committed by Linus Torvalds 6a72c7ba 5d582b4e

+4 -5
+4 -5
drivers/serial/68328serial.c
··· 992 992 /* 993 993 * This routine sends a break character out the serial port. 994 994 */ 995 - static void send_break( struct m68k_serial * info, int duration) 995 + static void send_break(struct m68k_serial * info, unsigned int duration) 996 996 { 997 997 m68328_uart *uart = &uart_addr[info->line]; 998 998 unsigned long flags; 999 999 if (!info->port) 1000 1000 return; 1001 - set_current_state(TASK_INTERRUPTIBLE); 1002 1001 save_flags(flags); 1003 1002 cli(); 1004 1003 #ifdef USE_INTS 1005 1004 uart->utx.w |= UTX_SEND_BREAK; 1006 - schedule_timeout(duration); 1005 + msleep_interruptible(duration); 1007 1006 uart->utx.w &= ~UTX_SEND_BREAK; 1008 1007 #endif 1009 1008 restore_flags(flags); ··· 1032 1033 return retval; 1033 1034 tty_wait_until_sent(tty, 0); 1034 1035 if (!arg) 1035 - send_break(info, HZ/4); /* 1/4 second */ 1036 + send_break(info, 250); /* 1/4 second */ 1036 1037 return 0; 1037 1038 case TCSBRKP: /* support for POSIX tcsendbreak() */ 1038 1039 retval = tty_check_change(tty); 1039 1040 if (retval) 1040 1041 return retval; 1041 1042 tty_wait_until_sent(tty, 0); 1042 - send_break(info, arg ? arg*(HZ/10) : HZ/4); 1043 + send_break(info, arg ? arg*(100) : 250); 1043 1044 return 0; 1044 1045 case TIOCGSOFTCAR: 1045 1046 error = put_user(C_CLOCAL(tty) ? 1 : 0,