Re: [PATCH] serial: amba-pl011: Fix RTS handling in RS485 mode

From: Greg Kroah-Hartman
Date: Wed Dec 04 2024 - 10:52:30 EST


On Sat, Nov 23, 2024 at 09:26:51PM +0100, Miroslav Ondra via B4 Relay wrote:
> From: Miroslav Ondra <ondra@xxxxxxxxx>
>
> Use hrtimer instead of udelay and mdelay calls in interrupt
> handler to support shared interrupt lines.
> Replace simple bool variable rs485_tx_started by 4-state
> variable rs485_tx_state.

This says what you are doing, not _what_ you are doing. Please fix this
up.

>
> Signed-off-by: Miroslav Ondra <ondra@xxxxxxxxx>
> ---
> Data loss on serial line was observed during communication through
> serial ports ttyAMA1 and ttyAMA2 interconnected via RS485 transcievers.
> Both ports are in one BCM2711 (Compute Module CM40) and they share
> the same interrupt line.
>
> The problem is caused by long waiting for tx queue flush in the function
> pl011_rs485_tx_stop. Udelay or mdelay are used to wait.
> The function is called from the interrupt handler. If multiple devices
> share a single interrupt line, late processing of pending interrupts
> and data loss may occur. When operation of both devices are synchronous,
> collisions are quite often.
>
> This rework is based on the method used in tty/serial/imx.c
> Use hrtimer instead of udelay and mdelay calls.
> Replace simple bool variable rs485_tx_started by 4-state variable
> rs485_tx_state.

This info is great, why not put this in the changelog text instead?

thanks,

greg k-h