[PATCH 1/1] serial: 8250_bcm2835aux: Add support for RTS/CTS auto flow control

Greg KH gregkh at linuxfoundation.org
Wed Sep 23 05:55:07 PDT 2026


On Thu, Aug 06, 2026 at 05:42:04PM +0200, Jan Čermák wrote:
> The bcm2835aux mini UART can automatically de-assert RTS based on the RX
> FIFO fill level and gate the transmitter on CTS, but the driver never
> made use of it. Wire it up:
> 
> - Enable AUTORTS/AUTOCTS (with the RTS4 threshold and inverted, i.e.
>   conventional active-low, polarity) whenever CRTSCTS is set on ports
>   declaring the "uart-has-rtscts" property, advertised via
>   UPF_HARD_FLOW.
> 
> - Gate the AUTORTS function on TIOCM_RTS in set_mctrl() so that
>   clearing RTS (port close, TIOCMBIC, B0) actually de-asserts the pin
>   while auto flow control is active.
> 
> - Implement throttle()/unthrottle() by disabling the RX interrupts and
>   letting the FIFO fill up, making the hardware de-assert RTS - the
>   same approach as in 8250_omap. Re-sync this state on termios and
>   rs485 changes, as those paths may re-enable the RX interrupts (or
>   leave them disabled) behind the throttle's back.
> 
> - Never enable auto flow control together with rs485, which uses RTS
>   as the transceiver direction control. As the software CTS fallback
>   of the serial core cannot work without a modem status interrupt,
>   strip CRTSCTS whenever it cannot be handled in hardware.
> 
> - Restore RXEN when rs485 is disabled, as the emulation may be torn
>   down without the rs485_stop_tx() callback ever being called, which
>   would leave the receiver disabled.
> 
> Assisted-by: Claude:claude-fable-5
> Signed-off-by: Jan Čermák <sairon at sairon.cz>
> ---
>  drivers/tty/serial/8250/8250_bcm2835aux.c | 160 +++++++++++++++++++++-
>  1 file changed, 156 insertions(+), 4 deletions(-)

There are some bot review comments on this:
	https://sashiko.dev/#/patchset/7e5ed3fb37ee4e113706c258d792121b868861a9.1786030659.git.sairon@sairon.cz

Can you address them and submit a new version?

thanks,

greg k-h



More information about the linux-arm-kernel mailing list