From: Max Hsu <max.hsu@sifive.com>
To: Paul Walmsley <pjw@kernel.org>,
Samuel Holland <samuel.holland@sifive.com>,
Vinod Koul <vkoul@kernel.org>, Frank Li <Frank.Li@kernel.org>,
Green Wan <green.wan@sifive.com>, Rob Herring <robh@kernel.org>,
Krzysztof Kozlowski <krzk+dt@kernel.org>,
Conor Dooley <conor+dt@kernel.org>,
Palmer Debbelt <palmer@sifive.com>,
Conor Dooley <conor@kernel.org>,
Palmer Dabbelt <palmer@dabbelt.com>,
Albert Ou <aou@eecs.berkeley.edu>,
Alexandre Ghiti <alex@ghiti.fr>
Cc: linux-riscv@lists.infradead.org, dmaengine@vger.kernel.org,
linux-kernel@vger.kernel.org,
Paul Walmsley <paul.walmsley@sifive.com>,
devicetree@vger.kernel.org, Max Hsu <max.hsu@sifive.com>,
stable@vger.kernel.org
Subject: [PATCH 0/5] dmaengine: sf-pdma: critical fixes and FU740 support
Date: Sat, 21 Feb 2026 03:43:52 +0800 [thread overview]
Message-ID: <20260221-pdma-v1-0-838d929c2326@sifive.com> (raw)
This series addresses critical bugs in the SiFive Platform DMA (PDMA)
driver and adds support for the FU740 SoC.
The first three patches fix serious issues in the existing sf-pdma driver:
1. Missing PDMA base offset (0x80000) in register calculations. While
the hardware provides an alias at offset 0x0, the driver should use
the canonical offset 0x80000 as documented in the specification to
ensure consistency and maintainability.
2. Race condition between done and error interrupts on SMP systems. Per
the FU540-C000 and FU740-C000 specs, both DONE and ERROR interrupt
bits are set simultaneously when a DMA error occurs, which can cause
concurrent execution of done_isr and err_isr on different CPUs,
leading to undefined behavior.
3. NULL pointer dereferences in both error and done tasklets due to race
conditions during channel termination. Both tasklets unconditionally
dereference chan->desc, which can be NULL during legitimate scenarios
like sf_pdma_terminate_all() or when interrupts fire after channel
cleanup. The fix adds NULL checks in both tasklets, protected by
vchan.lock to ensure atomicity.
These three fixes are tagged for stable as they address bugs present
since the driver's introduction in commit 6973886ad58e ("dmaengine:
sf-pdma: add platform DMA support for HiFive Unleashed A00").
The last two patches add FU740 support:
4. Add "sifive,fu740-c000-pdma" compatible string to the dt-bindings.
5. Add PDMA device node to the FU740 device tree to enable DMA support.
All patches have been tested on HiFive Unmatched (FU740-C000) hardware.
Signed-off-by: Max Hsu <max.hsu@sifive.com>
---
Max Hsu (5):
dmaengine: sf-pdma: add missing PDMA base offset to register calculations
dmaengine: sf-pdma: fix race between done and error interrupts
dmaengine: sf-pdma: fix NULL pointer dereference in error and done handlers
dt-bindings: dma: sifive,fu540-c000-pdma: add fu740 support
riscv: dts: sifive: fu740: add PDMA device node
.../bindings/dma/sifive,fu540-c000-pdma.yaml | 1 +
arch/riscv/boot/dts/sifive/fu740-c000.dtsi | 9 ++++
drivers/dma/sf-pdma/sf-pdma.c | 63 +++++++++++++++++-----
drivers/dma/sf-pdma/sf-pdma.h | 4 +-
4 files changed, 63 insertions(+), 14 deletions(-)
---
base-commit: 8bf22c33e7a172fbc72464f4cc484d23a6b412ba
change-id: 20260111-pdma-0421b0e48a10
Best regards,
--
Max Hsu <max.hsu@sifive.com>
_______________________________________________
linux-riscv mailing list
linux-riscv@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-riscv
next reply other threads:[~2026-02-20 19:44 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-02-20 19:43 Max Hsu [this message]
2026-02-20 19:43 ` [PATCH 1/5] dmaengine: sf-pdma: add missing PDMA base offset to register calculations Max Hsu
2026-02-20 20:10 ` Frank Li
2026-02-20 22:26 ` Conor Dooley
2026-02-20 19:43 ` [PATCH 2/5] dmaengine: sf-pdma: fix race between done and error interrupts Max Hsu
2026-02-20 20:26 ` Frank Li
2026-02-20 19:43 ` [PATCH 3/5] dmaengine: sf-pdma: fix NULL pointer dereference in error and done handlers Max Hsu
2026-02-20 20:28 ` Frank Li
2026-02-20 19:43 ` [PATCH 4/5] dt-bindings: dma: sifive,fu540-c000-pdma: add fu740 support Max Hsu
2026-02-20 22:28 ` Conor Dooley
2026-02-20 19:43 ` [PATCH 5/5] riscv: dts: sifive: fu740: add PDMA device node Max Hsu
2026-02-20 20:30 ` Frank Li
2026-02-20 22:27 ` Conor Dooley
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=20260221-pdma-v1-0-838d929c2326@sifive.com \
--to=max.hsu@sifive.com \
--cc=Frank.Li@kernel.org \
--cc=alex@ghiti.fr \
--cc=aou@eecs.berkeley.edu \
--cc=conor+dt@kernel.org \
--cc=conor@kernel.org \
--cc=devicetree@vger.kernel.org \
--cc=dmaengine@vger.kernel.org \
--cc=green.wan@sifive.com \
--cc=krzk+dt@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-riscv@lists.infradead.org \
--cc=palmer@dabbelt.com \
--cc=palmer@sifive.com \
--cc=paul.walmsley@sifive.com \
--cc=pjw@kernel.org \
--cc=robh@kernel.org \
--cc=samuel.holland@sifive.com \
--cc=stable@vger.kernel.org \
--cc=vkoul@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