Skip to contentSkip to conversation

Revert memblock backports with missing dependencies

PATCH New Quentin Perret 3 participants 11 messages May 12, 2021 Stable branch

lore
Share & tools
lore
#0 lore raw

Hi all,

A breakage in 5.4.102 has been reported [1] due to the backport of the two following upstream commits:

8a5a75e5e9e5 ("of/fdt: Make sure no-map does not remove already reserved regions") 86588296acbf ("fdt: Properly handle "no-map" field in the memory region")

As Alexandre noted in the original thread, the backport missed dependencies. But since these patches were not really fixes in the first place, it seems preferable to simply revert them from 5.4 and earlier.

[1] https://lore.kernel.org/linux-arm-kernel/CAL_Jsq+LUPZFhXd+j-xM67rZB=pvEvZM+1sfckip0Lqq02PkZQ@mail.gmail.com/

Quentin Perret (2):
Revert "of/fdt: Make sure no-map does not remove already reserved
regions"
Revert "fdt: Properly handle "no-map" field in the memory region"

 drivers/of/fdt.c | 12 ++----------
 1 file changed, 2 insertions(+), 10 deletions(-)
Signature · 1 line
2.31.1.607.g51e8a6a459-goog
#1 lore raw

PATCH 1/2 Revert "of/fdt: Make sure no-map does not remove already reserved regions"

This reverts commit 3cbd3038c9155038020560729cde50588311105d. It is not really a fix, and the backport misses dependencies, which breaks existing platforms.

---
 drivers/of/fdt.c | 10 +---------
 1 file changed, 1 insertion(+), 9 deletions(-)
drivers/of/fdt.c +1 -9
index fc24102e25ce..036af904e0cf 100644
@@ -1153,16 +1153,8 @@ int __init __weak early_init_dt_mark_hotplug_memory_arch(u64 base, u64 size)
 int __init __weak early_init_dt_reserve_memory_arch(phys_addr_t base,
 					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.
-		 */
-		if (memblock_is_region_reserved(base, size))
-			return -EBUSY;
-
+	if (nomap)
 		return memblock_mark_nomap(base, size);
-	}
 	return memblock_reserve(base, size);
 }
 
Signature · 1 line
2.31.1.607.g51e8a6a459-goog
#2 lore raw

PATCH 1/2 Revert "of/fdt: Make sure no-map does not remove already reserved regions"

In reply to Quentin Perret

This reverts commit 74f2678aab60c9915daa83e6e23d31a896932d9d. It is not really a fix, and the backport misses dependencies, which breaks existing platforms.

---
 drivers/of/fdt.c | 10 +---------
 1 file changed, 1 insertion(+), 9 deletions(-)
drivers/of/fdt.c +1 -9
index 21160a08ead4..aa15e5d183c1 100644
@@ -1172,16 +1172,8 @@ int __init __weak early_init_dt_mark_hotplug_memory_arch(u64 base, u64 size)
 int __init __weak early_init_dt_reserve_memory_arch(phys_addr_t base,
 					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.
-		 */
-		if (memblock_is_region_reserved(base, size))
-			return -EBUSY;
-
+	if (nomap)
 		return memblock_mark_nomap(base, size);
-	}
 	return memblock_reserve(base, size);
 }
 
Signature · 1 line
2.31.1.607.g51e8a6a459-goog
#3 lore raw

PATCH 2/2 Revert "fdt: Properly handle "no-map" field in the memory region"

This reverts commit 03972d6b1bbac1620455589e0367f6f69ff7b2df. It is not really a fix, and the backport misses dependencies, which breaks existing platforms.

---
 drivers/of/fdt.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/of/fdt.c +1 -1
index aa15e5d183c1..800ad252cf9c 100644
@@ -1173,7 +1173,7 @@ int __init __weak early_init_dt_reserve_memory_arch(phys_addr_t base,
 					phys_addr_t size, bool nomap)
 {
 	if (nomap)
-		return memblock_mark_nomap(base, size);
+		return memblock_remove(base, size);
 	return memblock_reserve(base, size);
 }
 
Signature · 1 line
2.31.1.607.g51e8a6a459-goog
#4 lore raw

PATCH 1/2 Revert "of/fdt: Make sure no-map does not remove already reserved regions"

In reply to Quentin Perret

This reverts commit 6793433fc8f263eaba1621d3724b6aeba511c6c5. It is not really a fix, and the backport misses dependencies, which breaks existing platforms.

---
 drivers/of/fdt.c | 10 +---------
 1 file changed, 1 insertion(+), 9 deletions(-)
drivers/of/fdt.c +1 -9
index 3f58812d02d9..6df66fcefbb4 100644
@@ -1212,16 +1212,8 @@ int __init __weak early_init_dt_mark_hotplug_memory_arch(u64 base, u64 size)
 int __init __weak early_init_dt_reserve_memory_arch(phys_addr_t base,
 					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.
-		 */
-		if (memblock_is_region_reserved(base, size))
-			return -EBUSY;
-
+	if (nomap)
 		return memblock_mark_nomap(base, size);
-	}
 	return memblock_reserve(base, size);
 }
 
Signature · 1 line
2.31.1.607.g51e8a6a459-goog
#5 lore raw

PATCH 2/2 Revert "fdt: Properly handle "no-map" field in the memory region"

This reverts commit 71bc5d496725f7f923904d2f41cd39e32c647fdf. It is not really a fix, and the backport misses dependencies, which breaks existing platforms.

