From: Felipe Balbi <felipe.balbi@nokia.com>
To: ext Alan Cox <alan@lxorguk.ukuu.org.uk>
Cc: "Balbi Felipe (Nokia-D/Helsinki)" <felipe.balbi@nokia.com>,
Linux Kernel Mailing List <linux-kernel@vger.kernel.org>,
"dbrownell@users.sourceforge.net"
<dbrownell@users.sourceforge.net>
Subject: Re: TTY loosing bytes ?
Date: Tue, 6 Oct 2009 16:27:53 +0300 [thread overview]
Message-ID: <20091006132752.GZ4452@nokia.com> (raw)
In-Reply-To: <20091006141115.12ad22dd@lxorguk.ukuu.org.uk>
On Tue, Oct 06, 2009 at 03:11:15PM +0200, ext Alan Cox wrote:
> > With the patch above I still get this messages but it still goes through
> > since not receive_buf is returning the amount of bytes actually
> > received. Then flush_to_ldisc() will retry those bytes on the next
> > iteration. Maybe this is not the desired patch though ?
> >
> > Thanks a lot for the comments Alan.
>
> First guess try the following
>
> n_tty: For some I/O patterns n_tty will lose bytes
>
> From: Alan Cox <alan@linux.intel.com>
>
> Fix the obvious disagreement between the receive path and the receive room
> logic.
>
> Signed-off-by: Alan Cox <alan@linux.intel.com>
> ---
>
> drivers/char/n_tty.c | 3 +++
> 1 files changed, 3 insertions(+), 0 deletions(-)
>
>
> diff --git a/drivers/char/n_tty.c b/drivers/char/n_tty.c
> index 2e50f4d..27b28ca 100644
> --- a/drivers/char/n_tty.c
> +++ b/drivers/char/n_tty.c
> @@ -95,6 +95,9 @@ static void n_tty_set_room(struct tty_struct *tty)
> /* tty->read_cnt is not read locked ? */
> int left = N_TTY_BUF_SIZE - tty->read_cnt - 1;
>
> + if (tty->real_raw)
> + left = min(left, N_TTY_BUF_SIZE - tty->read_head - 1);
> +
> /*
> * If we are doing input canonicalization, and there are no
> * pending newlines, let characters through without limit, so
unfortunately it didn't work. Although now I don't the debugging prints
complaining we've lost bytes, the transfer does get stuck in lot earlier
stage.
Maybe this is one fix but there's still other problem with that code ?
--
balbi
next prev parent reply other threads:[~2009-10-06 13:31 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-10-06 9:48 Felipe Balbi
2009-10-06 11:45 ` Felipe Balbi
2009-10-06 12:12 ` Alan Cox
2009-10-06 13:01 ` Felipe Balbi
2009-10-06 13:11 ` Alan Cox
2009-10-06 13:27 ` Felipe Balbi [this message]
2009-10-06 13:40 ` Alan Cox
2009-10-06 13:42 ` Felipe Balbi
2009-10-06 13:55 ` Felipe Balbi
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=20091006132752.GZ4452@nokia.com \
--to=felipe.balbi@nokia.com \
--cc=alan@lxorguk.ukuu.org.uk \
--cc=dbrownell@users.sourceforge.net \
--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
Powered by JetHome