Skip to contentSkip to conversation

powerpc/prom: Remove redundant early_init_dt_scan_root() call

PATCH Applied Sourabh Jain 4 participants 5 messages Apr 18 – Sep 14 PowerPC

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 powerpc/prom: Remove redundant early_init_dt_scan_root() call

Commit 554b66233623 ("of/fdt: Scan the root node properties earlier") moved the invocation of early_init_dt_scan_root() into early_init_dt_verify().

early_init_devtree() already calls early_init_dt_verify(), so the root node properties are parsed before reaching the explicit call in this function.

Keeping the call here results in scanning the root node twice. Remove the redundant call and rely on the invocation from early_init_dt_verify().

This change keeps the behavior the same and removes an unnecessary duplicate call.

Cc Aditya Gupta <[email protected]>
Cc "Christophe Leroy (CS GROUP)" <[email protected]>
Cc Hari Bathini <[email protected]>
Cc Madhavan Srinivasan <[email protected]>
Cc Mahesh Salgaonkar <[email protected]>
Cc Michael Ellerman <[email protected]>
Cc Nicholas Piggin <[email protected]>
Cc "Ritesh Harjani (IBM)" <[email protected]>
Cc Shivang Upadhyay <[email protected]>
Cc Venkat Rao Bagalkote <[email protected]>
---
 arch/powerpc/kernel/prom.c | 1 -
 1 file changed, 1 deletion(-)
arch/powerpc/kernel/prom.c +0 -1
index 9ed9dde7d231..d218c8cc1f73 100644
@@ -824,7 +824,6 @@ void __init early_init_devtree(void *params)
 	fadump_append_bootargs();
 
 	/* Scan memory nodes and rebuild MEMBLOCKs */
-	early_init_dt_scan_root();
 	early_init_dt_scan_memory_ppc();
 
 	/*
Signature · 1 line
2.52.0
Tested-by on v1 1/1
#1 lore raw
Quoted 46 lines · Sourabh Jain

Commit 554b66233623 ("of/fdt: Scan the root node properties earlier") moved the invocation of early_init_dt_scan_root() into early_init_dt_verify().

early_init_devtree() already calls early_init_dt_verify(), so the root node properties are parsed before reaching the explicit call in this function.

Keeping the call here results in scanning the root node twice. Remove the redundant call and rely on the invocation from early_init_dt_verify().

This change keeps the behavior the same and removes an unnecessary duplicate call.

Cc Aditya Gupta <[email protected]>
Cc "Christophe Leroy (CS GROUP)" <[email protected]>
Cc Hari Bathini <[email protected]>
Cc Madhavan Srinivasan <[email protected]>
Cc Mahesh Salgaonkar <[email protected]>
Cc Michael Ellerman <[email protected]>
Cc Nicholas Piggin <[email protected]>
Cc "Ritesh Harjani (IBM)" <[email protected]>
Cc Shivang Upadhyay <[email protected]>
Cc Venkat Rao Bagalkote <[email protected]>
---
 arch/powerpc/kernel/prom.c | 1 -
 1 file changed, 1 deletion(-)
arch/powerpc/kernel/prom.c +0 -1
index 9ed9dde7d231..d218c8cc1f73 100644
@@ -824,7 +824,6 @@ void __init early_init_devtree(void *params)
 	fadump_append_bootargs();
 
 	/* Scan memory nodes and rebuild MEMBLOCKs */
-	early_init_dt_scan_root();
 	early_init_dt_scan_memory_ppc();
 
 	/*
Signature · 1 line
2.52.0

Hi Sourabh,

Patch Looks good to me. Ran a quick boot test also. Feel free to add.

~Shivang.

#2 lore raw
Quoted 49 lines · Shivang Upadhyay
Quoted 46 lines · Sourabh Jain

Commit 554b66233623 ("of/fdt: Scan the root node properties earlier") moved the invocation of early_init_dt_scan_root() into early_init_dt_verify().

early_init_devtree() already calls early_init_dt_verify(), so the root node properties are parsed before reaching the explicit call in this function.

Keeping the call here results in scanning the root node twice. Remove the redundant call and rely on the invocation from early_init_dt_verify().

This change keeps the behavior the same and removes an unnecessary duplicate call.

Cc Aditya Gupta <[email protected]>
Cc "Christophe Leroy (CS GROUP)" <[email protected]>
Cc Hari Bathini <[email protected]>
Cc Madhavan Srinivasan <[email protected]>
Cc Mahesh Salgaonkar <[email protected]>
Cc Michael Ellerman <[email protected]>
Cc Nicholas Piggin <[email protected]>
Cc "Ritesh Harjani (IBM)" <[email protected]>
Cc Shivang Upadhyay <[email protected]>
Cc Venkat Rao Bagalkote <[email protected]>
---
  arch/powerpc/kernel/prom.c | 1 -
  1 file changed, 1 deletion(-)
arch/powerpc/kernel/prom.c +0 -1
index 9ed9dde7d231..d218c8cc1f73 100644
@@ -824,7 +824,6 @@ void __init early_init_devtree(void *params)
  	fadump_append_bootargs();
 
  	/* Scan memory nodes and rebuild MEMBLOCKs */
-	early_init_dt_scan_root();
  	early_init_dt_scan_memory_ppc();
 
  	/*
Signature · 1 line
2.52.0

Hi Sourabh,

Quoted 4 lines

Patch Looks good to me. Ran a quick boot test also. Feel free to add.

Thanks for the testing and review, Shivang.

- Sourabh Jain

reviewer Reviewed-by on v1 1/1
#3 lore raw
In reply to Sourabh Jain
Quoted 8 lines · Sourabh Jain

Commit 554b66233623 ("of/fdt: Scan the root node properties earlier") moved the invocation of early_init_dt_scan_root() into early_init_dt_verify().

early_init_devtree() already calls early_init_dt_verify(), so the root node properties are parsed before reaching the explicit call in this function.

Quoted 7 lines

Keeping the call here results in scanning the root node twice. Remove the redundant call and rely on the invocation from early_init_dt_verify().

This change keeps the behavior the same and removes an unnecessary duplicate call.

yup. Nice catch! LGTM. Feel free to add:

maintainer Applied
#4 lore raw
In reply to Sourabh Jain
Quoted 9 lines · Sourabh Jain

Commit 554b66233623 ("of/fdt: Scan the root node properties earlier") moved the invocation of early_init_dt_scan_root() into early_init_dt_verify().

early_init_devtree() already calls early_init_dt_verify(), so the root node properties are parsed before reaching the explicit call in this function.

[...]

Applied to powerpc/fixes.

[1/1] powerpc/prom: Remove redundant early_init_dt_scan_root() call

      https://git.kernel.org/powerpc/c/15f3ce3aa218f6d4cece9101f1af4332e8712e39

cheers