From 25b84eeff0c5013366821e82654313d591609c57 Mon Sep 17 00:00:00 2001
From: Stefan Agner <stefan@agner.ch>
Date: Wed, 15 Sep 2021 05:00:45 +0000
Subject: [PATCH 21/21] HACK: of: partial revert of fdt.c changes

This resolves reports similar to the below which are present in dmesg
since Linux 5.10; which are also causing crashes in some distros:

[    0.000000] OF: fdt: Reserved memory: failed to reserve memory for node 'secmon@5000000': base 0x0000000005000000, size 3 MiB

Signed-off-by: Christian Hewitt <christianshewitt@gmail.com>
---
 drivers/of/fdt.c | 9 ---------
 1 file changed, 9 deletions(-)

--- a/drivers/of/of_reserved_mem.c
+++ b/drivers/of/of_reserved_mem.c
@@ -82,15 +82,6 @@ static int __init early_init_dt_reserve_
 					       phys_addr_t size, bool nomap)
 {
 	if (nomap) {
-		/*
-		 * If the memory is already reserved (by another region), we
-		 * should not allow it to be marked nomap, but don't worry
-		 * if the region isn't memory as it won't be mapped.
-		 */
-		if (memblock_overlaps_region(&memblock.memory, base, size) &&
-		    memblock_is_region_reserved(base, size))
-			return -EBUSY;
-
 		return memblock_mark_nomap(base, size);
 	}
 	return memblock_reserve(base, size);
