From: Guo Ren Date: Thu, 31 Jan 2019 06:34:37 +0000 (+0800) Subject: csky: Fixup dead loop in show_stack X-Git-Tag: v5.0-rc7~5^2 X-Git-Url: https://git.kernel.dk/?a=commitdiff_plain;h=131aee8b9807bc98379fa5a0270389dbc7dcec90;p=linux-2.6-block.git csky: Fixup dead loop in show_stack When STACKTRACE is enabled, we must pass fp as stack for unwind, otherwise random value in stack will casue a dead loop. Signed-off-by: Guo Ren Reported-by: Lu Baoquan --- diff --git a/arch/csky/kernel/dumpstack.c b/arch/csky/kernel/dumpstack.c index 659253e9989c..d67f9777cfd9 100644 --- a/arch/csky/kernel/dumpstack.c +++ b/arch/csky/kernel/dumpstack.c @@ -38,7 +38,11 @@ void show_stack(struct task_struct *task, unsigned long *stack) if (task) stack = (unsigned long *)thread_saved_fp(task); else +#ifdef CONFIG_STACKTRACE + asm volatile("mov %0, r8\n":"=r"(stack)::"memory"); +#else stack = (unsigned long *)&stack; +#endif } show_trace(stack);