Linux Serial subsystem development
 help / color / mirror / Atom feed
From: Alan Cox <alan@lxorguk.ukuu.org.uk>
To: Jaeden Amero <jaeden.amero@ni.com>
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	linux-serial@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] n_tty: Don't lose characters when PARMRK is enabled
Date: Fri, 27 Jul 2012 14:09:31 +0100	[thread overview]
Message-ID: <20120727140931.19ed2bf4@pyramind.ukuu.org.uk> (raw)
In-Reply-To: <1343340751-1942-1-git-send-email-jaeden.amero@ni.com>

On Thu, 26 Jul 2012 17:12:31 -0500
Jaeden Amero <jaeden.amero@ni.com> wrote:

> When PARMRK is set and large transfers of characters that will get
> marked are being received, n_tty could drop data silently (i.e.
> without reporting any error to the client). This is because
> characters have the potential to take up to three bytes in the line
> discipline (when they get marked with parity or framing errors), but
> the amount of free space reported to tty_buffer flush_to_ldisc (via
> tty->receive_room) is based on the pre-marked data size.
> 
> With this patch, the n_tty layer will no longer assume that each byte
> will only take up one byte in the line discipline. Instead, it will
> make an overly conservative estimate that each byte will take up
> three bytes in the line discipline when PARMRK is set.
> 
> Signed-off-by: Jaeden Amero <jaeden.amero@ni.com>

What a fun corner case. Patch looks good to me.

Acked-by: Alan Cox <alan@linux.intel.com>

  reply	other threads:[~2012-07-27 13:05 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-07-26 22:12 [PATCH] n_tty: Don't lose characters when PARMRK is enabled Jaeden Amero
2012-07-27 13:09 ` Alan Cox [this message]
2012-07-27 13:43 ` Jaeden Amero

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=20120727140931.19ed2bf4@pyramind.ukuu.org.uk \
    --to=alan@lxorguk.ukuu.org.uk \
    --cc=gregkh@linuxfoundation.org \
    --cc=jaeden.amero@ni.com \
    --cc=linux-kernel@vger.kernel.org \
    --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