Devicetree
 help / color / mirror / Atom feed
From: sashiko-bot@kernel.org
To: "Martino Dell'Ambrogio" <tillo@tillo.ch>
Cc: devicetree@vger.kernel.org, conor+dt@kernel.org, robh@kernel.org
Subject: Re: [PATCH] arm64: dts: mediatek: mt7988a-bananapi-bpi-r4: add ramoops region
Date: Thu, 28 May 2026 10:13:20 +0000	[thread overview]
Message-ID: <20260528101321.0D8821F000E9@smtp.kernel.org> (raw)
In-Reply-To: <20260528092807.1936177-1-tillo@tillo.ch>

Thank you for your contribution! Sashiko AI review found 2 potential issue(s) to consider:
- [High] The `ramoops` reserved-memory node is missing the `no-map` property, which causes an architecture violation on arm64 due to mismatched memory attributes.
- [High] The `ramoops` memory partitioning and ECC configuration severely misinterpret the subsystem bindings, contradicting the commit message's claims and failing to provide the intended ECC protection.
--

commit 9de1ef047c96e12c7b888c596f5eb04dcab13d7d
Author: Martino Dell'Ambrogio <tillo@tillo.ch>

arm64: dts: mediatek: mt7988a-bananapi-bpi-r4: add ramoops region

Reserve 1 MiB of RAM for persistent kernel log storage via pstore/ramoops.
This preserves console output and oops dumps across warm resets. The carve-out
is placed just below the ARM Trusted Firmware secmon region.

> The record sizes (128 KiB kmsg records, 256 KiB rolling console, 64 KiB
> ftrace, 64 KiB pmsg) sum to 512 KiB; the remainder of the 1 MiB carve-out
> is used for the ECC parity blocks (ecc-size=16, one Reed-Solomon block per
> record) which significantly improves dump readability when the panic path
> truncates writes mid-record.

[Severity: High]
Does the ramoops driver allocate ECC memory from the remaining space in the
carve-out as described here?

Looking at ramoops_probe() in fs/pstore/ram.c, the remaining space for oops
records is calculated as the total size minus the console, ftrace, and pmsg
sizes (1024 - 256 - 64 - 64 = 640 KiB). The subsystem then divides this
remaining space by the record-size (128 KiB) to create 5 separate kmsg
records, rather than a single record.

Furthermore, persistent_ram_new() carves the ECC parity blocks from within
the allocated size of each individual record. This amounts to roughly 14 KiB
of ECC per record, instead of the 512 KiB of dedicated ECC parity blocks
mentioned above.

> diff --git a/arch/arm64/boot/dts/mediatek/mt7988a-bananapi-bpi-r4.dtsi b/arch/arm64/boot/dts/mediatek/mt7988a-bananapi-bpi-r4.dtsi
> --- a/arch/arm64/boot/dts/mediatek/mt7988a-bananapi-bpi-r4.dtsi
> +++ b/arch/arm64/boot/dts/mediatek/mt7988a-bananapi-bpi-r4.dtsi

[ ... ]

> +&{/reserved-memory} {
> +	ramoops@42f00000 {
> +		compatible = "ramoops";

[Severity: High]
Does this node need the no-map property?

Without no-map, this 1 MiB carve-out remains in the kernel's linear mapping
where it is mapped as Normal Cacheable memory. The ramoops driver remaps this
region using vmap() with a default mem-type of 0 (Write-Combine, translating
to Normal Non-Cacheable on arm64).

Mapping the same physical memory with conflicting cache attributes is an
architectural violation on arm64 and can lead to cache incoherency. Dirty
cache lines from the linear map could evict and overwrite the panic logs
written via the non-cacheable mapping.

> +		reg = <0 0x42f00000 0 0x100000>;
> +		record-size = <0x20000>;
> +		console-size = <0x40000>;
> +		ftrace-size = <0x10000>;
> +		pmsg-size = <0x10000>;
> +		ecc-size = <16>;
> +	};
> +};
> +

-- 
Sashiko AI review · https://sashiko.dev/#/patchset/20260528092807.1936177-1-tillo@tillo.ch?part=1

  reply	other threads:[~2026-05-28 10:13 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-05-28  9:28 [PATCH] arm64: dts: mediatek: mt7988a-bananapi-bpi-r4: add ramoops region Martino Dell'Ambrogio
2026-05-28 10:13 ` sashiko-bot [this message]
2026-05-28 12:36 ` [PATCH v2] arm64: dts: mediatek: mt7986a-bananapi-bpi-r3: " Martino Dell'Ambrogio
2026-07-05 18:55   ` Martino Dell'Ambrogio

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=20260528101321.0D8821F000E9@smtp.kernel.org \
    --to=sashiko-bot@kernel.org \
    --cc=conor+dt@kernel.org \
    --cc=devicetree@vger.kernel.org \
    --cc=robh@kernel.org \
    --cc=sashiko-reviews@lists.linux.dev \
    --cc=tillo@tillo.ch \
    /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