mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH 2.4] serial send_break duration fix
@ 2004-10-21 21:01 Paul Fulghum
  0 siblings, 0 replies; only message in thread
From: Paul Fulghum @ 2004-10-21 21:01 UTC (permalink / raw)
  To: Marcelo Tosatti; +Cc: linux-kernel

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: Paul Fulghum <paulkf@microgate.com>

-- 
Paul Fulghum
paulkf@microgate.com

--- linux-2.4.28-pre4/drivers/char/tty_io.c	2004-04-14 08:05:29.000000000 -0500
+++ b/drivers/char/tty_io.c	2004-10-21 15:55:40.516247240 -0500
@@ -1684,11 +1684,11 @@ static int tiocsetd(struct tty_struct *t
 
 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;



^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2004-10-21 21:01 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2004-10-21 21:01 [PATCH 2.4] serial send_break duration fix Paul Fulghum

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

Powered by JetHome