Skip to content

Commit a308189

Browse files
Anirudha Sarangigregkh
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> [stelford@cadence.com: cherry picked from https://github.com/Xilinx/linux-xlnx commit bf9f610 with manual conflict resolution] Signed-off-by: Scott Telford <stelford@cadence.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
1 parent 87f1f80 commit a308189

1 file changed

Lines changed: 15 additions & 2 deletions

File tree

‎drivers/tty/serial/xilinx_uartps.c‎

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -130,8 +130,21 @@ MODULE_PARM_DESC(rx_timeout, "Rx timeout, 1-255");
130130
#define CDNS_UART_IXR_RXEMPTY 0x00000002 /* RX FIFO empty interrupt. */
131131
#define CDNS_UART_IXR_MASK 0x00001FFF /* Valid bit mask */
132132

133-
#define CDNS_UART_RX_IRQS (CDNS_UART_IXR_PARITY | CDNS_UART_IXR_FRAMING | \
134-
CDNS_UART_IXR_OVERRUN | CDNS_UART_IXR_RXTRIG | \
133+
/*
134+
* Do not enable parity error interrupt for the following
135+
* reason: When parity error interrupt is enabled, each Rx
136+
* parity error always results in 2 events. The first one
137+
* being parity error interrupt and the second one with a
138+
* proper Rx interrupt with the incoming data. Disabling
139+
* parity error interrupt ensures better handling of parity
140+
* error events. With this change, for a parity error case, we
141+
* get a Rx interrupt with parity error set in ISR register
142+
* and we still handle parity errors in the desired way.
143+
*/
144+
145+
#define CDNS_UART_RX_IRQS (CDNS_UART_IXR_FRAMING | \
146+
CDNS_UART_IXR_OVERRUN | \
147+
CDNS_UART_IXR_RXTRIG | \
135148
CDNS_UART_IXR_TOUT)
136149

137150
/* Goes in read_status_mask for break detection as the HW doesn't do it*/

0 commit comments

Comments
 (0)