From: sashiko-bot@kernel.org
To: muhammad.nazim.amirul.nazle.asmade@altera.com
Cc: krzk+dt@kernel.org, robh@kernel.org, conor+dt@kernel.org,
devicetree@vger.kernel.org
Subject: Re: [PATCH 2/2] arm64: dts: socfpga: Add dma-coherent to XGMAC nodes
Date: Thu, 14 May 2026 19:04:08 +0000 [thread overview]
Message-ID: <20260514190409.2447CC2BCB3@smtp.kernel.org> (raw)
In-Reply-To: <20260514114111.10574-3-muhammad.nazim.amirul.nazle.asmade@altera.com>
Thank you for your contribution! Sashiko AI review found 2 potential issue(s) to consider:
- [Critical] Other SMMU-attached DMA masters in the base SoC `.dtsi` lack the `dma-coherent` property, risking data corruption.
- [High] The `dma-coherent` property is applied at the board `.dts` level instead of the SoC `.dtsi` level, leaving `gmac1` unprotected.
--
commit 3e00440f9beb8b27250cd5096c497340a958ee43
Author: Nazim Amirul <muhammad.nazim.amirul.nazle.asmade@altera.com>
arm64: dts: socfpga: Add dma-coherent to XGMAC nodes
This commit adds the dma-coherent property to XGMAC nodes in various
Agilex3 and Agilex5 board files. The commit message notes that transactions
going through the enabled SMMU are cache coherent, and this property prevents
redundant cache operations.
> diff --git a/arch/arm64/boot/dts/intel/socfpga_agilex5_socdk.dts b/arch/arm64/boot/dts/intel/socfpga_agilex5_socdk.dts
> index bdb608bb30ea6..dd878547c3056 100644
> --- a/arch/arm64/boot/dts/intel/socfpga_agilex5_socdk.dts
> +++ b/arch/arm64/boot/dts/intel/socfpga_agilex5_socdk.dts
> @@ -45,6 +45,7 @@ &gmac2 {
> phy-mode = "rgmii-id";
> phy-handle = <&emac2_phy0>;
> max-frame-size = <9000>;
> + dma-coherent;
Should this hardware integration property be added directly to the base
socfpga_agilex5.dtsi file instead of the individual board files?
By adding it at the board level, it appears gmac1 (which is defined in
arch/arm64/boot/dts/intel/socfpga_agilex5.dtsi) is missed. If a future board
enables gmac1, it will silently lack this property, which could cause explicit
arm64 cache invalidations to discard dma writes and result in stale data.
Also, the commit message mentions that transactions going through the SMMU
are cache coherent. Does this mean other SMMU-attached devices in the
base socfpga_agilex5.dtsi also need this property?
For example, looking at arch/arm64/boot/dts/intel/socfpga_agilex5.dtsi,
several other components are routed through the SMMU but lack dma-coherent:
usb0: usb@10b00000 {
...
iommus = <&smmu 6>;
};
dmac0: dma-controller@0 {
...
iommus = <&smmu 8>;
};
If these physically coherent devices are mapped as non-coherent, the kernel
will issue explicit cache invalidations (like dc ivac during dma_unmap_single
for device-to-memory transfers).
Because a coherent device writes directly into the CPU cache, this post-dma
kernel cache invalidation will discard the newly written data. Could this
cause silent regressions with active data corruption for devices like usb
storage or dma controllers?
[ ... ]
--
Sashiko AI review · https://sashiko.dev/#/patchset/20260514114111.10574-1-muhammad.nazim.amirul.nazle.asmade@altera.com?part=2
next prev parent reply other threads:[~2026-05-14 19:04 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-05-14 11:41 [PATCH 0/2] arm64: dts: socfpga: Enable SMMU and add DMA coherency for XGMAC muhammad.nazim.amirul.nazle.asmade
2026-05-14 11:41 ` [PATCH 1/2] arm64: dts: socfpga: Enable the SMMU for SoCFPGA device trees muhammad.nazim.amirul.nazle.asmade
2026-05-14 18:42 ` sashiko-bot
2026-05-14 23:34 ` Dinh Nguyen
2026-05-14 11:41 ` [PATCH 2/2] arm64: dts: socfpga: Add dma-coherent to XGMAC nodes muhammad.nazim.amirul.nazle.asmade
2026-05-14 19:04 ` sashiko-bot [this message]
2026-05-14 23:43 ` Dinh Nguyen
2026-05-15 8:02 ` Nazle Asmade, Muhammad Nazim Amirul
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=20260514190409.2447CC2BCB3@smtp.kernel.org \
--to=sashiko-bot@kernel.org \
--cc=conor+dt@kernel.org \
--cc=devicetree@vger.kernel.org \
--cc=krzk+dt@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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.