From 26e6d6989d9ae9f2c2b39c70319e7cc73bf43fcf Mon Sep 17 00:00:00 2001
From: Jonathan Bell <jonathan@raspberrypi.com>
Date: Tue, 14 Apr 2026 15:53:53 +0100
Subject: [PATCH] DTS: set default nvme Host Memory Buffer size to 32MB on
 BCM2711/2

In https://github.com/raspberrypi/linux/issues/6504 the nvme HMB
allocation was found to come from CMA so was restricted to zero on the
basis of a superficial amount of testing showing no performance impact.

This is not the case for high-density low-capacity DRAM-less drives,
where random read can suffer up to 50% degradation.

With the addition of commit 6686634750d3 ("nvme-pci: manually allocate
Host Memory Buffer segments on arm64") this restriction is no longer
necessary.

Bump the default to 32MiB, which is a fair compromise for increasing
random read performance on smaller drives that typically have less
internal parallelism and request smaller HMBs.

Signed-off-by: Jonathan Bell <jonathan@raspberrypi.com>
---
 arch/arm/boot/dts/broadcom/bcm2711-rpi-ds.dtsi | 2 +-
 arch/arm64/boot/dts/broadcom/bcm2712-rpi.dtsi  | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

--- a/arch/arm/boot/dts/broadcom/bcm2711-rpi-ds.dtsi
+++ b/arch/arm/boot/dts/broadcom/bcm2711-rpi-ds.dtsi
@@ -3,7 +3,7 @@
 
 / {
 	chosen {
-		bootargs = "coherent_pool=1M 8250.nr_uarts=1 snd_bcm2835.enable_headphones=0 cgroup_disable=memory numa_policy=interleave nvme.max_host_mem_size_mb=0";
+		bootargs = "coherent_pool=1M 8250.nr_uarts=1 snd_bcm2835.enable_headphones=0 cgroup_disable=memory numa_policy=interleave nvme.max_host_mem_size_mb=32";
 	};
 
 	__overrides__ {
--- a/arch/arm64/boot/dts/broadcom/bcm2712-rpi.dtsi
+++ b/arch/arm64/boot/dts/broadcom/bcm2712-rpi.dtsi
@@ -113,7 +113,7 @@ watchdog: &pm {};
 
 / {
 	chosen: chosen {
-		bootargs = "reboot=w coherent_pool=1M 8250.nr_uarts=1 pci=pcie_bus_safe cgroup_disable=memory numa_policy=interleave nvme.max_host_mem_size_mb=0";
+		bootargs = "reboot=w coherent_pool=1M 8250.nr_uarts=1 pci=pcie_bus_safe cgroup_disable=memory numa_policy=interleave nvme.max_host_mem_size_mb=32";
 		stdout-path = "serial10:115200n8";
 	};
 
