Skip to contentSkip to conversation

image: fdt: check "status" of "/reserved-memory" subnodes

PATCH New Thirupathaiah Annapureddy 3 participants 5 messages Jan 7, 2020 – Feb 5, 2020

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 image: fdt: check "status" of "/reserved-memory" subnodes

boot_fdt_add_mem_rsv_regions() scans the subnodes of "/reserved-memory" and adds them to reserved lmb regions. Currently this scanning does not take into "status" property. Even if the subnode is disabled, it gets added to the reserved lmb regions.

This patch checks the "status" property before adding it to reserved lmb regions.

---
 common/image-fdt.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
common/image-fdt.c +1 -1
index 48388488d9..cf13d655c0 100644
@@ -122,7 +122,7 @@ void boot_fdt_add_mem_rsv_regions(struct lmb *lmb, void *fdt_blob)
 			/* check if this subnode has a reg property */
 			ret = fdt_get_resource(fdt_blob, subnode, "reg", 0,
 					       &res);
-			if (!ret) {
+			if (!ret && fdtdec_get_is_enabled(fdt_blob, subnode)) {
 				addr = res.start;
 				size = res.end - res.start + 1;
 				boot_fdt_reserve_region(lmb, addr, size);
Signature · 1 line
2.24.1
#1 lore raw

PATCH 1/1 image: fdt: check "status" of "/reserved-memory" subnodes

Quoted 11 lines · Thirupathaiah Annapureddy

boot_fdt_add_mem_rsv_regions() scans the subnodes of "/reserved-memory" and adds them to reserved lmb regions. Currently this scanning does not take into "status" property. Even if the subnode is disabled, it gets added to the reserved lmb regions.

This patch checks the "status" property before adding it to reserved lmb regions.

Quoted 20 lines
---
 common/image-fdt.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
common/image-fdt.c +1 -2
index 48388488d9..cf13d655c0 100644
@@ -122,7 +122,7 @@ void boot_fdt_add_mem_rsv_regions(struct lmb *lmb, void *fdt_blob)
                        /* check if this subnode has a reg property */
                        ret = fdt_get_resource(fdt_blob, subnode, "reg", 0,
                                               &res);
-                       if (!ret) {
+                       if (!ret && fdtdec_get_is_enabled(fdt_blob, subnode)) {
                                addr = res.start;
                                size = res.end - res.start + 1;
                                boot_fdt_reserve_region(lmb, addr, size);
--

2.24.1

#2 lore raw

PATCH 1/1 image: fdt: check "status" of "/reserved-memory" subnodes

Thank You Simon for the review.

May I know what are the next steps in making forward progress on this?

Best Regards,
Thiru

Quoted 36 lines · Simon Goldschmidt
Quoted 11 lines · Thirupathaiah Annapureddy

boot_fdt_add_mem_rsv_regions() scans the subnodes of "/reserved-memory" and adds them to reserved lmb regions. Currently this scanning does not take into "status" property. Even if the subnode is disabled, it gets added to the reserved lmb regions.

This patch checks the "status" property before adding it to reserved lmb regions.

Quoted 20 lines
---
 common/image-fdt.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
common/image-fdt.c +1 -2
index 48388488d9..cf13d655c0 100644
@@ -122,7 +122,7 @@ void boot_fdt_add_mem_rsv_regions(struct lmb *lmb, void *fdt_blob)
                        /* check if this subnode has a reg property */
                        ret = fdt_get_resource(fdt_blob, subnode, "reg", 0,
                                               &res);
-                       if (!ret) {
+                       if (!ret && fdtdec_get_is_enabled(fdt_blob, subnode)) {
                                addr = res.start;
                                size = res.end - res.start + 1;
                                boot_fdt_reserve_region(lmb, addr, size);
--

2.24.1

#3 lore raw

PATCH 1/1 image: fdt: check "status" of "/reserved-memory" subnodes

]Hi Thirupathaiah,

Quoted 4 lines · Thirupathaiah Annapureddy

Thank You Simon for the review.

May I know what are the next steps in making forward progress on this?

The patch is in my queue but I've had some test failures. Assuming it is not the culprit I expect it will be applied by next week.

Regards,
Simon

Quoted 41 lines

Best Regards,
Thiru

Quoted 36 lines · Simon Goldschmidt
Quoted 11 lines · Thirupathaiah Annapureddy

boot_fdt_add_mem_rsv_regions() scans the subnodes of "/reserved-memory" and adds them to reserved lmb regions. Currently this scanning does not take into "status" property. Even if the subnode is disabled, it gets added to the reserved lmb regions.

This patch checks the "status" property before adding it to reserved lmb regions.

Quoted 20 lines
---
 common/image-fdt.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
common/image-fdt.c +1 -2
index 48388488d9..cf13d655c0 100644
@@ -122,7 +122,7 @@ void boot_fdt_add_mem_rsv_regions(struct lmb *lmb, void *fdt_blob)
                        /* check if this subnode has a reg property */
                        ret = fdt_get_resource(fdt_blob, subnode, "reg", 0,
                                               &res);
-                       if (!ret) {
+                       if (!ret && fdtdec_get_is_enabled(fdt_blob, subnode)) {
                                addr = res.start;
                                size = res.end - res.start + 1;
                                boot_fdt_reserve_region(lmb, addr, size);
--

2.24.1

#4 lore raw

PATCH 1/1 image: fdt: check "status" of "/reserved-memory" subnodes

Quoted 6 lines · Simon Glass

]Hi Thirupathaiah,

Quoted 1 line · Thirupathaiah Annapureddy
Quoted 6 lines
Quoted 3 lines

Thank You Simon for the review.

May I know what are the next steps in making forward progress on this?

The patch is in my queue but I've had some test failures. Assuming it is not the culprit I expect it will be applied by next week.

Applied to u-boot-dm, thanks!