All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] of: reserved-memory: Print allocation/reservation failures as error
@ 2022-06-28 11:35 Vincent Whitchurch
  2022-06-28 16:09 ` Rob Herring
  0 siblings, 1 reply; 2+ messages in thread
From: Vincent Whitchurch @ 2022-06-28 11:35 UTC (permalink / raw)
  To: Rob Herring, Frank Rowand
  Cc: kernel, Vincent Whitchurch, devicetree, linux-kernel

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.

Signed-off-by: Vincent Whitchurch <vincent.whitchurch@axis.com>
---
 drivers/of/fdt.c             | 4 ++--
 drivers/of/of_reserved_mem.c | 3 ++-
 2 files changed, 4 insertions(+), 3 deletions(-)

diff --git a/drivers/of/fdt.c b/drivers/of/fdt.c
index a8f5b6532165..4610729d2297 100644
--- a/drivers/of/fdt.c
+++ b/drivers/of/fdt.c
@@ -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) {
diff --git a/drivers/of/of_reserved_mem.c b/drivers/of/of_reserved_mem.c
index 75caa6f5d36f..65f3b02a0e4e 100644
--- a/drivers/of/of_reserved_mem.c
+++ b/drivers/of/of_reserved_mem.c
@@ -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
-- 
2.34.1


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] of: reserved-memory: Print allocation/reservation failures as error
  2022-06-28 11:35 [PATCH] of: reserved-memory: Print allocation/reservation failures as error Vincent Whitchurch
@ 2022-06-28 16:09 ` Rob Herring
  0 siblings, 0 replies; 2+ messages in thread
From: Rob Herring @ 2022-06-28 16:09 UTC (permalink / raw)
  To: Vincent Whitchurch
  Cc: devicetree, Frank Rowand, Rob Herring, kernel, linux-kernel

On Tue, 28 Jun 2022 13:35:40 +0200, Vincent Whitchurch wrote:
> 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.
> 
> Signed-off-by: Vincent Whitchurch <vincent.whitchurch@axis.com>
> ---
>  drivers/of/fdt.c             | 4 ++--
>  drivers/of/of_reserved_mem.c | 3 ++-
>  2 files changed, 4 insertions(+), 3 deletions(-)
> 

Applied, thanks!

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2022-06-28 16:14 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-06-28 11:35 [PATCH] of: reserved-memory: Print allocation/reservation failures as error Vincent Whitchurch
2022-06-28 16:09 ` Rob Herring

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.