]> git.proxmox.com Git - mirror_ubuntu-zesty-kernel.git/commit
USB: serial: ftdi_sio: fix extreme low-latency setting
authorJohan Hovold <johan@kernel.org>
Wed, 25 Jan 2017 14:35:20 +0000 (15:35 +0100)
committerTim Gardner <tim.gardner@canonical.com>
Wed, 1 Mar 2017 14:13:35 +0000 (07:13 -0700)
commit36c55ab3dd28d9fd63c1ba0ce875b0596afe30eb
tree5e82d111189562ca619abddbb9ddce78793fba41
parent38f4ea3f7fa13d3ffbdbb9f0e142691f1f514483
USB: serial: ftdi_sio: fix extreme low-latency setting

BugLink: http://bugs.launchpad.net/bugs/1668993
commit c6dce2626606ef16434802989466636bc28c1419 upstream.

Since commit 557aaa7ffab6 ("ft232: support the ASYNC_LOW_LATENCY
flag") the FTDI driver has been using a receive latency-timer value of
1 ms instead of the device default of 16 ms.

The latency timer is used to periodically empty a non-full receive
buffer, but a status header is always sent when the timer expires
including when the buffer is empty. This means that a two-byte bulk
message is received every millisecond also for an otherwise idle port as
long as it is open.

Let's restore the pre-2009 behaviour which reduces the rate of the
status messages to 1/16th (e.g. interrupt frequency drops from 1 kHz to
62.5 Hz) by not setting ASYNC_LOW_LATENCY by default.

Anyone willing to pay the price for the minimum-latency behaviour should
set the flag explicitly instead using the TIOCSSERIAL ioctl or a tool
such as setserial (e.g. setserial /dev/ttyUSB0 low_latency).

Note that since commit 0cbd81a9f6ba ("USB: ftdi_sio: remove
tty->low_latency") the ASYNC_LOW_LATENCY flag has no other effects but
to set a minimal latency timer.

Reported-by: Antoine Aubert <a.aubert@overkiz.com>
Fixes: 557aaa7ffab6 ("ft232: support the ASYNC_LOW_LATENCY flag")
Signed-off-by: Johan Hovold <johan@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Tim Gardner <tim.gardner@canonical.com>
drivers/usb/serial/ftdi_sio.c