ARM: allow unwinder to unwind recursive functions
authorRussell King <rmk+kernel@armlinux.org.uk>
Sun, 22 Dec 2019 16:39:40 +0000 (16:39 +0000)
committerRussell King <rmk+kernel@armlinux.org.uk>
Fri, 21 Feb 2020 16:58:50 +0000 (16:58 +0000)
Allow the unwinder to unwind recursive functions if the stack makes
progress, even if the PC is the same. This allows tracing through
recursive __switchdev_handle_port_attr_set() and similar.

Signed-off-by: Russell King <rmk+kernel@armlinux.org.uk>
arch/arm/kernel/unwind.c

index 4574e6a..11a964f 100644 (file)
@@ -444,7 +444,7 @@ int unwind_frame(struct stackframe *frame)
                ctrl.vrs[PC] = ctrl.vrs[LR];
 
        /* check for infinite loop */
-       if (frame->pc == ctrl.vrs[PC])
+       if (frame->pc == ctrl.vrs[PC] && frame->sp == ctrl.vrs[SP])
                return -URC_FAILURE;
 
        frame->fp = ctrl.vrs[FP];