From: sashiko-bot@kernel.org
To: muhammad.nazim.amirul.nazle.asmade@altera.com
Cc: robh@kernel.org, devicetree@vger.kernel.org, conor+dt@kernel.org
Subject: Re: [PATCH v4 2/2] arm64: dts: socfpga: agilex5: Add dma-coherent to XGMAC nodes
Date: Wed, 24 Jun 2026 06:30:47 +0000 [thread overview]
Message-ID: <20260624063048.3D6021F000E9@smtp.kernel.org> (raw)
In-Reply-To: <20260624062203.12221-3-muhammad.nazim.amirul.nazle.asmade@altera.com>
Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
Pre-existing issues:
- [High] Omission of `dma-coherent` property on SMMU-routed DMA master nodes (`usb0`, `dmac0`, `dmac1`) causes potential data corruption.
--
commit d5421d52fec812147859d426e90e92990eb7c1b8
Author: Nazim Amirul <muhammad.nazim.amirul.nazle.asmade@altera.com>
arm64: dts: socfpga: agilex5: Add dma-coherent to XGMAC nodes
The SMMU is enabled and transactions going through it are cache
coherent. Add the dma-coherent property to the XGMAC nodes to prevent
redundant cache flush/invalidate operations and potential stale data
issues.
> diff --git a/arch/arm64/boot/dts/intel/socfpga_agilex5.dtsi b/arch/arm64/boot/dts/intel/socfpga_agilex5.dtsi
> index 654f94ded1e85..3de424ae3b8ba 100644
> --- a/arch/arm64/boot/dts/intel/socfpga_agilex5.dtsi
> +++ b/arch/arm64/boot/dts/intel/socfpga_agilex5.dtsi
> @@ -576,6 +576,7 @@ gmac0: ethernet@10810000 {
> altr,sysmgr-syscon = <&sysmgr 0x44 0>;
> snps,clk-csr = <0>;
> iommus = <&smmu 1>;
> + dma-coherent;
> status = "disabled";
>
> stmmac_axi_emac0_setup: stmmac-axi-config {
[Severity: High]
This is a pre-existing issue, but since the commit message establishes that
transactions going through the SMMU are cache coherent, should the
dma-coherent property also be added to other SMMU-routed DMA master nodes?
Looking at arch/arm64/boot/dts/intel/socfpga_agilex5.dtsi, the dmac0, dmac1,
and usb0 nodes also route through the SMMU but lack the dma-coherent property:
dmac0: dma-controller@0 {
...
iommus = <&smmu 8>;
};
If the kernel incorrectly treats these devices as non-coherent, allocating
a DMA buffer for reading (DMA_FROM_DEVICE) might result in a cache
invalidation (DC IVAC via dmac_inv_range()) discarding dirty cache lines
without writing them back to memory.
This would cause the CPU to subsequently read stale data, permanently losing
the data the device just wrote.
Could this incomplete fix leave usb0, dmac0, and dmac1 vulnerable to data
corruption and loss?
[ ... ]
--
Sashiko AI review · https://sashiko.dev/#/patchset/20260624062203.12221-1-muhammad.nazim.amirul.nazle.asmade@altera.com?part=2
prev parent reply other threads:[~2026-06-24 6:30 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-06-24 6:22 [PATCH v4 0/2] arm64: dts: socfpga: Enable SMMU and add DMA coherency for XGMAC muhammad.nazim.amirul.nazle.asmade
2026-06-24 6:22 ` [PATCH v4 1/2] arm64: dts: socfpga: agilex5: Enable the SMMU muhammad.nazim.amirul.nazle.asmade
2026-06-24 6:22 ` [PATCH v4 2/2] arm64: dts: socfpga: agilex5: Add dma-coherent to XGMAC nodes muhammad.nazim.amirul.nazle.asmade
2026-06-24 6:30 ` sashiko-bot [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=20260624063048.3D6021F000E9@smtp.kernel.org \
--to=sashiko-bot@kernel.org \
--cc=conor+dt@kernel.org \
--cc=devicetree@vger.kernel.org \
--cc=muhammad.nazim.amirul.nazle.asmade@altera.com \
--cc=robh@kernel.org \
--cc=sashiko-reviews@lists.linux.dev \
/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