show_backtrace(task, regs);
 }
 
-static noinline void prepare_frametrace(struct pt_regs *regs)
+static __always_inline void prepare_frametrace(struct pt_regs *regs)
 {
        __asm__ __volatile__(
                "1: la $2, 1b\n\t"
  */
 void dump_stack(void)
 {
-       unsigned long stack;
+       struct pt_regs regs;
 
-#ifdef CONFIG_KALLSYMS
-       if (!raw_show_trace) {
-               struct pt_regs regs;
-               prepare_frametrace(®s);
-               show_backtrace(current, ®s);
-               return;
-       }
-#endif
-       show_raw_backtrace(&stack);
+       /*
+        * Remove any garbage that may be in regs (specially func
+        * addresses) to avoid show_raw_backtrace() to report them
+        */
+       memset(®s, 0, sizeof(regs));
+       prepare_frametrace(®s);
+       show_backtrace(current, ®s);
 }
 
 EXPORT_SYMBOL(dump_stack);