Devicetree
 help / color / mirror / Atom feed
From: sashiko-bot@kernel.org
To: "Roman Vivchar" <rva333@protonmail.com>
Cc: devicetree@vger.kernel.org, robh@kernel.org, conor+dt@kernel.org
Subject: Re: [PATCH 2/2] ARM: dts: mediatek: mt6572: add cache data
Date: Sat, 04 Jul 2026 19:27:41 +0000	[thread overview]
Message-ID: <20260704192741.7A1DB1F000E9@smtp.kernel.org> (raw)
In-Reply-To: <20260704-6572-phase1-v1-2-61c2fe6be19c@protonmail.com>

Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
- [High] Incorrect L1 instruction cache line size and sets for Cortex-A7, misrepresenting hardware topology.
--

commit 7654f13f8bc1ae70f4b6b62c66fe88fc8cca8e2c
Author: Roman Vivchar <rva333@protonmail.com>

ARM: dts: mediatek: mt6572: add cache data

MediaTek mt6572 includes 32 KB I-cache and D-cache, and 256 KB L2 cache.
This commit adds information about cache size, cache line size and cache
sets to the devicetree.

> diff --git a/arch/arm/boot/dts/mediatek/mt6572.dtsi b/arch/arm/boot/dts/mediatek/mt6572.dtsi
> index fa0e5df766c20..5716505dc9e4f 100644
> --- a/arch/arm/boot/dts/mediatek/mt6572.dtsi
> +++ b/arch/arm/boot/dts/mediatek/mt6572.dtsi
> @@ -20,11 +20,34 @@ cpu@0 {
>  			device_type = "cpu";
>  			compatible = "arm,cortex-a7";
>  			reg = <0x0>;
> +			i-cache-size = <32768>;
> +			i-cache-line-size = <64>;
> +			i-cache-sets = <256>;

[Severity: High]
Does this inaccurately describe the Cortex-A7 L1 instruction cache geometry?
The Cortex-A7 specification defines a fixed line length of 32 bytes and is
2-way set-associative (which would imply 512 sets for 32KB).

If the kernel uses this device tree to populate the cacheinfo sysfs interface,
won't it override hardware-probed values? Userspace applications like JIT
compilers might read this incorrect 64-byte value and use the wrong stride
for cache invalidations, potentially leading to skipped lines and the
execution of stale instructions.

> +			d-cache-size = <32768>;
> +			d-cache-line-size = <64>;
> +			d-cache-sets = <128>;
> +			next-level-cache = <&l2>;
>  		};
>  		cpu@1 {
>  			device_type = "cpu";
>  			compatible = "arm,cortex-a7";
>  			reg = <0x1>;
> +			i-cache-size = <32768>;
> +			i-cache-line-size = <64>;
> +			i-cache-sets = <256>;

[Severity: High]
Can this also cause the same incorrect 64-byte line size to be propagated
to userspace for CPU1? Updating this to a 32-byte line size and 512 sets
would correctly match the Cortex-A7 hardware topology.

[ ... ]

-- 
Sashiko AI review · https://sashiko.dev/#/patchset/20260704-6572-phase1-v1-0-61c2fe6be19c@protonmail.com?part=2

      reply	other threads:[~2026-07-04 19:27 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-07-04 19:21 [PATCH 0/2] ARM: dts: mediatek: mt6572 DT cleanup + cache info Roman Vivchar via B4 Relay
2026-07-04 19:21 ` [PATCH 1/2] ARM: dts: mediatek: mt6572: rename fixed clocks Roman Vivchar via B4 Relay
2026-07-04 19:31   ` sashiko-bot
2026-07-04 19:21 ` [PATCH 2/2] ARM: dts: mediatek: mt6572: add cache data Roman Vivchar via B4 Relay
2026-07-04 19:27   ` 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=20260704192741.7A1DB1F000E9@smtp.kernel.org \
    --to=sashiko-bot@kernel.org \
    --cc=conor+dt@kernel.org \
    --cc=devicetree@vger.kernel.org \
    --cc=robh@kernel.org \
    --cc=rva333@protonmail.com \
    --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