* [PATCH 1/1] riscv: reset after crash
@ 2020-09-26 8:20 Heinrich Schuchardt
2020-09-26 18:16 ` Sean Anderson
0 siblings, 1 reply; 3+ messages in thread
From: Heinrich Schuchardt @ 2020-09-26 8:20 UTC (permalink / raw)
To: u-boot
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 <xypron.glpk@gmx.de>
---
arch/riscv/lib/interrupts.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/arch/riscv/lib/interrupts.c b/arch/riscv/lib/interrupts.c
index 8ff40f0f36..f95cb97f92 100644
--- a/arch/riscv/lib/interrupts.c
+++ b/arch/riscv/lib/interrupts.c
@@ -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
^ permalink raw reply related [flat|nested] 3+ messages in thread
* [PATCH 1/1] riscv: reset after crash
2020-09-26 8:20 [PATCH 1/1] riscv: reset after crash Heinrich Schuchardt
@ 2020-09-26 18:16 ` Sean Anderson
2020-09-26 23:02 ` Heinrich Schuchardt
0 siblings, 1 reply; 3+ messages in thread
From: Sean Anderson @ 2020-09-26 18:16 UTC (permalink / raw)
To: u-boot
On 9/26/20 4:20 AM, Heinrich Schuchardt wrote:
> 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 <xypron.glpk@gmx.de>
> ---
> arch/riscv/lib/interrupts.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/arch/riscv/lib/interrupts.c b/arch/riscv/lib/interrupts.c
> index 8ff40f0f36..f95cb97f92 100644
> --- a/arch/riscv/lib/interrupts.c
> +++ b/arch/riscv/lib/interrupts.c
> @@ -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
^ permalink raw reply [flat|nested] 3+ messages in thread
* [PATCH 1/1] riscv: reset after crash
2020-09-26 18:16 ` Sean Anderson
@ 2020-09-26 23:02 ` Heinrich Schuchardt
0 siblings, 0 replies; 3+ messages in thread
From: Heinrich Schuchardt @ 2020-09-26 23:02 UTC (permalink / raw)
To: u-boot
On 9/26/20 8:16 PM, Sean Anderson wrote:
> On 9/26/20 4:20 AM, Heinrich Schuchardt wrote:
>> 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 <xypron.glpk@gmx.de>
>> ---
>> arch/riscv/lib/interrupts.c | 2 +-
>> 1 file changed, 1 insertion(+), 1 deletion(-)
>>
>> diff --git a/arch/riscv/lib/interrupts.c b/arch/riscv/lib/interrupts.c
>> index 8ff40f0f36..f95cb97f92 100644
>> --- a/arch/riscv/lib/interrupts.c
>> +++ b/arch/riscv/lib/interrupts.c
>> @@ -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...".
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
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2020-09-26 23:02 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-09-26 8:20 [PATCH 1/1] riscv: reset after crash Heinrich Schuchardt
2020-09-26 18:16 ` Sean Anderson
2020-09-26 23:02 ` Heinrich Schuchardt
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.