Skip to contentSkip to conversation

of: reserved-memory: Print allocation/reservation failures as error

PATCH Applied Vincent Whitchurch 2 participants 2 messages Jun 28, 2022 Device tree

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 of: reserved-memory: Print allocation/reservation failures as error

If the allocation/reservation of reserved-memory fails, it is normally an error, so print it as an error so that it doesn't get hidden from the console due to the loglevel. Also make the allocation failure include the size just like the reservation failure.

---
 drivers/of/fdt.c             | 4 ++--
 drivers/of/of_reserved_mem.c | 3 ++-
 2 files changed, 4 insertions(+), 3 deletions(-)
drivers/of/fdt.c +2 -2
index a8f5b6532165..4610729d2297 100644
@@ -532,8 +532,8 @@ static int __init __reserved_mem_reserve_reg(unsigned long node,
 				kmemleak_alloc_phys(base, size, 0, 0);
 		}
 		else
-			pr_info("Reserved memory: failed to reserve memory for node '%s': base %pa, size %lu MiB\n",
-				uname, &base, (unsigned long)(size / SZ_1M));
+			pr_err("Reserved memory: failed to reserve memory for node '%s': base %pa, size %lu MiB\n",
+			       uname, &base, (unsigned long)(size / SZ_1M));
 
 		len -= t_len;
 		if (first) {
drivers/of/of_reserved_mem.c +2 -1
index 75caa6f5d36f..65f3b02a0e4e 100644
@@ -156,7 +156,8 @@ static int __init __reserved_mem_alloc_size(unsigned long node,
 	}
 
 	if (base == 0) {
-		pr_info("failed to allocate memory for node '%s'\n", uname);
+		pr_err("failed to allocate memory for node '%s': size %lu MiB\n",
+		       uname, (unsigned long)(size / SZ_1M));
 		return -ENOMEM;
 	}
 

base-commit: a111daf0c53ae91e71fd2bfe7497862d14132e3e

Signature · 1 line
2.34.1
maintainer Applied
#1 lore raw
Quoted 11 lines · Vincent Whitchurch

If the allocation/reservation of reserved-memory fails, it is normally an error, so print it as an error so that it doesn't get hidden from the console due to the loglevel. Also make the allocation failure include the size just like the reservation failure.

---
 drivers/of/fdt.c             | 4 ++--
 drivers/of/of_reserved_mem.c | 3 ++-
 2 files changed, 4 insertions(+), 3 deletions(-)

Applied, thanks!