]> git.proxmox.com Git - mirror_ubuntu-kernels.git/commitdiff
tty: serial: fsl_lpuart: Fix the wrong RXWATER setting for rx dma case
authorSherry Sun <sherry.sun@nxp.com>
Mon, 30 Jan 2023 06:44:46 +0000 (14:44 +0800)
committerAndrea Righi <andrea.righi@canonical.com>
Tue, 14 Mar 2023 15:46:56 +0000 (16:46 +0100)
BugLink: https://bugs.launchpad.net/bugs/2011425
[ Upstream commit 9ad9df8447547febe9dd09b040f4528a09e495f0 ]

The RXWATER value must be greater than 0 according to the LPUART
reference manual. And when the number of datawords in the receive
FIFO is greater than RXWATER, an interrupt or a DMA request is
generated, so no need to set the different value for lpuart interrupt
case and dma case. Here delete the wrong RXWATER setting for dma case
directly.

Fixes: 42b68768e51b ("serial: fsl_lpuart: DMA support for 32-bit variant")
Signed-off-by: Sherry Sun <sherry.sun@nxp.com>
Link: https://lore.kernel.org/r/20230130064449.9564-4-sherry.sun@nxp.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
Signed-off-by: Andrea Righi <andrea.righi@canonical.com>
drivers/tty/serial/fsl_lpuart.c

index 986ec8323c526dd5533a33473cb327661fcf92c0..f34fabdc2bb7d04f73e4c73832ab3f54c991b36a 100644 (file)
@@ -1683,12 +1683,6 @@ 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);
-       }
        temp = lpuart32_read(&sport->port, UARTCTRL);
        if (!sport->lpuart_dma_rx_use)
                temp |= UARTCTRL_RIE;