[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: 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 5d582b4e f353488c

+4 -5
+4 -5
drivers/serial/68360serial.c
··· 1394 /* 1395 * This routine sends a break character out the serial port. 1396 */ 1397 - static void send_break(ser_info_t *info, int duration) 1398 { 1399 - set_current_state(TASK_INTERRUPTIBLE); 1400 #ifdef SERIAL_DEBUG_SEND_BREAK 1401 printk("rs_send_break(%d) jiff=%lu...", duration, jiffies); 1402 #endif 1403 begin_break(info); 1404 - schedule_timeout(duration); 1405 end_break(info); 1406 #ifdef SERIAL_DEBUG_SEND_BREAK 1407 printk("done jiffies=%lu\n", jiffies); ··· 1435 if (signal_pending(current)) 1436 return -EINTR; 1437 if (!arg) { 1438 - send_break(info, HZ/4); /* 1/4 second */ 1439 if (signal_pending(current)) 1440 return -EINTR; 1441 } ··· 1447 tty_wait_until_sent(tty, 0); 1448 if (signal_pending(current)) 1449 return -EINTR; 1450 - send_break(info, arg ? arg*(HZ/10) : HZ/4); 1451 if (signal_pending(current)) 1452 return -EINTR; 1453 return 0;
··· 1394 /* 1395 * This routine sends a break character out the serial port. 1396 */ 1397 + static void send_break(ser_info_t *info, unsigned int duration) 1398 { 1399 #ifdef SERIAL_DEBUG_SEND_BREAK 1400 printk("rs_send_break(%d) jiff=%lu...", duration, jiffies); 1401 #endif 1402 begin_break(info); 1403 + msleep_interruptible(duration); 1404 end_break(info); 1405 #ifdef SERIAL_DEBUG_SEND_BREAK 1406 printk("done jiffies=%lu\n", jiffies); ··· 1436 if (signal_pending(current)) 1437 return -EINTR; 1438 if (!arg) { 1439 + send_break(info, 250); /* 1/4 second */ 1440 if (signal_pending(current)) 1441 return -EINTR; 1442 } ··· 1448 tty_wait_until_sent(tty, 0); 1449 if (signal_pending(current)) 1450 return -EINTR; 1451 + send_break(info, arg ? arg*100 : 250); 1452 if (signal_pending(current)) 1453 return -EINTR; 1454 return 0;