From: sashiko-bot@kernel.org
To: "Dinh Nguyen" <dinguyen@kernel.org>
Cc: devicetree@vger.kernel.org, conor+dt@kernel.org, robh@kernel.org
Subject: Re: [RFC PATCH 2/2] arm64: dts: socfpga: agilex5: add support for the ECC manager
Date: Wed, 02 Sep 2026 09:38:31 +0000 [thread overview]
Message-ID: <20260902093831.A14331F000E9@smtp.kernel.org> (raw)
In-Reply-To: <20260902092551.488203-3-dinguyen@kernel.org>
Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
Pre-existing issues:
- [Medium] Bitwise overflow and value truncation when unmasking double-bit error (DBE) interrupts.
--
commit a5d17bd160094d90efa7211d9c744f1d3da55629
Author: Dinh Nguyen <dinguyen@kernel.org>
Subject: arm64: dts: socfpga: agilex5: add support for the ECC manager
This commit adds the EDAC device and ECC manager nodes to the base Agilex5
platform. It introduces OCRAM and Ethernet ECC device support to the device
tree.
> diff --git a/arch/arm64/boot/dts/intel/socfpga_agilex5.dtsi b/arch/arm64/boot/dts/intel/socfpga_agilex5.dtsi
> index b06c6d5d60eed..64e8bffd69df7 100644
> --- a/arch/arm64/boot/dts/intel/socfpga_agilex5.dtsi
> +++ b/arch/arm64/boot/dts/intel/socfpga_agilex5.dtsi
[ ... ]
> + eccmgr {
> + compatible = "altr,socfpga-agilex5-ecc-manager",
> + "altr,socfpga-a10-ecc-manager";
> + altr,sysmgr-syscon = <&sysmgr>;
> + #address-cells = <1>;
> + #size-cells = <1>;
> + interrupt-parent = <&intc>;
> + interrupts = <GIC_SPI 15 IRQ_TYPE_LEVEL_HIGH>,
> + <GIC_SPI 241 IRQ_TYPE_LEVEL_HIGH>,
> + <GIC_SPI 95 IRQ_TYPE_EDGE_RISING>,
> + <GIC_SPI 120 IRQ_TYPE_EDGE_RISING>,
> + <GIC_SPI 8 IRQ_TYPE_LEVEL_HIGH>,
> + <GIC_SPI 9 IRQ_TYPE_LEVEL_HIGH>,
> + <GIC_SPI 7 IRQ_TYPE_LEVEL_HIGH>;
> + interrupt-names = "global_sbe", "global_dbe", "io96b0" , "io96b1",
> + "sdm_qspi_sbe", "sdm_qspi_dbe", "sdm_seu";
> + interrupt-controller;
> + #interrupt-cells = <2>;
> + ranges = <0 0 0 0xffffffff>;
> +
> + ocram-ecc@108cc000 {
> + compatible = "altr,socfpga-a10-ocram-ecc";
> + reg = <0x108cc000 0x100>;
> + interrupts = <1 IRQ_TYPE_LEVEL_HIGH>, <33 IRQ_TYPE_LEVEL_HIGH>;
> + };
[Severity: Medium]
This is a pre-existing issue, but introducing interrupts with values >= 32
triggers a bitwise overflow and truncation bug in the altera_edac driver.
When the EDAC driver sets up DBE interrupts, it calls a10_eccmgr_irq_unmask()
with hwirq >= 32. The BIT(d->hwirq) macro computes 1UL << 33 (and up to 41
for the emac nodes).
drivers/edac/altera_edac.c:a10_eccmgr_irq_unmask() {
...
regmap_write(edac->ecc_mgr_map, A10_SYSMGR_ECC_INTMASK_CLR_OFST,
BIT(d->hwirq));
...
}
Does this shift result in undefined behavior or truncation? On 64-bit
systems, this yields a 64-bit value which is silently truncated to 0 when
passed to regmap_write()'s 32-bit val parameter. On 32-bit systems, this
shift exceeds the width of unsigned long, typically yielding 0 at runtime.
The masking function a10_eccmgr_irq_mask() shares the exact same bitwise
overflow and truncation issue:
drivers/edac/altera_edac.c:a10_eccmgr_irq_mask() {
...
regmap_write(edac->ecc_mgr_map, A10_SYSMGR_ECC_INTMASK_SET_OFST,
BIT(d->hwirq));
...
}
While the DBE interrupts may inadvertently remain unmasked because they
share the same hardware mask bit as single-bit errors, the specific
masking logic for DBE appears to fail because the computed mask evaluates
to 0.
--
Sashiko AI review · https://sashiko.dev/#/patchset/20260902092551.488203-1-dinguyen@kernel.org?part=2
prev parent reply other threads:[~2026-09-02 9:38 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-09-02 9:25 [RFC 0/2] arm64: dts: socfpga: clarify MMIO vs non-MMIO nodes Dinh Nguyen
2026-09-02 9:25 ` [RFC PATCH 1/2] dt-bindings: edac: altera: agilex5: document new edac support Dinh Nguyen
2026-09-02 9:25 ` [RFC PATCH 2/2] arm64: dts: socfpga: agilex5: add support for the ECC manager Dinh Nguyen
2026-09-02 9:38 ` 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=20260902093831.A14331F000E9@smtp.kernel.org \
--to=sashiko-bot@kernel.org \
--cc=conor+dt@kernel.org \
--cc=devicetree@vger.kernel.org \
--cc=dinguyen@kernel.org \
--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