summaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorDomen Puncer <domen@coderock.org>2005-06-25 23:58:42 +0200
committerLinus Torvalds <torvalds@ppc970.osdl.org>2005-06-26 01:24:58 +0200
commitb20f3ae5f0efe1812d2a1278e2127a335884d445 (patch)
tree7865a5e6e99ea4acc20844a95947110a768e69b1 /drivers
parent[PATCH] char/ds1620: use msleep() instead of schedule_timeout() (diff)
downloadlinux-b20f3ae5f0efe1812d2a1278e2127a335884d445.tar.xz
linux-b20f3ae5f0efe1812d2a1278e2127a335884d445.zip
[PATCH] char/tty_io: 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. Patch is compile-tested. 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>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/char/tty_io.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/drivers/char/tty_io.c b/drivers/char/tty_io.c
index cc4b43bad703..6e4be3bb2d89 100644
--- a/drivers/char/tty_io.c
+++ b/drivers/char/tty_io.c
@@ -94,6 +94,7 @@
#include <linux/idr.h>
#include <linux/wait.h>
#include <linux/bitops.h>
+#include <linux/delay.h>
#include <asm/uaccess.h>
#include <asm/system.h>
@@ -2180,12 +2181,11 @@ static int tiocsetd(struct tty_struct *tty, int __user *p)
return tty_set_ldisc(tty, ldisc);
}
-static int send_break(struct tty_struct *tty, int duration)
+static int send_break(struct tty_struct *tty, unsigned int duration)
{
tty->driver->break_ctl(tty, -1);
if (!signal_pending(current)) {
- set_current_state(TASK_INTERRUPTIBLE);
- schedule_timeout(duration);
+ msleep_interruptible(duration);
}
tty->driver->break_ctl(tty, 0);
if (signal_pending(current))
@@ -2366,10 +2366,10 @@ int tty_ioctl(struct inode * inode, struct file * file,
* all by anyone?
*/
if (!arg)
- return send_break(tty, HZ/4);
+ return send_break(tty, 250);
return 0;
case TCSBRKP: /* support for POSIX tcsendbreak() */
- return send_break(tty, arg ? arg*(HZ/10) : HZ/4);
+ return send_break(tty, arg ? arg*100 : 250);
case TIOCMGET:
return tty_tiocmget(tty, file, p);