mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Greg KH <gregkh@linuxfoundation.org>
To: "Jan Čermák" <sairon@sairon.cz>
Cc: jirislaby@kernel.org, florian.fainelli@broadcom.com,
	rjui@broadcom.com, sbranden@broadcom.com, phil@raspberrypi.com,
	stefan@agner.ch, bcm-kernel-feedback-list@broadcom.com,
	linux-serial@vger.kernel.org,
	linux-rpi-kernel@lists.infradead.org,
	linux-arm-kernel@lists.infradead.org,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH 1/1] serial: 8250_bcm2835aux: Add support for RTS/CTS auto flow control
Date: Wed, 23 Sep 2026 14:55:07 +0200	[thread overview]
Message-ID: <2026092346-snap-kosher-b487@gregkh> (raw)
In-Reply-To: <7e5ed3fb37ee4e113706c258d792121b868861a9.1786030659.git.sairon@sairon.cz>

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@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

      reply	other threads:[~2026-09-23 12:55 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-08-06 15:42 [PATCH 0/1] Implement BCM2835 AUX " Jan Čermák
2026-08-06 15:42 ` [PATCH 1/1] serial: 8250_bcm2835aux: Add support for " Jan Čermák
2026-09-23 12:55   ` Greg KH [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=2026092346-snap-kosher-b487@gregkh \
    --to=gregkh@linuxfoundation.org \
    --cc=bcm-kernel-feedback-list@broadcom.com \
    --cc=florian.fainelli@broadcom.com \
    --cc=jirislaby@kernel.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-rpi-kernel@lists.infradead.org \
    --cc=linux-serial@vger.kernel.org \
    --cc=phil@raspberrypi.com \
    --cc=rjui@broadcom.com \
    --cc=sairon@sairon.cz \
    --cc=sbranden@broadcom.com \
    --cc=stefan@agner.ch \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®