summaryrefslogtreecommitdiff
path: root/arch/powerpc/platforms/83xx
diff options
context:
space:
mode:
authorChristophe Leroy <christophe.leroy@c-s.fr>2018-12-10 14:41:29 +0300
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2019-12-05 11:20:47 +0300
commitf4d1d649d2eaf389b16e9204d71ab0bcf7ceb4e2 (patch)
tree269cba41f3f97ba1b2c006747c9a043fcb8bac05 /arch/powerpc/platforms/83xx
parent2bf4b03bc3ecb43f7182c88e6c15f3014df6d845 (diff)
downloadlinux-f4d1d649d2eaf389b16e9204d71ab0bcf7ceb4e2.tar.xz
powerpc/83xx: handle machine check caused by watchdog timer
[ Upstream commit 0deae39cec6dab3a66794f3e9e83ca4dc30080f1 ] When the watchdog timer is set in interrupt mode, it causes a machine check when it times out. The purpose of this mode is to ease debugging, not to crash the kernel and reboot the machine. This patch implements a special handling for that, in order to not crash the kernel if the watchdog times out while in interrupt or within the idle task. Signed-off-by: Christophe Leroy <christophe.leroy@c-s.fr> [scottwood: added missing #include] Signed-off-by: Scott Wood <oss@buserror.net> Signed-off-by: Sasha Levin <sashal@kernel.org>
Diffstat (limited to 'arch/powerpc/platforms/83xx')
-rw-r--r--arch/powerpc/platforms/83xx/misc.c17
1 files changed, 17 insertions, 0 deletions
diff --git a/arch/powerpc/platforms/83xx/misc.c b/arch/powerpc/platforms/83xx/misc.c
index d75c9816a5c9..2b6589fe812d 100644
--- a/arch/powerpc/platforms/83xx/misc.c
+++ b/arch/powerpc/platforms/83xx/misc.c
@@ -14,6 +14,7 @@
#include <linux/of_platform.h>
#include <linux/pci.h>
+#include <asm/debug.h>
#include <asm/io.h>
#include <asm/hw_irq.h>
#include <asm/ipic.h>
@@ -150,3 +151,19 @@ void __init mpc83xx_setup_arch(void)
mpc83xx_setup_pci();
}
+
+int machine_check_83xx(struct pt_regs *regs)
+{
+ u32 mask = 1 << (31 - IPIC_MCP_WDT);
+
+ if (!(regs->msr & SRR1_MCE_MCP) || !(ipic_get_mcp_status() & mask))
+ return machine_check_generic(regs);
+ ipic_clear_mcp_status(mask);
+
+ if (debugger_fault_handler(regs))
+ return 1;
+
+ die("Watchdog NMI Reset", regs, 0);
+
+ return 1;
+}