Skip to contentSkip to conversation

arm: mach-k3: Warn when node to disable is not found

PATCH New Andrew F. Davis 2 participants 2 messages Jan 7, 2020 – Jan 8, 2020

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 arm: mach-k3: Warn when node to disable is not found

Not finding a node that we try to disable does not always need to be fatal to boot but should at least print out a warning. Return error from fdt_disable_node as it did fail to disable the node, but only warn in the case of disabling the TRNG as this will not prevent boot.

---
 arch/arm/mach-k3/common.c | 4 ++--
 board/ti/am65x/evm.c      | 4 +---
 2 files changed, 3 insertions(+), 5 deletions(-)
arch/arm/mach-k3/common.c +2 -2
index 50f5b81dfe..e8b7d70e75 100644
@@ -174,8 +174,8 @@ int fdt_disable_node(void *blob, char *node_path)
 
 	offs = fdt_path_offset(blob, node_path);
 	if (offs < 0) {
-		debug("Node %s not found.\n", node_path);
-		return 0;
+		printf("Node %s not found.\n", node_path);
+		return offs;
 	}
 	ret = fdt_setprop_string(blob, offs, "status", "disabled");
 	if (ret < 0) {
board/ti/am65x/evm.c +1 -3
index 4d86757c39..a610879424 100644
@@ -105,10 +105,8 @@ int ft_board_setup(void *blob, bd_t *bd)
 #if defined(CONFIG_TI_SECURE_DEVICE)
 	/* Make HW RNG reserved for secure world use */
 	ret = fdt_disable_node(blob, "/interconnect at 100000/trng@4e10000");
-	if (ret) {
+	if (ret)
 		printf("%s: disabling TRGN failed %d\n", __func__, ret);
-		return ret;
-	}
 #endif
 
 	return 0;
Signature · 1 line
2.17.1
#1 lore raw

PATCH 1/1 arm: mach-k3: Warn when node to disable is not found

Quoted 6 lines · Andrew F. Davis

Not finding a node that we try to disable does not always need to be fatal to boot but should at least print out a warning. Return error from fdt_disable_node as it did fail to disable the node, but only warn in the case of disabling the TRNG as this will not prevent boot.

Thanks and regards,
Lokesh

Quoted 37 lines
---
 arch/arm/mach-k3/common.c | 4 ++--
 board/ti/am65x/evm.c      | 4 +---
 2 files changed, 3 insertions(+), 5 deletions(-)
arch/arm/mach-k3/common.c +2 -2
index 50f5b81dfe..e8b7d70e75 100644
@@ -174,8 +174,8 @@ int fdt_disable_node(void *blob, char *node_path)
 
 	offs = fdt_path_offset(blob, node_path);
 	if (offs < 0) {
-		debug("Node %s not found.\n", node_path);
-		return 0;
+		printf("Node %s not found.\n", node_path);
+		return offs;
 	}
 	ret = fdt_setprop_string(blob, offs, "status", "disabled");
 	if (ret < 0) {
board/ti/am65x/evm.c +1 -3
index 4d86757c39..a610879424 100644
@@ -105,10 +105,8 @@ int ft_board_setup(void *blob, bd_t *bd)
 #if defined(CONFIG_TI_SECURE_DEVICE)
 	/* Make HW RNG reserved for secure world use */
 	ret = fdt_disable_node(blob, "/interconnect at 100000/trng at 4e10000");
-	if (ret) {
+	if (ret)
 		printf("%s: disabling TRGN failed %d\n", __func__, ret);
-		return ret;
-	}
 #endif
 
 	return 0;