All of
 help / color / mirror / Atom feed
From: Stephen Boyd <>
To: Rob Herring <>, Frank Rowand <>
	Douglas Anderson <>,
	Nicolas Boichat <>,
	Quentin Perret <>
Subject: [PATCH] of/fdt: Don't worry about non-memory region overlap for no-map
Date: Wed, 19 May 2021 18:27:31 -0700	[thread overview]
Message-ID: <> (raw)

In commit 8a5a75e5e9e5 ("of/fdt: Make sure no-map does not remove
already reserved regions") we returned -EBUSY when trying to mark
regions as no-map when they're in the reserved memory node. This if
condition will still trigger though if the DT has a /memreserve/ that
completely subsumes the no-map memory carveouts in the reserved memory
node. Let's only consider this to be a problem if we're trying to mark a
region as no-map and it is actually memory. If it isn't memory,
presumably it was removed from the memory map via /memreserve/ and thus
can't be mapped anyway.

This silences a warning seen at boot for me on sc7180-trogdor.dtsi
boards that have /memreserve/ coming from the bootloader and those
reserved regions overlap with the carveouts that we want to use in DT
for other purposes like communicating with remote processors.

Cc: Douglas Anderson <>
Cc: Nicolas Boichat <>
Cc: Quentin Perret <>
Fixes: 8a5a75e5e9e5 ("of/fdt: Make sure no-map does not remove already reserved regions")
Signed-off-by: Stephen Boyd <>
 drivers/of/fdt.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/of/fdt.c b/drivers/of/fdt.c
index ba17a80b8c79..be13b4b6c2d8 100644
--- a/drivers/of/fdt.c
+++ b/drivers/of/fdt.c
@@ -1161,7 +1161,8 @@ int __init __weak early_init_dt_reserve_memory_arch(phys_addr_t base,
 		 * If the memory is already reserved (by another region), we
 		 * should not allow it to be marked nomap.
-		if (memblock_is_region_reserved(base, size))
+		if (memblock_is_region_memory(base, size) &&
+		    memblock_is_region_reserved(base, size))
 			return -EBUSY;
 		return memblock_mark_nomap(base, size);

base-commit: 6efb943b8616ec53a5e444193dccf1af9ad627b5

             reply	other threads:[~2021-05-20  1:27 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-05-20  1:27 Stephen Boyd [this message]
2021-05-20 16:17 ` [PATCH] of/fdt: Don't worry about non-memory region overlap for no-map Doug Anderson
2021-05-26 22:02   ` Stephen Boyd

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:

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \ \ \ \ \ \ \ \ \ \

* 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 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.