linux-serial.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Eugene Bordenkircher <eugebo@gmail.com>
Cc: linux-serial@vger.kernel.org
Subject: Ordering problem in serial_core.c
Date: Thu, 22 Oct 2009 09:19:41 -0700 (PDT)	[thread overview]
Message-ID: <cc845bea-0a4c-4958-b317-6b95120031a3@w37g2000prg.googlegroups.com> (raw)

There is an ordering problem with closing a UART in the serial core.
If the line discipline is throttling the port when close is called, it
tries to unthrottle the port which, in the case of soft flow, tries to
send the XON character.  This doesn't work well since at this point
the uart has been shutdown.

The simple reordering shown below will seems to fix the problem, but
please comment if there are other side effects I am not seeing.

Eugene T. Bordenkircher

--- linux_kernel/drivers/serial/serial_core.c.orig	2009-08-13
14:58:04.000000000 -0700
+++ linux_kernel/drivers/serial/serial_core.c	2009-08-13
15:29:02.000000000 -0700
@@ -1317,11 +1317,11 @@
 		uart_wait_until_sent(tty, port->timeout);
 	}

+	tty_ldisc_flush(tty);
+
 	uart_shutdown(state);
 	uart_flush_buffer(tty);

-	tty_ldisc_flush(tty);
-
 	tty->closing = 0;
 	state->info.port.tty = NULL;

                 reply	other threads:[~2009-10-22 17:36 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=cc845bea-0a4c-4958-b317-6b95120031a3@w37g2000prg.googlegroups.com \
    --to=eugebo@gmail.com \
    --cc=linux-serial@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).