Re: [PATCH] serial: imx: leave IRTS disabled if using modem-control CTS

From: Tim Harvey
Date: Tue Feb 15 2022 - 12:26:47 EST


On Mon, Feb 14, 2022 at 10:03 PM Tomasz Moń <tomasz.mon@xxxxxxxxxxxxxxx> wrote:
>
> On 14.02.2022 22:30, Tim Harvey wrote:
> > If using modem-control gpios for CTS we must leave IRTS disabled
> > as otherwise the hardware will only transmit based on the internal RTS
> > pin routed to it.
> >
> > This allows hardware flow control to be used with cts-gpios.
>
> This hardware flow control sounds quite limited. Once CTS becomes
> inactive, the transmitter will still output all characters from TxFIFO.
> Transmitting whole TxFIFO already sounds quite bad, but that's the best
> case scenario where gpio interrupt is handled right away without any
> delay (so more than TxFIFO characters can actually be transmitted).
>
> Does the internal RTS default to inactive when it's not pinmuxed to the
> actual pin? If so, then controlling UCR2_IRTS based on CTS gpio could
> halt the transmission when the TxFIFO is not empty.
>

Tomasz,

I agree that the increased latency makes using a GPIO for CTS
(software controlled) not as good as one pinmuxed into the UART block
directly (hardware controlled) but without this patch GPIO for CTS
does not work at all because the internal RTS defaults to inactive
when its not pinmuxed. For many applications the latency is not an
issue.

Best Regards,

Tim