]> git.baikalelectronics.ru Git - kernel.git/commit
n_tty: Fix PARMRK over-throttling
authorPeter Hurley <peter@hurleysoftware.com>
Fri, 16 Jan 2015 20:05:38 +0000 (15:05 -0500)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 2 Feb 2015 18:11:26 +0000 (10:11 -0800)
commita1a02c0b3b2d6325e51e221413b615c56aa9eb64
tree1d8031d62ef5ab2c86a68f99c4583452ce10866e
parent05bcb33f8462067c6728feb1dcbda31f7de5b5e5
n_tty: Fix PARMRK over-throttling

If PARMRK is enabled, the available read buffer space computation is
overly-pessimistic, which results in severely throttled i/o, even
in the absence of parity errors. For example, if the 4k read buffer
contains 1k processed data, the input worker will compute available
space of 333 bytes, despite 3k being available. At 1365 chars of
processed data, 0 space available is computed.

*Divide remaining space* by 3, truncating down (if left == 2, left = 0).

Reported-by: Christian Riesch <christian.riesch@omicron.at>
Conflicts:
drivers/tty/n_tty.c

Signed-off-by: Peter Hurley <peter@hurleysoftware.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/tty/n_tty.c