mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Matthias Goebl <matthias@goebl.net>
To: Linux Kernel Mailing List <linux-kernel@vger.kernel.org>
Cc: kkeil@suse.de, kai.germaschewski@gmx.de
Subject: [PATCH] isdn/i4l: 'NO CARRIER' message lost after ldisc flush
Date: Thu, 3 Jan 2008 23:00:39 +0100	[thread overview]
Message-ID: <20080103220039.GV19071@night.goebl.net> (raw)
In-Reply-To: <1178571957.3665.8.camel@amdx2.microgate.com>

The ISDN tty layer doesn't produce a 'NO CARRIER' message after hangup.

I suppose it broke when tty_buffer_flush() has been added to
tty_ldisc_flush() in the commit below.

For isdn_tty_modem_result(RESULT_NO_CARRIER..) the
message inserted via isdn_tty_at_cout() -> tty_insert_flip_char()
is flushed immediately by tty_ldisc_flush() -> tty_buffer_flush().
More annoyingly, the audio abort sequence DLE-ETX is also lost.

This patch fixes only active audio connections, because I assume that nobody
changes the line discipline for audio.

For non-audio connections the problem remains.
Maybe we can remove the tty_ldisc_flush() in isdn_tty_modem_result()
at all because it's done at tty_close?


On Mon, May 07, 2007 at 04:05:57PM -0500, Paul Fulghum wrote:
> Flush the tty flip buffer when the line discipline
> input queue is flushed, including the user call
> tcflush(TCIFLUSH/TCIOFLUSH). This prevents unexpected
> stale data after a user application calls tcflush().
> 
> Cc: Alan Cox <alan@lxorguk.org.uk>
> Cc: Antonino Ingargiola <tritemio@gmail.com>
> Signed-off-by: Paul Fulghum <paulkf@microgate.com>
> 
> --- a/drivers/char/tty_io.c	2007-05-04 05:46:55.000000000 -0500
> +++ b/drivers/char/tty_io.c	2007-05-05 03:23:46.000000000 -0500
> @@ -1240,6 +1263,7 @@ void tty_ldisc_flush(struct tty_struct *
>  			ld->flush_buffer(tty);
>  		tty_ldisc_deref(ld);
>  	}
> +	tty_buffer_flush(tty);
[..]


Signed-off-by: Matthias Goebl <matthias.goebl@goebl.net>

--- linux-2.6.23.12.orig/drivers/isdn/i4l/isdn_tty.c	
+++ linux-2.6.23.12/drivers/isdn/i4l/isdn_tty.c	
@@ -2645,7 +2649,12 @@
 		if ((info->flags & ISDN_ASYNC_CLOSING) || (!info->tty)) {
 			return;
 		}
+#ifdef CONFIG_ISDN_AUDIO
+		if ( !info->vonline )
+			tty_ldisc_flush(info->tty);
+#else
 		tty_ldisc_flush(info->tty);
+#endif
 		if ((info->flags & ISDN_ASYNC_CHECK_CD) &&
 		    (!((info->flags & ISDN_ASYNC_CALLOUT_ACTIVE) &&
 		       (info->flags & ISDN_ASYNC_CALLOUT_NOHUP)))) {

  reply	other threads:[~2008-01-03 22:25 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-05-07 21:05 [PATCH] tty flush flip buffer on ldisc input queue flush Paul Fulghum
2008-01-03 22:00 ` Matthias Goebl [this message]
2008-01-03 22:30   ` [PATCH] isdn/i4l: 'NO CARRIER' message lost after ldisc flush Alan Cox
2008-01-04 10:19     ` David Miller

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=20080103220039.GV19071@night.goebl.net \
    --to=matthias@goebl.net \
    --cc=kai.germaschewski@gmx.de \
    --cc=kkeil@suse.de \
    --cc=linux-kernel@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

all inboxes | Powered by JetHome®