mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>
To: Martino Dell'Ambrogio <tillo@tillo.ch>,
	Matthias Brugger <matthias.bgg@gmail.com>
Cc: linux-mediatek@lists.infradead.org,
	linux-arm-kernel@lists.infradead.org, devicetree@vger.kernel.org,
	linux-kernel@vger.kernel.org, kees@kernel.org,
	tony.luck@intel.com, gpiccoli@igalia.com
Subject: Re: [PATCH v3] arm64: dts: mediatek: mt7988a-bananapi-bpi-r4: add ramoops region
Date: Tue, 15 Sep 2026 09:46:04 +0200	[thread overview]
Message-ID: <a465210b-cd9c-4c5b-a54d-54d4b62b0706@collabora.com> (raw)
In-Reply-To: <20260915064254.1594808-1-tillo@tillo.ch>

On 9/15/26 06:42, Martino Dell'Ambrogio wrote:
> Reserve 1 MiB of RAM just below the ARM Trusted Firmware secmon region
> (0x42f00000-0x43000000) for persistent kernel log storage via pstore/ramoops,
> allowing post-panic console output and oops dumps to be recovered after a
> reboot. Without it, kernel crash logs on this board are lost when the SoC
> warm-resets and the on-chip console buffer is reinitialised.
> 
> With record-size=128 KiB, console-size=256 KiB, ftrace-size=64 KiB and
> pmsg-size=64 KiB, ramoops_probe() carves the post-console remainder
> (640 KiB) into five 128 KiB kmsg records, with the requested ecc-size=16
> reserving a small Reed-Solomon parity block from each zone's own
> allocation (per persistent_ram_new()). The ECC lets pstore recover dumps
> even when the panic path truncates writes mid-record.
> 
> The no-map property is required so the reserved region is kept out of the
> kernel linear map. ramoops remaps the carve-out write-combine via
> ioremap_wc(); on arm64, leaving the same physical RAM mapped cacheable in
> the linear map at the same time is an attribute-mismatch and risks losing
> panic data to dirty cache evictions from the linear alias.
> 
> The carve-out sits immediately below the ATF region already declared at
> 0x43000000 in mt7988a.dtsi, so no other reserved-memory child is moved or
> resized. BPI-R4 ships with at least 4 GiB of DRAM starting at 0x40000000,
> so the region is well within installed memory on every variant.
> 
> For the carve-out to actually preserve content across a reset, the boot
> loader must also avoid touching this region on warm reset; on standard
> BPI-R4 boards with the stock OpenWrt U-Boot fork this already holds.
> 
> Signed-off-by: Martino Dell'Ambrogio <tillo@tillo.ch>
> ---
> Changes in v3:
>   - Resend; no functional change. Rebased on v7.3-rc3, where the v2 diff
>     still applies unmodified.
>   - v2 drew no review comments. It was also sent, in error, as a reply to
>     the BPI-R3 patch's thread rather than its own, so it is likely to have
>     been read as a duplicate of that board's patch. This version starts a
>     fresh thread to avoid repeating that.
> 
> The matching BPI-R3 (mt7986a) patch is being resent as v3 at the same time.
> 
> v2: https://lore.kernel.org/all/20260528123645.2650085-1-tillo@tillo.ch/
> v1: https://lore.kernel.org/all/20260528092807.1936177-1-tillo@tillo.ch/
> 
>   .../boot/dts/mediatek/mt7988a-bananapi-bpi-r4.dtsi  | 13 +++++++++++++
>   1 file changed, 13 insertions(+)
> 
> diff --git a/arch/arm64/boot/dts/mediatek/mt7988a-bananapi-bpi-r4.dtsi b/arch/arm64/boot/dts/mediatek/mt7988a-bananapi-bpi-r4.dtsi
> index 0ff69da..6a8dc89 100644
> --- a/arch/arm64/boot/dts/mediatek/mt7988a-bananapi-bpi-r4.dtsi
> +++ b/arch/arm64/boot/dts/mediatek/mt7988a-bananapi-bpi-r4.dtsi
> @@ -80,6 +80,19 @@
>   	};
>   };
>   
> +&{/reserved-memory} {

It's just

	reserved-memory {

Sorry about missing your patch for all this time; the comment applies to both btw.

Cheers,
Angelo

> +	ramoops@42f00000 {
> +		compatible = "ramoops";
> +		reg = <0 0x42f00000 0 0x100000>;
> +		no-map;
> +		record-size = <0x20000>;
> +		console-size = <0x40000>;
> +		ftrace-size = <0x10000>;
> +		pmsg-size = <0x10000>;
> +		ecc-size = <16>;
> +	};
> +};
> +
>   &cci {
>   	proc-supply = <&rt5190_buck3>;
>   };

      reply	other threads:[~2026-09-15  7:46 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-09-15  4:42 Martino Dell'Ambrogio
2026-09-15  7:46 ` AngeloGioacchino Del Regno [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=a465210b-cd9c-4c5b-a54d-54d4b62b0706@collabora.com \
    --to=angelogioacchino.delregno@collabora.com \
    --cc=devicetree@vger.kernel.org \
    --cc=gpiccoli@igalia.com \
    --cc=kees@kernel.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mediatek@lists.infradead.org \
    --cc=matthias.bgg@gmail.com \
    --cc=tillo@tillo.ch \
    --cc=tony.luck@intel.com \
    /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

all inboxes | Powered by JetHome®