arm64: traps: save cpu regs to minidump when cpus die

If two cpu die at the same time, the first cpu get die_lock,
calls minidump die notify and saves regs, then panics.
But the second cpu would hardlock because it can't get the die_lock.
And nothing is saved to minidump, so we have the patch.

Signed-off-by: Huibin Hong <huibin.hong@rock-chips.com>
Change-Id: I38cda3a6cee160ba1293a2e18c7238c96cf2e755
This commit is contained in:
Huibin Hong
2023-09-19 08:53:13 +00:00
committed by Huibin,Hong
parent 6925da1c98
commit fac207b672

View File

@@ -48,6 +48,10 @@
#include <trace/hooks/traps.h>
#if IS_ENABLED(CONFIG_ROCKCHIP_MINIDUMP)
#include <soc/rockchip/rk_minidump.h>
#endif
static const char *handler[]= {
"Synchronous Abort",
"IRQ",
@@ -123,6 +127,9 @@ void die(const char *str, struct pt_regs *regs, int err)
int ret;
unsigned long flags;
#if IS_ENABLED(CONFIG_ROCKCHIP_MINIDUMP)
rk_minidump_update_cpu_regs(regs);
#endif
raw_spin_lock_irqsave(&die_lock, flags);
oops_enter();