From: Heinrich Schuchardt Date: Sun, 27 Sep 2020 01:02:32 +0200 Subject: [PATCH 1/1] riscv: reset after crash In-Reply-To: <38cde750-89e7-9eb2-7c79-7120c414ad3e@gmail.com> References: <20200926082057.52994-1-xypron.glpk@gmx.de> <38cde750-89e7-9eb2-7c79-7120c414ad3e@gmail.com> Message-ID: <2cf35087-1fcc-c583-a62c-7cb2ec90cbfe@gmx.de> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de 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 >> --- >> 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