From: "Tomasz Moń" <tomasz.mon@camlingroup.com>
To: Tim Harvey <tharvey@gateworks.com>
Cc: "Greg Kroah-Hartman" <gregkh@linuxfoundation.org>,
"Jiri Slaby" <jirislaby@kernel.org>,
"Shawn Guo" <shawnguo@kernel.org>,
"Sascha Hauer" <s.hauer@pengutronix.de>,
"Pengutronix Kernel Team" <kernel@pengutronix.de>,
"Fabio Estevam" <festevam@gmail.com>,
"NXP Linux Team" <linux-imx@nxp.com>,
linux-serial@vger.kernel.org,
"Linux ARM Mailing List" <linux-arm-kernel@lists.infradead.org>,
"open list" <linux-kernel@vger.kernel.org>,
"Richard Genoud" <richard.genoud@gmail.com>,
"Sergey Organov" <sorganov@gmail.com>,
"Tomasz Moń" <tomasz.mon@camlingroup.com>
Subject: Re: [PATCH] serial: imx: leave IRTS disabled if using modem-control CTS
Date: Wed, 16 Feb 2022 06:45:13 +0100 [thread overview]
Message-ID: <378824ab-3cc9-dcf5-b9ea-5e49b57792a6@camlingroup.com> (raw)
In-Reply-To: <CAJ+vNU0sWGsQa=YwLE9Ng34-DhJF=YR3oTV+q--KcgTMCjBa2w@mail.gmail.com>
On 15.02.2022 18:26, Tim Harvey wrote:
> On Mon, Feb 14, 2022 at 10:03 PM Tomasz Moń <tomasz.mon@camlingroup.com> wrote:
>> 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.
>>> 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.
I think I didn't write the message clear enough. I agree, that the GPIO
handling time is something the user has to accept. Usually this part
alone is not that bad though, as many receivers are capable of receiving
more than one character after deasserting their RTS output (transmitter
CTS input).
The general expectation is that the transmitter will output maximum one
more character *after* CTS GPIO change is handled by software. This is
not the case with current version of the patch.
With current version of the patch, after CTS GPIO handler finishes, the
UART will continue to transmit up to 32 characters if not using DMA.
When DMA is active it is much worse, as it will keep transmitting all
data already submitted to dmaengine.
As the internal RTS defaults to inactive when its not pinmuxed, the
software is able to freeze the TxFIFO (and thus DMA if enabled). To
freeze TxFIFO when using CTS GPIO, the software has to clear IRTS bit in
UCR2 register. Setting IRTS will thaw the TxFIFO.
Best Regards,
Tomasz Mon
next prev parent reply other threads:[~2022-02-16 5:45 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-02-14 21:30 Tim Harvey
2022-02-15 6:03 ` Tomasz Moń
2022-02-15 17:26 ` Tim Harvey
2022-02-16 5:45 ` Tomasz Moń [this message]
2022-02-17 16:22 ` Tim Harvey
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=378824ab-3cc9-dcf5-b9ea-5e49b57792a6@camlingroup.com \
--to=tomasz.mon@camlingroup.com \
--cc=festevam@gmail.com \
--cc=gregkh@linuxfoundation.org \
--cc=jirislaby@kernel.org \
--cc=kernel@pengutronix.de \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-imx@nxp.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-serial@vger.kernel.org \
--cc=richard.genoud@gmail.com \
--cc=s.hauer@pengutronix.de \
--cc=shawnguo@kernel.org \
--cc=sorganov@gmail.com \
--cc=tharvey@gateworks.com \
/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®