riscv: reset after crash
PATCH 1/1 riscv: reset after crash
If an exception occurs on ARM or x86, we call panic() which will try to reset the board. Do the same on RISC-V.
--- arch/riscv/lib/interrupts.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
arch/riscv/lib/interrupts.c +1 -1
@@ -84,7 +84,7 @@ static void _exit_trap(ulong code, ulong epc, ulong tval, struct pt_regs *regs)show_regs (regs);show_efi_loaded_images (epc); -hang (); +panic ("Resetting CPU ...\n" ); }int interrupt_init (void )
--
2.28.0
PATCH 1/1 riscv: reset after crash
Quoted 13 lines · Heinrich Schuchardt
If an exception occurs on ARM or x86, we call
panic()which will try to reset the board. Do the same on RISC-V.Signed-off-by Heinrich Schuchardt <[email protected]>--- arch/riscv/lib/interrupts.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)arch/riscv/lib/interrupts.c +0
-0
arch/riscv/lib/interrupts.c static void _exit_trap(ulong code, ulong epc, ulong tval, struct pt_regs *regs) · line 87
Quoted 5 lines
arch/riscv/lib/interrupts.c +1
-1@@ -84,7 +84,7 @@ static void _exit_trap(ulong code, ulong epc, ulong tval, struct pt_regs *regs)show_regs (regs);show_efi_loaded_images (epc); -hang (); +panic ("Resetting CPU ...\n" );
Nits: no space before parentheses.
Do we need a message here? do_panic already prints "resetting...".
--Sean
PATCH 1/1 riscv: reset after crash
Quoted 15 lines · Sean Anderson
Quoted 14 lines · Heinrich Schuchardt
If an exception occurs on ARM or x86, we call
panic()which will try to reset the board. Do the same on RISC-V.Signed-off-by Heinrich Schuchardt <[email protected]>--- arch/riscv/lib/interrupts.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)arch/riscv/lib/interrupts.c +0
-0@@ -84,7 +84,7 @@ static void _exit_trap(ulong code, ulong epc, ulong tval, struct pt_regs *regs)
Quoted 8 lines
arch/riscv/lib/interrupts.c static void _exit_trap(ulong code, ulong epc, ulong tval, struct pt_regs *regs) · line 87
Quoted 4 lines
arch/riscv/lib/interrupts.c +1
-1show_regs (regs);show_efi_loaded_images (epc); -hang (); +panic ("Resetting CPU ...\n" );Nits: no space before parentheses.
Do we need a message here?
do_panicalready prints "resetting...".
May be I should not have blindly copied from ARM.
With CONFIG_PANIC_HANG=y the next message will be:
### ERROR ### Please RESET the board ###
"resetting..." is printed by the respective implementation of do_reset() depending on the value of CONFIG_SYSRESET=y.
As on all three passways we have a follow up message, passing an empty string "" to panic() should be enough.
Best regards
Heinrich