> -----Original Message----- > From: Robert Hodaszi <robert.hodaszi@xxxxxxxx> > Sent: 2023年6月7日 18:35 > To: gregkh@xxxxxxxxxxxxxxxxxxx; jirislaby@xxxxxxxxxx; linux- > serial@xxxxxxxxxxxxxxx; Sherry Sun <sherry.sun@xxxxxxx> > Cc: Robert Hodaszi <robert.hodaszi@xxxxxxxx> > Subject: [PATCH] Revert "tty: serial: fsl_lpuart: Fix the wrong RXWATER > setting for rx dma case" > > This reverts commit 9ad9df8447547febe9dd09b040f4528a09e495f0. > > LSUART's datasheet incorrectly states that RXWATER must be greater than 0. > Having that set to 1 is causing a one character delay on the receive path. > > Signed-off-by: Robert Hodaszi <robert.hodaszi@xxxxxxxx> > --- > drivers/tty/serial/fsl_lpuart.c | 6 ++++++ > 1 file changed, 6 insertions(+) > > diff --git a/drivers/tty/serial/fsl_lpuart.c b/drivers/tty/serial/fsl_lpuart.c > index 7486a2b8556c..8f1bb0a378d4 100644 > --- a/drivers/tty/serial/fsl_lpuart.c > +++ b/drivers/tty/serial/fsl_lpuart.c > @@ -1762,6 +1762,12 @@ static void lpuart32_configure(struct lpuart_port > *sport) { > unsigned long temp; > > + if (sport->lpuart_dma_rx_use) { > + /* RXWATER must be 0 */ > + temp = lpuart32_read(&sport->port, UARTWATER); > + temp &= ~(UARTWATER_WATER_MASK << > UARTWATER_RXWATER_OFF); > + lpuart32_write(&sport->port, temp, UARTWATER); > + } Hi Robert, No, please don’t do that. I agree with you that the LPUART RM has a false statement, the Receive Watermark actually can be greater than or equal to 0, but this doesn’t mean that it must be 0. And the false statement has nothing to do with the code here. The code here aims to set the different values for lpuart interrupt case and dma case, and force the rx watermark for dma case to 0, which is unreasonable. We have already set the watermark in lpuart32_setup_watermark(), it works for both interrupt and dma case, you can set the rx_watermark value for different platforms according to your requirements, from 0 ~ FIFO[RXFIFOSIZE]-1. Best Regards Sherry > temp = lpuart32_read(&sport->port, UARTCTRL); > if (!sport->lpuart_dma_rx_use) > temp |= UARTCTRL_RIE | UARTCTRL_ILIE; > -- > 2.34.1