---
 drivers/of/fdt.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/of/fdt.c +1 -1
index 6df66fcefbb4..6337c394bfe3 100644
@@ -1213,7 +1213,7 @@ int __init __weak early_init_dt_reserve_memory_arch(phys_addr_t base,
 					phys_addr_t size, bool nomap)
 {
 	if (nomap)
-		return memblock_mark_nomap(base, size);
+		return memblock_remove(base, size);
 	return memblock_reserve(base, size);
 }
 
Signature · 1 line
2.31.1.607.g51e8a6a459-goog
#6 lore raw

PATCH 1/2 Revert "of/fdt: Make sure no-map does not remove already reserved regions"

In reply to Quentin Perret

This reverts commit 666ae7c255f9eb7a8fd8e55641542f3624a78b43. It is not really a fix, and the backport misses dependencies, which breaks existing platforms.

---
 drivers/of/fdt.c | 10 +---------
 1 file changed, 1 insertion(+), 9 deletions(-)
drivers/of/fdt.c +1 -9
index 9054b8f218a7..f90b626269ab 100644
@@ -1158,16 +1158,8 @@ void __init __weak early_init_dt_add_memory_arch(u64 base, u64 size)
 int __init __weak early_init_dt_reserve_memory_arch(phys_addr_t base,
 					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.
-		 */
-		if (memblock_is_region_reserved(base, size))
-			return -EBUSY;
-
+	if (nomap)
 		return memblock_mark_nomap(base, size);
-	}
 	return memblock_reserve(base, size);
 }
 
Signature · 1 line
2.31.1.607.g51e8a6a459-goog
#7 lore raw

PATCH 2/2 Revert "fdt: Properly handle "no-map" field in the memory region"

This reverts commit 86ac82a7c708acf4738c396228be7b8fdaae4d99. It is not really a fix, and the backport misses dependencies, which breaks existing platforms.

---
 drivers/of/fdt.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/of/fdt.c +1 -1
index f90b626269ab..e9360d5cbcba 100644
@@ -1159,7 +1159,7 @@ int __init __weak early_init_dt_reserve_memory_arch(phys_addr_t base,
 					phys_addr_t size, bool nomap)
 {
 	if (nomap)
-		return memblock_mark_nomap(base, size);
+		return memblock_remove(base, size);
 	return memblock_reserve(base, size);
 }
 
Signature · 1 line
2.31.1.607.g51e8a6a459-goog
#8 lore raw

PATCH 2/2 Revert "fdt: Properly handle "no-map" field in the memory region"

In reply to Quentin Perret

This reverts commit fb326c6ce0dcbb6273202c6e012759754ec8538d. It is not really a fix, and the backport misses dependencies, which breaks existing platforms.

---
 drivers/of/fdt.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/of/fdt.c +1 -1
index 036af904e0cf..223d617ecfe1 100644
@@ -1154,7 +1154,7 @@ int __init __weak early_init_dt_reserve_memory_arch(phys_addr_t base,
 					phys_addr_t size, bool nomap)
 {
 	if (nomap)
-		return memblock_mark_nomap(base, size);
+		return memblock_remove(base, size);
 	return memblock_reserve(base, size);
 }
 
Signature · 1 line
2.31.1.607.g51e8a6a459-goog
#9 lore raw
In reply to Quentin Perret
Quoted 15 lines · Quentin Perret

Hi all,

A breakage in 5.4.102 has been reported [1] due to the backport of the two following upstream commits:

8a5a75e5e9e5 ("of/fdt: Make sure no-map does not remove already reserved regions") 86588296acbf ("fdt: Properly handle "no-map" field in the memory region")

As Alexandre noted in the original thread, the backport missed dependencies. But since these patches were not really fixes in the first place, it seems preferable to simply revert them from 5.4 and earlier.

[1] https://lore.kernel.org/linux-arm-kernel/CAL_Jsq+LUPZFhXd+j-xM67rZB=pvEvZM+1sfckip0Lqq02PkZQ@mail.gmail.com/

Quoted 8 lines

Quentin Perret (2):
Revert "of/fdt: Make sure no-map does not remove already reserved
regions"
Revert "fdt: Properly handle "no-map" field in the memory region"

 drivers/of/fdt.c | 12 ++----------
 1 file changed, 2 insertions(+), 10 deletions(-)
maintainer
#10 lore raw
In reply to Quentin Perret
Quoted 14 lines · Quentin Perret

Hi all,

A breakage in 5.4.102 has been reported [1] due to the backport of the two following upstream commits:

8a5a75e5e9e5 ("of/fdt: Make sure no-map does not remove already reserved regions") 86588296acbf ("fdt: Properly handle "no-map" field in the memory region")

As Alexandre noted in the original thread, the backport missed dependencies. But since these patches were not really fixes in the first place, it seems preferable to simply revert them from 5.4 and earlier.

[1] https://lore.kernel.org/linux-arm-kernel/CAL_Jsq+LUPZFhXd+j-xM67rZB=pvEvZM+1sfckip0Lqq02PkZQ@mail.gmail.com/

Quoted 7 lines

Quentin Perret (2):
Revert "of/fdt: Make sure no-map does not remove already reserved
regions"
Revert "fdt: Properly handle "no-map" field in the memory region"

 drivers/of/fdt.c | 12 ++----------
 1 file changed, 2 insertions(+), 10 deletions(-)

All now queued up, thanks.

greg k-h