diff options
author | Nishanth Aravamudan <nacc@us.ibm.com> | 2005-06-25 17:59:32 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@ppc970.osdl.org> | 2005-06-25 19:25:10 -0400 |
commit | 5d582b4ef6df853ca2da46135855cd6536c0205b (patch) | |
tree | 4e1a42e132967f5aab8c26a11810e6b06a95fb92 | |
parent | f353488ce48e7a0311fe764284096481b455fbe9 (diff) |
[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>
-rw-r--r-- | drivers/serial/68360serial.c | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/drivers/serial/68360serial.c b/drivers/serial/68360serial.c index f148022b6b4e..b116122e569a 100644 --- a/drivers/serial/68360serial.c +++ b/drivers/serial/68360serial.c | |||
@@ -1394,14 +1394,13 @@ static void end_break(ser_info_t *info) | |||
1394 | /* | 1394 | /* |
1395 | * This routine sends a break character out the serial port. | 1395 | * This routine sends a break character out the serial port. |
1396 | */ | 1396 | */ |
1397 | static void send_break(ser_info_t *info, int duration) | 1397 | static void send_break(ser_info_t *info, unsigned int duration) |
1398 | { | 1398 | { |
1399 | set_current_state(TASK_INTERRUPTIBLE); | ||
1400 | #ifdef SERIAL_DEBUG_SEND_BREAK | 1399 | #ifdef SERIAL_DEBUG_SEND_BREAK |
1401 | printk("rs_send_break(%d) jiff=%lu...", duration, jiffies); | 1400 | printk("rs_send_break(%d) jiff=%lu...", duration, jiffies); |
1402 | #endif | 1401 | #endif |
1403 | begin_break(info); | 1402 | begin_break(info); |
1404 | schedule_timeout(duration); | 1403 | msleep_interruptible(duration); |
1405 | end_break(info); | 1404 | end_break(info); |
1406 | #ifdef SERIAL_DEBUG_SEND_BREAK | 1405 | #ifdef SERIAL_DEBUG_SEND_BREAK |
1407 | printk("done jiffies=%lu\n", jiffies); | 1406 | printk("done jiffies=%lu\n", jiffies); |
@@ -1436,7 +1435,7 @@ static int rs_360_ioctl(struct tty_struct *tty, struct file * file, | |||
1436 | if (signal_pending(current)) | 1435 | if (signal_pending(current)) |
1437 | return -EINTR; | 1436 | return -EINTR; |
1438 | if (!arg) { | 1437 | if (!arg) { |
1439 | send_break(info, HZ/4); /* 1/4 second */ | 1438 | send_break(info, 250); /* 1/4 second */ |
1440 | if (signal_pending(current)) | 1439 | if (signal_pending(current)) |
1441 | return -EINTR; | 1440 | return -EINTR; |
1442 | } | 1441 | } |
@@ -1448,7 +1447,7 @@ static int rs_360_ioctl(struct tty_struct *tty, struct file * file, | |||
1448 | tty_wait_until_sent(tty, 0); | 1447 | tty_wait_until_sent(tty, 0); |
1449 | if (signal_pending(current)) | 1448 | if (signal_pending(current)) |
1450 | return -EINTR; | 1449 | return -EINTR; |
1451 | send_break(info, arg ? arg*(HZ/10) : HZ/4); | 1450 | send_break(info, arg ? arg*100 : 250); |
1452 | if (signal_pending(current)) | 1451 | if (signal_pending(current)) |
1453 | return -EINTR; | 1452 | return -EINTR; |
1454 | return 0; | 1453 | return 0; |