Skip to content

Commit bf9f610

Browse files
Anirudha SarangiMichal Simek
authored andcommitted
serial: xuartps: Do not enable parity error interrupt
The patch makes changes not to enable parity error interrupt. With the current implementation, each parity error results in two distinct interrupts (almost always). The first one is normal parity error interrupt with no data in the fifo and the second one is a proper Rx interrupt with the received data in the fifo. By disabling parity error interrupt we still ensure handling of parity errors as for the Rx fifo interrupt the parity error still shows up in the interrupt status register. Considering the fact that the by default INPCK and IGNPAR are not set, this is the optimal implementation for parity error handling. Signed-off-by: Anirudha Sarangi <anirudh@xilinx.com> Signed-off-by: Michal Simek <michal.simek@xilinx.com>
1 parent 8c94fe7 commit bf9f610

1 file changed

Lines changed: 12 additions & 2 deletions

File tree

‎drivers/tty/serial/xilinx_uartps.c‎

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -803,8 +803,18 @@ static int cdns_uart_startup(struct uart_port *port)
803803
cdns_uart_writel(cdns_uart_readl(CDNS_UART_ISR_OFFSET),
804804
CDNS_UART_ISR_OFFSET);
805805

806-
/* Set the Interrupt Registers with desired interrupts */
807-
cdns_uart_writel(CDNS_UART_IXR_TXEMPTY | CDNS_UART_IXR_PARITY |
806+
/*
807+
* Set the Interrupt Registers with desired interrupts. Do not
808+
* enable parity error interrupt for the following reason:
809+
* When parity error interrupt is enabled, each Rx parity error always
810+
* results in 2 events. The first one being parity error interrupt
811+
* and the second one with a proper Rx interrupt with the incoming data.
812+
* Disabling parity error interrupt ensures better handling of parity
813+
* error events. With this change, for a parity error case, we get a
814+
* Rx interrupt with parity error set in ISR register and we still
815+
* handle parity errors in the desired way.
816+
*/
817+
cdns_uart_writel(CDNS_UART_IXR_TXEMPTY |
808818
CDNS_UART_IXR_FRAMING | CDNS_UART_IXR_OVERRUN |
809819
CDNS_UART_IXR_RXTRIG | CDNS_UART_IXR_TOUT,
810820
CDNS_UART_IER_OFFSET);

0 commit comments

Comments
 (0)