Skip to contentSkip to conversation

firmware: tegra: Do not warn on missing memory-region property

PATCH In review Thierry Reding 3 participants 3 messages Jul 29, 2025 – Aug 27, 2025 Tegra architecture support

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 firmware: tegra: Do not warn on missing memory-region property

From: Thierry Reding <[email protected]>

The IPC shared memory can reside in system memory or SRAM. In the latter case the memory-region property is expected not to be present, so do not warn about it.

Fixes dbe4efea38d0 ("firmware: tegra: bpmp: Use of_reserved_mem_region_to_resource() for "memory-region"")
---
 drivers/firmware/tegra/bpmp-tegra186.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)
drivers/firmware/tegra/bpmp-tegra186.c +4 -1
index 7cfc5fdfa49d..64863db7a715 100644
@@ -198,7 +198,10 @@ static int tegra186_bpmp_dram_init(struct tegra_bpmp *bpmp)
 
 	err = of_reserved_mem_region_to_resource(bpmp->dev->of_node, 0, &res);
 	if (err < 0) {
-		dev_warn(bpmp->dev, "failed to parse memory region: %d\n", err);
+		if (err != -ENODEV)
+			dev_warn(bpmp->dev,
+				 "failed to parse memory region: %d\n", err);
+
 		return err;
 	}
 
Signature · 1 line
2.50.0
#1 lore raw
Quoted 6 lines · Thierry Reding

From: Thierry Reding <[email protected]>

The IPC shared memory can reside in system memory or SRAM. In the latter case the memory-region property is expected not to be present, so do not warn about it.

Then shouldn't the only warning be you couldn't find either one? The exact reason shouldn't be that important.

Quoted 27 lines
Fixes dbe4efea38d0 ("firmware: tegra: bpmp: Use of_reserved_mem_region_to_resource() for "memory-region"")
---
 drivers/firmware/tegra/bpmp-tegra186.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)
drivers/firmware/tegra/bpmp-tegra186.c +4 -2
index 7cfc5fdfa49d..64863db7a715 100644
@@ -198,7 +198,10 @@ static int tegra186_bpmp_dram_init(struct tegra_bpmp *bpmp)
 
        err = of_reserved_mem_region_to_resource(bpmp->dev->of_node, 0, &res);
        if (err < 0) {
-               dev_warn(bpmp->dev, "failed to parse memory region: %d\n", err);
+               if (err != -ENODEV)
+                       dev_warn(bpmp->dev,
+                                "failed to parse memory region: %d\n", err);
+
                return err;
        }
 
--

2.50.0

maintainer Reviewed-by Tested-by
#2 lore raw
Quoted 10 lines · Rob Herring
Quoted 6 lines · Thierry Reding

From: Thierry Reding <[email protected]>

The IPC shared memory can reside in system memory or SRAM. In the latter case the memory-region property is expected not to be present, so do not warn about it.

Then shouldn't the only warning be you couldn't find either one? The exact reason shouldn't be that important.

This code is checking if it exists in system memory. If this fails, then we try SRAM, but that is checked in a different function. So at this point we only know it is not present in system memory. So here we only want to warn if the 'memory-region' property exists but parsing it fails.

Quoted 13 lines
Quoted 13 lines
Fixes dbe4efea38d0 ("firmware: tegra: bpmp: Use of_reserved_mem_region_to_resource() for "memory-region"")
---
  drivers/firmware/tegra/bpmp-tegra186.c | 5 ++++-
  1 file changed, 4 insertions(+), 1 deletion(-)
drivers/firmware/tegra/bpmp-tegra186.c +0 -0
index 7cfc5fdfa49d..64863db7a715 100644
@@ -198,7 +198,10 @@ static int tegra186_bpmp_dram_init(struct tegra_bpmp *bpmp)
 
Quoted 9 lines

drivers/firmware/tegra/bpmp-tegra186.c static int tegra186_bpmp_dram_init(struct tegra_bpmp *bpmp) · line 206

Quoted 9 lines
drivers/firmware/tegra/bpmp-tegra186.c +4 -1
         err = of_reserved_mem_region_to_resource(bpmp->dev->of_node, 0, &res);
         if (err < 0) {
-               dev_warn(bpmp->dev, "failed to parse memory region: %d\n", err);
+               if (err != -ENODEV)
+                       dev_warn(bpmp->dev,
+                                "failed to parse memory region: %d\n", err);
+
                 return err;
         }

Thanks
Jon

Signature · 1 line
nvpublic