patch "USB: serial: ftdi_sio: fix line-status over-reporting" added to usb-testing
Subsystems (3)
This is a note to let you know that I've just added the patch titled
USB: serial: ftdi_sio: fix line-status over-reporting
to my usb git tree which can be found at
git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb.git
in the usb-testing branch.
The patch will show up in the next release of the linux-next tree (usually sometime within the next 24 hours during the week.)
The patch will be merged to the usb-next branch sometime soon, after it passes testing, and the merge window is open.
If you have any questions about this process, please let me know.
Quoted 1 line
From
a6bb1e17a39818b01b55d8e6238b4b5f06d55038Mon Sep 17 00:00:00 2001
From: Johan Hovold <[email protected]>
Date: Thu, 2 Feb 2017 17:38:35 +0100
Subject: USB: serial: ftdi_sio: fix line-status over-reporting
FTDI devices use a receive latency timer to periodically empty the receive buffer and report modem and line status (also when the buffer is empty).
When a break or error condition is detected the corresponding status flags will be set on a packet with nonzero data payload and the flags are not updated until the break is over or further characters are received.
In order to avoid over-reporting break and error conditions, these flags must therefore only be processed for packets with payload.
This specifically fixes the case where after an overrun, the error condition is continuously reported and NULL-characters inserted until further data is received.
break")
--- drivers/usb/serial/ftdi_sio.c | 23 ++++++++++++++--------- 1 file changed, 14 insertions(+), 9 deletions(-)
drivers/usb/serial/ftdi_sio.c +14 -9
@@ -2068,6 +2068,20 @@ static int ftdi_process_packet(struct usb_serial_port *port, priv->prev_status = status; } +/* save if the transmitter is empty or not */ +if (packet[1 ] &FTDI_RS_TEMT ) + priv->transmit_empty =1 ; +else + priv->transmit_empty =0 ; + + len -=2 ; +if (!len) +return 0 ;/* status only */ + +/* +* Break and error status must only be processed for packets with +* data payload to avoid over-reporting. +*/ flag =TTY_NORMAL ;if (packet[1 ] &FTDI_RS_ERR_MASK ) {/* Break takes precedence over parity, which takes precedence
@@ -2090,15 +2104,6 @@ static int ftdi_process_packet(struct usb_serial_port *port, } } -/* save if the transmitter is empty or not */ -if (packet[1 ] &FTDI_RS_TEMT ) - priv->transmit_empty =1 ; -else - priv->transmit_empty =0 ; - - len -=2 ; -if (!len) -return 0 ;/* status only */ port->icount.rx += len; ch = packet +2 ;
Signature · 1 line
2.11.1