lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-ID: <20240703212613.56024-1-ftoth@exalondelft.nl>
Date: Wed,  3 Jul 2024 22:56:36 +0200
From: Ferry Toth <ftoth@...londelft.nl>
To: Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
	"Jiri Slaby (SUSE)" <jirislaby@...nel.org>,
	John Ogness <john.ogness@...utronix.de>,
	Ilpo Järvinen <ilpo.jarvinen@...ux.intel.com>,
	Thomas Gleixner <tglx@...utronix.de>,
	Ferry Toth <ftoth@...londelft.nl>,
	linux-kernel@...r.kernel.org,
	linux-serial@...r.kernel.org
Cc: neil.armstrong@...aro.org,
	AlCooper <alcooperx@...il.com>,
	AlexanderShiyan <shc_work@...l.ru>,
	AlexandreBelloni <alexandre.belloni@...tlin.com>,
	AlexandreTorgue <alexandre.torgue@...s.st.com>,
	AlimAkhtar <alim.akhtar@...sung.com>,
	AndrewMorton <akpm@...ux-foundation.org>,
	"AneeshKumarK . V" <aneesh.kumar@...nel.org>,
	AngeloGioacchinoDelRegno <angelogioacchino.delregno@...labora.com>,
	BaolinWang <baolin.wang@...ux.alibaba.com>,
	BaruchSiach <baruch@...s.co.il>,
	BjornAndersson <andersson@...nel.org>,
	ClaudiuBeznea <claudiu.beznea@...on.dev>,
	"DavidS . Miller" <davem@...emloft.net>,
	FabioEstevam <festevam@...il.com>,
	HammerHsieh <hammerh0314@...il.com>,
	Christian König <christian.koenig@....com>,
	ChristopheLeroy <christophe.leroy@...roup.eu>,
	ChunyanZhang <zhang.lyra@...il.com>,
	JeromeBrunet <jbrunet@...libre.com>,
	JonathanHunter <jonathanh@...dia.com>,
	KevinHilman <khilman@...libre.com>,
	KonradDybcio <konrad.dybcio@...aro.org>,
	KrzysztofKozlowski <krzysztof.kozlowski@...aro.org>,
	KumaravelThiagarajan <kumaravel.thiagarajan@...rochip.com>,
	LaxmanDewangan <ldewangan@...dia.com>,
	linux-arm-kernel@...ts.infradead.org,
	linux-arm-msm@...r.kernel.org,
	"MaciejW . Rozycki" <macro@...am.me.uk>,
	ManivannanSadhasivam <manivannan.sadhasivam@...aro.org>,
	MartinBlumenstingl <martin.blumenstingl@...glemail.com>,
	MatthiasBrugger <matthias.bgg@...il.com>,
	MaximeCoquelin <mcoquelin.stm32@...il.com>,
	MichaelEllerman <mpe@...erman.id.au>,
	MichalSimek <michal.simek@....com>,
	"NaveenN . Rao" <naveen.n.rao@...ux.ibm.com>,
	NicolasFerre <nicolas.ferre@...rochip.com>,
	NicholasPiggin <npiggin@...il.com>,
	OrsonZhai <orsonzhai@...il.com>,
	Pali Rohár <pali@...nel.org>,
	PatriceChotard <patrice.chotard@...s.st.com>,
	PeterKorsgaard <jacmet@...site.dk>,
	RichardGenoud <richard.genoud@...il.com>,
	RussellKing <linux@...linux.org.uk>,
	SaschaHauer <s.hauer@...gutronix.de>,
	ShawnGuo <shawnguo@...nel.org>,
	StefaniSeibold <stefani@...bold.net>,
	SumitSemwal <sumit.semwal@...aro.org>,
	TaichiSugaya <sugaya.taichi@...ionext.com>,
	TakaoOrito <orito.takao@...ionext.com>,
	TharunKumarP <tharunkumar.pasumarthi@...rochip.com>,
	ThierryReding <thierry.reding@...il.com>,
	TimurTabi <timur@...nel.org>,
	VineetGupta <vgupta@...nel.org>,
	MarekSzyprowski <m.szyprowski@...sung.com>,
	PhilEdworthy <phil.edworthy@...esas.com>
Subject: [PATCH/RFC v1 0/1] 

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


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