riscv: Do not invoke early_init_dt_verify() twice
PATCH 1/1 riscv: Do not invoke early_init_dt_verify() twice
In the setup_arch() of riscv, function early_init_dt_verify() has been done by parse_dtb(). So no need to call it again. Just directly invoke unflatten_device_tree().
--- arch/riscv/kernel/setup.c | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-)
arch/riscv/kernel/setup.c +1 -4
@@ -255,10 +255,7 @@ void __init setup_arch(char **cmdline_p)#if IS_ENABLED (CONFIG_BUILTIN_DTB )unflatten_and_copy_device_tree ();#else -if (early_init_dt_verify (__va (dtb_early_pa))) -unflatten_device_tree (); -else -pr_err ("No DTB found in kernel mappings\n" ); +unflatten_device_tree ();#endif misc_mem_init ();
Signature · 7 lines
2.30.2 _______________________________________________ linux-riscv mailing list [email protected] http://lists.infradead.org/mailman/listinfo/linux-riscv
Quoted 15 lines · Changbin Du
In the
setup_arch()of riscv, functionearly_init_dt_verify()has been done byparse_dtb(). So no need to call it again. Just directly invokeunflatten_device_tree().Signed-off-by Changbin Du <[email protected]>--- arch/riscv/kernel/setup.c | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-)arch/riscv/kernel/setup.c +0
-0
arch/riscv/kernel/setup.c void __init setup_arch(char **cmdline_p) · line 259
Quoted 9 lines
arch/riscv/kernel/setup.c +1
-4@@ -255,10 +255,7 @@ void __init setup_arch(char **cmdline_p)#if IS_ENABLED (CONFIG_BUILTIN_DTB )unflatten_and_copy_device_tree ();#else -if (early_init_dt_verify (__va (dtb_early_pa))) -unflatten_device_tree (); -else -pr_err ("No DTB found in kernel mappings\n" ); +unflatten_device_tree ();#endif
The early_init_dt_verify() set he DTB base address in Linux OF.
When parse_dtb() calls early_init_dt_verify(), MMU is enabled but we have temporary mapping for DTB (i.e. dtb_early_va).
After paging_init(), we have moved to final swapper_pg_dir so temporary mapping for DTB does not exists anymore but DTB is at same physical address so update DTB base address in Linux OF by calling early_init_dt_verify() again.
Based on above, NACK to this patch.
Regards,
Anup
Quoted 10 lines
arch/riscv/kernel/setup.c +0
-1misc_mem_init (); --2.30.2
_______________________________________________
linux-riscv mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-riscv
_______________________________________________
linux-riscv mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-riscv
Quoted 31 lines · Anup Patel
Quoted 15 lines · Changbin Du
In the
setup_arch()of riscv, functionearly_init_dt_verify()has been done byparse_dtb(). So no need to call it again. Just directly invokeunflatten_device_tree().Signed-off-by Changbin Du <[email protected]>--- arch/riscv/kernel/setup.c | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-)arch/riscv/kernel/setup.c +0
-0arch/riscv/kernel/setup.c void __init setup_arch(char **cmdline_p) · line 259
Quoted 9 lines
arch/riscv/kernel/setup.c +1
-4@@ -255,10 +255,7 @@ void __init setup_arch(char **cmdline_p)#if IS_ENABLED (CONFIG_BUILTIN_DTB )unflatten_and_copy_device_tree ();#else -if (early_init_dt_verify (__va (dtb_early_pa))) -unflatten_device_tree (); -else -pr_err ("No DTB found in kernel mappings\n" ); +unflatten_device_tree ();#endif The
early_init_dt_verify()set he DTB base address in Linux OF.When
parse_dtb()callsearly_init_dt_verify(), MMU is enabled but we have temporary mapping for DTB (i.e.dtb_early_va).
Quoted 7 lines
After
paging_init(), we have moved to finalswapper_pg_dirso temporary mapping for DTB does not exists anymore but DTB is at same physical address so update DTB base address in Linux OF by callingearly_init_dt_verify()again.Based on above, NACK to this patch.
No problem, thanks!
Quoted 13 lines
Regards,
AnupQuoted 10 lines
arch/riscv/kernel/setup.c +0
-1misc_mem_init (); --2.30.2
_______________________________________________
linux-riscv mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-riscv
Signature · 7 lines
Cheers, Changbin Du _______________________________________________ linux-riscv mailing list [email protected] http://lists.infradead.org/mailman/listinfo/linux-riscv