The Linux Kernel Mailing List
 help / color / mirror / Atom feed
From: Roman Linev <admin@mswin.me>
To: andersson@kernel.org, konradybcio@kernel.org
Cc: robh@kernel.org, krzk+dt@kernel.org, conor+dt@kernel.org,
	barnabas.czeman@mainlining.org, linux-arm-msm@vger.kernel.org,
	devicetree@vger.kernel.org, linux-kernel@vger.kernel.org,
	Roman Linev <admin@mswin.me>
Subject: [PATCH v2] arm64: dts: qcom: sm6125-xiaomi-laurel-sprout: enlarge reserved_mem1
Date: Mon, 24 Aug 2026 18:55:35 +0300	[thread overview]
Message-ID: <20260824155535.335494-1-admin@mswin.me> (raw)
In-Reply-To: <20260821032541.1856299-1-admin@mswin.me>

sm6125.dtsi sizes reserved_mem1@46200000 at 0x2d00000 (45 MiB), so it
ends at 0x48f00000. On laurel-sprout the firmware owns more than that:
the downstream device tree describes the same base as

  removed_region@46200000 { reg = <0 0x46200000 0 0x4900000>; };

i.e. 0x4900000 (73 MiB), ending exactly at 0x4ab00000 where mainline
places camera_mem. The 28 MiB between 0x48f00000 and 0x4ab00000 is
therefore owned by firmware on this board while mainline leaves it as
free System RAM and hands it to the page allocator.

The observed symptom is hard lockups under sustained buffered reads,
where page cache pressure eventually reaches the disputed range. Before
this change the device wedged at a rate of roughly one lockup per 59 MiB
of buffered reads from the SD card, reproducibly enough to fire on
demand. With the region enlarged, the same workload has run 691 GiB of
buffered reads with zero lockups.

Booting with CONFIG_MEMTEST=y and memtest=1 confirms the resulting map:
17 free ranges are swept with no bad ranges reported, and the swept list
skips 0x46200000..0x4ab00000 entirely, so none of the firmware carveout
is in the page allocator's pool any more.

Signed-off-by: Roman Linev <admin@mswin.me>
---
Changes in v2 (all from Konrad's review of v1):
 - Resize the existing &reserved_mem1 instead of adding a second,
   board-level region for the delta. Same bytes reserved, one node.
 - Drop the now-unused label.
 - Do not claim the range is XPU-protected. As Konrad pointed out it may
   equally be claimed by hyp or TZ; either way it is not the kernel's to
   allocate, so the commit message now says only that.
 - Add the CONFIG_MEMTEST=y / memtest=1 confirmation Konrad asked for.

v1: https://lore.kernel.org/r/20260821032541.1856299-1-admin@mswin.me
---
 .../boot/dts/qcom/sm6125-xiaomi-laurel-sprout.dts    | 12 ++++++++++++
 1 file changed, 12 insertions(+)

diff --git a/arch/arm64/boot/dts/qcom/sm6125-xiaomi-laurel-sprout.dts b/arch/arm64/boot/dts/qcom/sm6125-xiaomi-laurel-sprout.dts
index 139f2b4..027c009 100644
--- a/arch/arm64/boot/dts/qcom/sm6125-xiaomi-laurel-sprout.dts
+++ b/arch/arm64/boot/dts/qcom/sm6125-xiaomi-laurel-sprout.dts
@@ -324,6 +324,18 @@
 	status = "okay";
 };
 
+/*
+ * The firmware carveout at this base is larger on this device than the
+ * SoC dtsi assumes: downstream laurel_sprout describes it as
+ * removed_region@46200000 with a size of 0x4900000, ending exactly where
+ * camera_mem begins. The 28 MiB past the dtsi's 0x2d00000 is not the
+ * kernel's to allocate, and handing it to the buddy allocator wedges the
+ * machine under memory pressure.
+ */
+&reserved_mem1 {
+	reg = <0x0 0x46200000 0x0 0x4900000>;
+};
+
 &rpm_requests {
 	regulators-0 {
 		compatible = "qcom,rpm-pm6125-regulators";
-- 
2.55.0


      parent reply	other threads:[~2026-08-24 15:55 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-08-21  3:25 [PATCH] arm64: dts: qcom: sm6125-xiaomi-laurel-sprout: reserve firmware-owned DRAM Roman Linev
2026-08-24 13:23 ` Konrad Dybcio
2026-08-24 15:55 ` Roman Linev [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=20260824155535.335494-1-admin@mswin.me \
    --to=admin@mswin.me \
    --cc=andersson@kernel.org \
    --cc=barnabas.czeman@mainlining.org \
    --cc=conor+dt@kernel.org \
    --cc=devicetree@vger.kernel.org \
    --cc=konradybcio@kernel.org \
    --cc=krzk+dt@kernel.org \
    --cc=linux-arm-msm@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=robh@kernel.org \
    /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