Commit 436aea02 authored by Paul Fulghum's avatar Paul Fulghum Committed by Linus Torvalds

[PATCH] serial send_break duration fix

Fix tty_io.c send_break() to assert break for proper duration.  If driver
break_ctl() changes task state, then break may end prematurely.  USB serial
driver break_ctl() sends a URB, changing task state to TASK_RUNNING.
Signed-off-by: default avatarPaul Fulghum <paulkf@microgate.com>
Signed-off-by: default avatarAndrew Morton <akpm@osdl.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@osdl.org>
parent 1d2921ea
......@@ -2148,11 +2148,11 @@ static int tiocsetd(struct tty_struct *tty, int __user *p)
static int send_break(struct tty_struct *tty, int duration)
{
set_current_state(TASK_INTERRUPTIBLE);
tty->driver->break_ctl(tty, -1);
if (!signal_pending(current))
if (!signal_pending(current)) {
set_current_state(TASK_INTERRUPTIBLE);
schedule_timeout(duration);
}
tty->driver->break_ctl(tty, 0);
if (signal_pending(current))
return -EINTR;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment