From: Ferry Toth <ftoth@exalondelft.nl>
To: "Greg Kroah-Hartman" <gregkh@linuxfoundation.org>,
"Jiri Slaby (SUSE)" <jirislaby@kernel.org>,
"John Ogness" <john.ogness@linutronix.de>,
"Ilpo Järvinen" <ilpo.jarvinen@linux.intel.com>,
"Thomas Gleixner" <tglx@linutronix.de>,
"Ferry Toth" <ftoth@exalondelft.nl>,
linux-kernel@vger.kernel.org, linux-serial@vger.kernel.org
Cc: neil.armstrong@linaro.org, AlCooper <alcooperx@gmail.com>,
AlexanderShiyan <shc_work@mail.ru>,
AlexandreBelloni <alexandre.belloni@bootlin.com>,
AlexandreTorgue <alexandre.torgue@foss.st.com>,
AlimAkhtar <alim.akhtar@samsung.com>,
AndrewMorton <akpm@linux-foundation.org>,
"AneeshKumarK . V" <aneesh.kumar@kernel.org>,
AngeloGioacchinoDelRegno
<angelogioacchino.delregno@collabora.com>,
BaolinWang <baolin.wang@linux.alibaba.com>,
BaruchSiach <baruch@tkos.co.il>,
BjornAndersson <andersson@kernel.org>,
ClaudiuBeznea <claudiu.beznea@tuxon.dev>,
"DavidS . Miller" <davem@davemloft.net>,
FabioEstevam <festevam@gmail.com>,
HammerHsieh <hammerh0314@gmail.com>,
"Christian König" <christian.koenig@amd.com>,
ChristopheLeroy <christophe.leroy@csgroup.eu>,
ChunyanZhang <zhang.lyra@gmail.com>,
JeromeBrunet <jbrunet@baylibre.com>,
JonathanHunter <jonathanh@nvidia.com>,
KevinHilman <khilman@baylibre.com>,
KonradDybcio <konrad.dybcio@linaro.org>,
KrzysztofKozlowski <krzysztof.kozlowski@linaro.org>,
KumaravelThiagarajan <kumaravel.thiagarajan@microchip.com>,
LaxmanDewangan <ldewangan@nvidia.com>,
linux-arm-kernel@lists.infradead.org,
linux-arm-msm@vger.kernel.org,
"MaciejW . Rozycki" <macro@orcam.me.uk>,
ManivannanSadhasivam <manivannan.sadhasivam@linaro.org>,
MartinBlumenstingl <martin.blumenstingl@googlemail.com>,
MatthiasBrugger <matthias.bgg@gmail.com>,
MaximeCoquelin <mcoquelin.stm32@gmail.com>,
MichaelEllerman <mpe@ellerman.id.au>,
MichalSimek <michal.simek@amd.com>,
"NaveenN . Rao" <naveen.n.rao@linux.ibm.com>,
NicolasFerre <nicolas.ferre@microchip.com>,
NicholasPiggin <npiggin@gmail.com>,
OrsonZhai <orsonzhai@gmail.com>, "Pali Rohár" <pali@kernel.org>,
PatriceChotard <patrice.chotard@foss.st.com>,
PeterKorsgaard <jacmet@sunsite.dk>,
RichardGenoud <richard.genoud@gmail.com>,
RussellKing <linux@armlinux.org.uk>,
SaschaHauer <s.hauer@pengutronix.de>,
ShawnGuo <shawnguo@kernel.org>,
StefaniSeibold <stefani@seibold.net>,
SumitSemwal <sumit.semwal@linaro.org>,
TaichiSugaya <sugaya.taichi@socionext.com>,
TakaoOrito <orito.takao@socionext.com>,
TharunKumarP <tharunkumar.pasumarthi@microchip.com>,
ThierryReding <thierry.reding@gmail.com>,
TimurTabi <timur@kernel.org>, VineetGupta <vgupta@kernel.org>,
MarekSzyprowski <m.szyprowski@samsung.com>,
PhilEdworthy <phil.edworthy@renesas.com>
Subject: [PATCH/RFC v1 0/1]
Date: Wed, 3 Jul 2024 22:56:36 +0200 [thread overview]
Message-ID: <20240703212613.56024-1-ftoth@exalondelft.nl> (raw)
Since 1788cf6a91d9 "tty: serial: switch from circ_buf to kfifo" serial
transmit when using DMA uses kfifo with a SG list with a single entry.
This obviously lead to 2 separate DMA transfers when the buffer wraps
around.
On the receiving end depending on the UART the receive DMA might
terminate when there is a moment of silence (an interchar gap) of a few
(typcially 5) characters length. The receivers FIFO will help to extend
that time (depending on FIFO length and threshold). Currently high
speed UARTs (HSU) can have baud rates of 3.5MBd which means terminating
a DMA transfer and handling a receive interrupt to set up a new DMA
transfer has to complete in 180us which is hard to guarantee. Especially
under heavy interrupt load.
As most serial protocols will transfer maximally a buffer length at a
time it makes sense to eliminate the interchar gap on buffer wraps by
using a SG list with 2 entries.
The following patch has been tested on Merrifield (Intel Edison) which
is slow (500MHz) but has a HSU that can transmit up to 3.5MBd.
This patch should be viewed as a preparation for a follow-up patch that
remove the interrupt on the receiving end entirely.
But first I would like to make sure that: 1) either all users can
actually handle 2 SG entries 2) if not, get your advice on how to best
make the number of entries configurable per platform
Possibly on RZN1 due to aa63d786cea2 ("serial: 8250: dw: Add support for
DMA flow controlling devices") we might anticipate problems.
Please test on your platform and let me know your suggestions.
Thanks!
Ferry Toth (1):
tty: serial: 8250_dma: use sgl with 2 nents to take care of buffer
wrap
drivers/tty/serial/8250/8250_dma.c | 19 ++++++++++---------
1 file changed, 10 insertions(+), 9 deletions(-)
--
2.43.0
next reply other threads:[~2024-07-03 21:28 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-07-03 20:56 Ferry Toth [this message]
2024-07-03 20:56 ` [PATCH/RFC v1 1/1] tty: serial: 8250_dma: use sgl with 2 nents to take care of buffer wrap Ferry Toth
2024-07-08 6:10 ` Jiri Slaby
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=20240703212613.56024-1-ftoth@exalondelft.nl \
--to=ftoth@exalondelft.nl \
--cc=akpm@linux-foundation.org \
--cc=alcooperx@gmail.com \
--cc=alexandre.belloni@bootlin.com \
--cc=alexandre.torgue@foss.st.com \
--cc=alim.akhtar@samsung.com \
--cc=andersson@kernel.org \
--cc=aneesh.kumar@kernel.org \
--cc=angelogioacchino.delregno@collabora.com \
--cc=baolin.wang@linux.alibaba.com \
--cc=baruch@tkos.co.il \
--cc=christian.koenig@amd.com \
--cc=christophe.leroy@csgroup.eu \
--cc=claudiu.beznea@tuxon.dev \
--cc=davem@davemloft.net \
--cc=festevam@gmail.com \
--cc=gregkh@linuxfoundation.org \
--cc=hammerh0314@gmail.com \
--cc=ilpo.jarvinen@linux.intel.com \
--cc=jacmet@sunsite.dk \
--cc=jbrunet@baylibre.com \
--cc=jirislaby@kernel.org \
--cc=john.ogness@linutronix.de \
--cc=jonathanh@nvidia.com \
--cc=khilman@baylibre.com \
--cc=konrad.dybcio@linaro.org \
--cc=krzysztof.kozlowski@linaro.org \
--cc=kumaravel.thiagarajan@microchip.com \
--cc=ldewangan@nvidia.com \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-arm-msm@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-serial@vger.kernel.org \
--cc=linux@armlinux.org.uk \
--cc=m.szyprowski@samsung.com \
--cc=macro@orcam.me.uk \
--cc=manivannan.sadhasivam@linaro.org \
--cc=martin.blumenstingl@googlemail.com \
--cc=matthias.bgg@gmail.com \
--cc=mcoquelin.stm32@gmail.com \
--cc=michal.simek@amd.com \
--cc=mpe@ellerman.id.au \
--cc=naveen.n.rao@linux.ibm.com \
--cc=neil.armstrong@linaro.org \
--cc=nicolas.ferre@microchip.com \
--cc=npiggin@gmail.com \
--cc=orito.takao@socionext.com \
--cc=orsonzhai@gmail.com \
--cc=pali@kernel.org \
--cc=patrice.chotard@foss.st.com \
--cc=phil.edworthy@renesas.com \
--cc=richard.genoud@gmail.com \
--cc=s.hauer@pengutronix.de \
--cc=shawnguo@kernel.org \
--cc=shc_work@mail.ru \
--cc=stefani@seibold.net \
--cc=sugaya.taichi@socionext.com \
--cc=sumit.semwal@linaro.org \
--cc=tglx@linutronix.de \
--cc=tharunkumar.pasumarthi@microchip.com \
--cc=thierry.reding@gmail.com \
--cc=timur@kernel.org \
--cc=vgupta@kernel.org \
--cc=zhang.lyra@gmail.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