From bc24e0b49aa00241e166655f8d8c771e908ea459 Mon Sep 17 00:00:00 2001 From: Huibin Hong Date: Tue, 19 Mar 2024 18:22:00 +0800 Subject: [PATCH] fiq_debugger: arm64: fix command bt, show correct call stack Change-Id: I718bdfb4247e67542ae665572b0438066fd9daab Signed-off-by: Huibin Hong --- drivers/soc/rockchip/fiq_debugger/fiq_debugger_arm64.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/drivers/soc/rockchip/fiq_debugger/fiq_debugger_arm64.c b/drivers/soc/rockchip/fiq_debugger/fiq_debugger_arm64.c index d77b1ebdcde7..21d11ac2478c 100644 --- a/drivers/soc/rockchip/fiq_debugger/fiq_debugger_arm64.c +++ b/drivers/soc/rockchip/fiq_debugger/fiq_debugger_arm64.c @@ -159,7 +159,6 @@ struct stacktrace_state { unsigned int depth; }; -#if LINUX_VERSION_CODE < KERNEL_VERSION(5, 16, 0) static bool report_trace(void *data, unsigned long pc) { struct stacktrace_state *sts = data; @@ -173,7 +172,6 @@ static bool report_trace(void *data, unsigned long pc) return sts->depth != 0; } -#endif void fiq_debugger_dump_stacktrace(struct fiq_debugger_output *output, const struct pt_regs *regs, unsigned int depth, void *ssp) @@ -199,6 +197,11 @@ void fiq_debugger_dump_stacktrace(struct fiq_debugger_output *output, output->printf(output, "\n"); walk_stackframe(current, &frame, report_trace, &sts); } +#else + if (!user_mode(regs)) { + output->printf(output, "\n"); + arch_stack_walk(report_trace, (void *)&sts, current, (struct pt_regs *)regs); + } #endif } #endif