serial: tegra: Correct error handling sequence
PATCH 1/1 serial: tegra: Correct error handling sequence
From: kartik <[email protected]>
In the current error handling sequence the driver checks for break error at the end.
By handling the break error first, we can avoid a situation where the driver keeps processing the errors which can be caused by an unhandled break error.
--- drivers/tty/serial/serial-tegra.c | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-)
drivers/tty/serial/serial-tegra.c +13 -13
@@ -440,7 +440,19 @@ static char tegra_uart_decode_rx_error(struct tegra_uart_port *tup,char flag =TTY_NORMAL ;if (unlikely (lsr &TEGRA_UART_LSR_ANY )) { -if (lsr &UART_LSR_OE ) { +if (lsr &UART_LSR_BI ) { +/* +* Break error +* If FIFO read error without any data, reset Rx FIFO +*/ +if (!(lsr &UART_LSR_DR ) && (lsr &UART_LSR_FIFOE )) +tegra_uart_fifo_reset (tup,UART_FCR_CLEAR_RCVR ); +if (tup->uport.ignore_status_mask &UART_LSR_BI ) +return TTY_BREAK ; + flag =TTY_BREAK ; + tup->uport.icount.brk++; +dev_dbg (tup->uport.dev,"Got Break\n" ); + }else if (lsr &UART_LSR_OE ) {/* Overrrun error */ flag =TTY_OVERRUN ; tup->uport.icount.overrun++;
@@ -454,18 +466,6 @@ static char tegra_uart_decode_rx_error(struct tegra_uart_port *tup, flag =TTY_FRAME ; tup->uport.icount.frame++;dev_dbg (tup->uport.dev,"Got frame errors\n" ); - }else if (lsr &UART_LSR_BI ) { -/* -* Break error -* If FIFO read error without any data, reset Rx FIFO -*/ -if (!(lsr &UART_LSR_DR ) && (lsr &UART_LSR_FIFOE )) -tegra_uart_fifo_reset (tup,UART_FCR_CLEAR_RCVR ); -if (tup->uport.ignore_status_mask &UART_LSR_BI ) -return TTY_BREAK ; - flag =TTY_BREAK ; - tup->uport.icount.brk++; -dev_dbg (tup->uport.dev,"Got Break\n" ); }uart_insert_char (&tup->uport, lsr,UART_LSR_OE ,0 , flag); }
Signature · 1 line
2.7.4
Greg KH
maintainerQuoted 10 lines · Kartik
From: kartik <[email protected]>
In the current error handling sequence the driver checks for break error at the end.
By handling the break error first, we can avoid a situation where the driver keeps processing the errors which can be caused by an unhandled break error.
Signed-off-by kartik <[email protected]>
I need a full, legal name that you use to sign documents with. Is that this name?
Quoted 38 lines
--- drivers/tty/serial/serial-tegra.c | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-)drivers/tty/serial/serial-tegra.c +13
-6@@ -440,7 +440,19 @@ static char tegra_uart_decode_rx_error(struct tegra_uart_port *tup,char flag =TTY_NORMAL ;if (unlikely (lsr &TEGRA_UART_LSR_ANY )) { -if (lsr &UART_LSR_OE ) { +if (lsr &UART_LSR_BI ) { +/* +* Break error +* If FIFO read error without any data, reset Rx FIFO +*/ +if (!(lsr &UART_LSR_DR ) && (lsr &UART_LSR_FIFOE )) +tegra_uart_fifo_reset (tup,UART_FCR_CLEAR_RCVR ); +if (tup->uport.ignore_status_mask &UART_LSR_BI ) +return TTY_BREAK ; + flag =TTY_BREAK ; + tup->uport.icount.brk++; +dev_dbg (tup->uport.dev,"Got Break\n" ); + }else if (lsr &UART_LSR_OE ) {/* Overrrun error */ flag =TTY_OVERRUN ; tup->uport.icount.overrun++;@@ -454,18 +466,6 @@ static char tegra_uart_decode_rx_error(struct tegra_uart_port *tup, flag =TTY_FRAME ; tup->uport.icount.frame++;dev_dbg (tup->uport.dev,"Got frame errors\n" ); - }else if (lsr &UART_LSR_BI ) { -/* -* Break error -* If FIFO read error without any data, reset Rx FIFO -*/
drivers/tty/serial/serial-tegra.c static char tegra_uart_decode_rx_error(struct tegra_uart_port *tup, · line 471
Quoted 10 lines
drivers/tty/serial/serial-tegra.c +0
-7-if (!(lsr &UART_LSR_DR ) && (lsr &UART_LSR_FIFOE )) -tegra_uart_fifo_reset (tup,UART_FCR_CLEAR_RCVR ); -if (tup->uport.ignore_status_mask &UART_LSR_BI ) -return TTY_BREAK ; - flag =TTY_BREAK ; - tup->uport.icount.brk++; -dev_dbg (tup->uport.dev,"Got Break\n" ); }uart_insert_char (&tup->uport, lsr,UART_LSR_OE ,0 , flag); }
What commit does this fix?
thanks,
greg k-h