Skip to content

Commit b6727b8

Browse files
jhovoldgregkh
authored andcommitted
serial: tegra: fix CREAD handling for PIO
commit b374c56 upstream. Commit 33ae787 ("serial: tegra: add support to ignore read") added support for dropping input in case CREAD isn't set, but for PIO the ignore_status_mask wasn't checked until after the character had been put in the receive buffer. Note that the NULL tty-port test is bogus and will be removed by a follow-on patch. Fixes: 33ae787 ("serial: tegra: add support to ignore read") Cc: stable <[email protected]> # 5.4 Cc: Shardar Shariff Md <[email protected]> Cc: Krishna Yarlagadda <[email protected]> Signed-off-by: Johan Hovold <[email protected]> Acked-by: Thierry Reding <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Greg Kroah-Hartman <[email protected]>
1 parent fed64b9 commit b6727b8

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

drivers/tty/serial/serial-tegra.c

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -653,11 +653,14 @@ static void tegra_uart_handle_rx_pio(struct tegra_uart_port *tup,
653653
ch = (unsigned char) tegra_uart_read(tup, UART_RX);
654654
tup->uport.icount.rx++;
655655

656-
if (!uart_handle_sysrq_char(&tup->uport, ch) && tty)
657-
tty_insert_flip_char(tty, ch, flag);
656+
if (uart_handle_sysrq_char(&tup->uport, ch))
657+
continue;
658658

659659
if (tup->uport.ignore_status_mask & UART_LSR_DR)
660660
continue;
661+
662+
if (tty)
663+
tty_insert_flip_char(tty, ch, flag);
661664
} while (1);
662665
}
663666

0 commit comments

Comments
 (0)