Re: [PATCH] serial: 8250_omap: fix a timeout loop condition

Alexander Sverdlin
2021-04-29T09:27:56Z

Hello Dan!

On 29/04/2021 09:19, Dan Carpenter wrote:
> This loop ends on -1 so the error message will never be printed.
>
> Fixes: 4bcf59a5dea0 ("serial: 8250: 8250_omap: Account for data in flight during DMA teardown")

Looks good to me!
Reviewed-by: Alexander Sverdlin <alexander.sverdlin@gmail.com>

> Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
> ---
> drivers/tty/serial/8250/8250_omap.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/tty/serial/8250/8250_omap.c b/drivers/tty/serial/8250/8250_omap.c
> index 8ac11eaeca51..c06631ced414 100644
> --- a/drivers/tty/serial/8250/8250_omap.c
> +++ b/drivers/tty/serial/8250/8250_omap.c
> @@ -813,7 +813,7 @@ static void __dma_rx_do_complete(struct uart_8250_port *p)
> poll_count--)
> cpu_relax();
>
> - if (!poll_count)
> + if (poll_count == -1)
> dev_err(p->port.dev, "teardown incomplete\n");
> }
> }