From: "Nuno Sá" <nuno.sa@analog.com>
To: Jisheng Zhang <jszhang@kernel.org>
Cc: Mark Brown <broonie@kernel.org>, Rob Herring <robh@kernel.org>,
Krzysztof Kozlowski <krzk+dt@kernel.org>,
Conor Dooley <conor+dt@kernel.org>,
linux-spi@vger.kernel.org, devicetree@vger.kernel.org,
Fei Xie <fei.xie@horizon.auto>
Subject: Re: [PATCH 0/3] spi: cadence-xspi: add DMA support
Date: Mon, 16 Nov 2026 14:26:33 +0000 [thread overview]
Message-ID: <avsRgCbjzFVdS9GI@nsa> (raw)
In-Reply-To: <20261107072044.17574-1-jszhang@kernel.org>
On Sat, Nov 07, 2026 at 03:20:41PM +0800, Jisheng Zhang wrote:
> This series tries to improve the cadence-xspi cpu usage and potential
> performance if the allocated dmaengine is powerful.
>
> But no matter the dmaengine performance is powerful or not, the cpu
> usage is reduced a lot.
>
> For example, on a dual CA55 platform, test with looping the following
> cmd:
> dd if=/dev/mtd0 of=/dev/null bs=8192
>
> Before the patch:
> cpu usage is nearly 50%, which means one CA55 is full loaded with
> the sdma io copy.
>
> After the patch:
> cpu usage is between 0 ~ 1%
>
> patch1 documents the dt-binding
> patch2 adds the memcpy dmaengine support
> patch3 uses writel_relaxed for cmd regs.
>
> Jisheng Zhang (3):
> spi: dt-bindings: cdns,xspi: Add DMA properties
> spi: cadence-xspi: Support dmaengine for sdma io copy
> spi: cadence-xspi: Use writel_relaxed() for cmd regs
>
> .../devicetree/bindings/spi/cdns,xspi.yaml | 13 ++
> drivers/spi/spi-cadence-xspi.c | 149 +++++++++++++++++-
> 2 files changed, 155 insertions(+), 7 deletions(-)
>
> --
> 2.55.0
>
Hi Jisheng,
I could run some tests on my platform. Here is the dump:
MTD=mtd4 SZ=$((16*1024*1024)) RUNS=5 sh xspi-dma-bench.sh
mtd4: mtd4: 08000000 00020000 "xspi0-nor", testing 16777216 bytes at offset 117440512, 1 cpus
=== STIG + CPU (use_dma=0)
write 14.32 s 1.17 MB/s cpu 100.0% (1.00 of 1 cores)
write (read back via other path): data OK
read #1 0.35 s 47.93 MB/s cpu 100.0% (1.00 of 1 cores)
read #2 0.35 s 47.93 MB/s cpu 100.0% (1.00 of 1 cores)
read #3 0.34 s 49.34 MB/s cpu 100.0% (1.00 of 1 cores)
read #4 0.34 s 49.34 MB/s cpu 100.0% (1.00 of 1 cores)
read #5 0.34 s 49.34 MB/s cpu 100.0% (1.00 of 1 cores)
read: data OK
=== STIG + MDMA (use_dma=1)
write 14.39 s 1.17 MB/s cpu 100.0% (1.00 of 1 cores)
write (read back via other path): data OK
read #1 0.37 s 45.34 MB/s cpu 70.3% (0.70 of 1 cores)
read #2 0.37 s 45.34 MB/s cpu 68.6% (0.69 of 1 cores)
read #3 0.37 s 45.34 MB/s cpu 69.7% (0.70 of 1 cores)
read #4 0.36 s 46.60 MB/s cpu 70.3% (0.70 of 1 cores)
read #5 0.36 s 46.60 MB/s cpu 66.7% (0.67 of 1 cores)
read: data OK
The script is a LLM based one :). Might have some slop but given the
results are more or less what I expected (the data performance also goes
in line with flash_test), did not bother too much in
checking it in much detail.
So, cpu load is where we have the actual win.
The test ran on an octal spi-nor
- Nuno Sá
prev parent reply other threads:[~2026-11-16 14:26 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-11-07 7:20 [PATCH 0/3] spi: cadence-xspi: add DMA support Jisheng Zhang
2026-11-07 7:20 ` [PATCH 1/3] spi: dt-bindings: cdns,xspi: Add DMA properties Jisheng Zhang
2026-11-07 8:01 ` sashiko-bot
2026-11-07 7:20 ` [PATCH 2/3] spi: cadence-xspi: Support dmaengine for sdma io copy Jisheng Zhang
2026-11-07 7:51 ` sashiko-bot
2026-11-07 7:20 ` [PATCH 3/3] spi: cadence-xspi: Use writel_relaxed() for cmd regs Jisheng Zhang
2026-11-16 14:26 ` Nuno Sá [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=avsRgCbjzFVdS9GI@nsa \
--to=nuno.sa@analog.com \
--cc=broonie@kernel.org \
--cc=conor+dt@kernel.org \
--cc=devicetree@vger.kernel.org \
--cc=fei.xie@horizon.auto \
--cc=jszhang@kernel.org \
--cc=krzk+dt@kernel.org \
--cc=linux-spi@vger.kernel.org \
--cc=robh@kernel.org \
/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