From fac207b672bac4e91661afc8d7c6ba4f47bbc652 Mon Sep 17 00:00:00 2001 From: Huibin Hong Date: Tue, 19 Sep 2023 08:53:13 +0000 Subject: [PATCH] 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 Change-Id: I38cda3a6cee160ba1293a2e18c7238c96cf2e755 --- arch/arm64/kernel/traps.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/arch/arm64/kernel/traps.c b/arch/arm64/kernel/traps.c index a6ba4362e36d..49b4b7b76369 100644 --- a/arch/arm64/kernel/traps.c +++ b/arch/arm64/kernel/traps.c @@ -48,6 +48,10 @@ #include +#if IS_ENABLED(CONFIG_ROCKCHIP_MINIDUMP) +#include +#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();