From: Sasha Levin <sashal@kernel.org>
To: linux-kernel@vger.kernel.org, stable@vger.kernel.org
Cc: Christophe Leroy <christophe.leroy@c-s.fr>,
Scott Wood <oss@buserror.net>, Sasha Levin <sashal@kernel.org>,
linuxppc-dev@lists.ozlabs.org
Subject: [PATCH AUTOSEL 4.9 57/91] powerpc/83xx: handle machine check caused by watchdog timer
Date: Fri, 22 Nov 2019 01:00:55 -0500 [thread overview]
Message-ID: <20191122060129.4239-56-sashal@kernel.org> (raw)
In-Reply-To: <20191122060129.4239-1-sashal@kernel.org>
From: Christophe Leroy <christophe.leroy@c-s.fr>
[ 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>
---
arch/powerpc/include/asm/cputable.h | 1 +
arch/powerpc/include/asm/reg.h | 2 ++
arch/powerpc/kernel/cputable.c | 10 ++++++----
arch/powerpc/platforms/83xx/misc.c | 17 +++++++++++++++++
4 files changed, 26 insertions(+), 4 deletions(-)
diff --git a/arch/powerpc/include/asm/cputable.h b/arch/powerpc/include/asm/cputable.h
index 4e54282c29b44..cf51aea47510c 100644
--- a/arch/powerpc/include/asm/cputable.h
+++ b/arch/powerpc/include/asm/cputable.h
@@ -44,6 +44,7 @@ extern int machine_check_e500(struct pt_regs *regs);
extern int machine_check_e200(struct pt_regs *regs);
extern int machine_check_47x(struct pt_regs *regs);
int machine_check_8xx(struct pt_regs *regs);
+int machine_check_83xx(struct pt_regs *regs);
extern void cpu_down_flush_e500v2(void);
extern void cpu_down_flush_e500mc(void);
diff --git a/arch/powerpc/include/asm/reg.h b/arch/powerpc/include/asm/reg.h
index ceb168cd3b814..26aeeaad32678 100644
--- a/arch/powerpc/include/asm/reg.h
+++ b/arch/powerpc/include/asm/reg.h
@@ -663,6 +663,8 @@
#define SRR1_PROGTRAP 0x00020000 /* Trap */
#define SRR1_PROGADDR 0x00010000 /* SRR0 contains subsequent addr */
+#define SRR1_MCE_MCP 0x00080000 /* Machine check signal caused interrupt */
+
#define SPRN_HSRR0 0x13A /* Save/Restore Register 0 */
#define SPRN_HSRR1 0x13B /* Save/Restore Register 1 */
#define HSRR1_DENORM 0x00100000 /* Denorm exception */
diff --git a/arch/powerpc/kernel/cputable.c b/arch/powerpc/kernel/cputable.c
index 6a82ef039c509..7471ed48f41fa 100644
--- a/arch/powerpc/kernel/cputable.c
+++ b/arch/powerpc/kernel/cputable.c
@@ -1162,6 +1162,7 @@ static struct cpu_spec __initdata cpu_specs[] = {
.machine_check = machine_check_generic,
.platform = "ppc603",
},
+#ifdef CONFIG_PPC_83xx
{ /* e300c1 (a 603e core, plus some) on 83xx */
.pvr_mask = 0x7fff0000,
.pvr_value = 0x00830000,
@@ -1172,7 +1173,7 @@ static struct cpu_spec __initdata cpu_specs[] = {
.icache_bsize = 32,
.dcache_bsize = 32,
.cpu_setup = __setup_cpu_603,
- .machine_check = machine_check_generic,
+ .machine_check = machine_check_83xx,
.platform = "ppc603",
},
{ /* e300c2 (an e300c1 core, plus some, minus FPU) on 83xx */
@@ -1186,7 +1187,7 @@ static struct cpu_spec __initdata cpu_specs[] = {
.icache_bsize = 32,
.dcache_bsize = 32,
.cpu_setup = __setup_cpu_603,
- .machine_check = machine_check_generic,
+ .machine_check = machine_check_83xx,
.platform = "ppc603",
},
{ /* e300c3 (e300c1, plus one IU, half cache size) on 83xx */
@@ -1200,7 +1201,7 @@ static struct cpu_spec __initdata cpu_specs[] = {
.icache_bsize = 32,
.dcache_bsize = 32,
.cpu_setup = __setup_cpu_603,
- .machine_check = machine_check_generic,
+ .machine_check = machine_check_83xx,
.num_pmcs = 4,
.oprofile_cpu_type = "ppc/e300",
.oprofile_type = PPC_OPROFILE_FSL_EMB,
@@ -1217,12 +1218,13 @@ static struct cpu_spec __initdata cpu_specs[] = {
.icache_bsize = 32,
.dcache_bsize = 32,
.cpu_setup = __setup_cpu_603,
- .machine_check = machine_check_generic,
+ .machine_check = machine_check_83xx,
.num_pmcs = 4,
.oprofile_cpu_type = "ppc/e300",
.oprofile_type = PPC_OPROFILE_FSL_EMB,
.platform = "ppc603",
},
+#endif
{ /* default match, we assume split I/D cache & TB (non-601)... */
.pvr_mask = 0x00000000,
.pvr_value = 0x00000000,
diff --git a/arch/powerpc/platforms/83xx/misc.c b/arch/powerpc/platforms/83xx/misc.c
index d75c9816a5c92..2b6589fe812dd 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;
+}
--
2.20.1
next prev parent reply other threads:[~2019-11-22 6:05 UTC|newest]
Thread overview: 90+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-11-22 6:00 [PATCH AUTOSEL 4.9 01/91] scsi: lpfc: Fix dif and first burst use in write commands Sasha Levin
2019-11-22 6:00 ` [PATCH AUTOSEL 4.9 03/91] ARM: dts: imx53-voipac-dmm-668: Fix memory node duplication Sasha Levin
2019-11-22 6:00 ` [PATCH AUTOSEL 4.9 04/91] parisc: Fix serio address output Sasha Levin
2019-11-22 6:00 ` [PATCH AUTOSEL 4.9 05/91] parisc: Fix HP SDC hpa " Sasha Levin
2019-11-22 6:00 ` [PATCH AUTOSEL 4.9 06/91] arm64: mm: Prevent mismatched 52-bit VA support Sasha Levin
2019-11-22 6:00 ` [PATCH AUTOSEL 4.9 07/91] arm64: smp: Handle errors reported by the firmware Sasha Levin
2019-11-22 6:00 ` [PATCH AUTOSEL 4.9 08/91] PM / AVS: SmartReflex: NULL check before some freeing functions is not needed Sasha Levin
2019-11-22 6:00 ` [PATCH AUTOSEL 4.9 09/91] ARM: ks8695: fix section mismatch warning Sasha Levin
2019-11-22 6:00 ` [PATCH AUTOSEL 4.9 10/91] ACPI / LPSS: Ignore acpi_device_fix_up_power() return value Sasha Levin
2019-11-22 6:00 ` [PATCH AUTOSEL 4.9 11/91] crypto: user - support incremental algorithm dumps Sasha Levin
2019-11-22 6:00 ` [PATCH AUTOSEL 4.9 12/91] mwifiex: fix potential NULL dereference and use after free Sasha Levin
2019-11-22 6:00 ` [PATCH AUTOSEL 4.9 13/91] mwifiex: debugfs: correct histogram spacing, formatting Sasha Levin
2019-11-22 6:00 ` [PATCH AUTOSEL 4.9 14/91] rtl818x: fix potential use after free Sasha Levin
2019-11-22 6:00 ` [PATCH AUTOSEL 4.9 15/91] xfs: require both realtime inodes to mount Sasha Levin
2019-11-22 6:00 ` [PATCH AUTOSEL 4.9 16/91] ubi: Put MTD device after it is not used Sasha Levin
2019-11-22 6:00 ` [PATCH AUTOSEL 4.9 17/91] ubi: Do not drop UBI device reference before using Sasha Levin
2019-11-22 6:00 ` [PATCH AUTOSEL 4.9 18/91] microblaze: adjust the help to the real behavior Sasha Levin
2019-11-22 6:00 ` [PATCH AUTOSEL 4.9 19/91] microblaze: move "... is ready" messages to arch/microblaze/Makefile Sasha Levin
2019-11-22 6:00 ` [PATCH AUTOSEL 4.9 20/91] gpiolib: Fix return value of gpio_to_desc() stub if !GPIOLIB Sasha Levin
2019-11-22 6:00 ` [PATCH AUTOSEL 4.9 21/91] VSOCK: bind to random port for VMADDR_PORT_ANY Sasha Levin
2019-11-22 6:00 ` [PATCH AUTOSEL 4.9 22/91] mtd: rawnand: sunxi: Write pageprog related opcodes to WCMD_SET Sasha Levin
2019-11-22 6:00 ` [PATCH AUTOSEL 4.9 23/91] btrfs: only track ref_heads in delayed_ref_updates Sasha Levin
2019-11-22 6:00 ` [PATCH AUTOSEL 4.9 24/91] HID: intel-ish-hid: fixes incorrect error handling Sasha Levin
2019-11-22 6:00 ` [PATCH AUTOSEL 4.9 25/91] xen/pciback: Check dev_data before using it Sasha Levin
2019-11-22 6:00 ` [PATCH AUTOSEL 4.9 26/91] pinctrl: xway: fix gpio-hog related boot issues Sasha Levin
2019-11-22 6:00 ` [PATCH AUTOSEL 4.9 27/91] net/mlx5: Continue driver initialization despite debugfs failure Sasha Levin
2019-11-22 6:00 ` [PATCH AUTOSEL 4.9 28/91] KVM: s390: unregister debug feature on failing arch init Sasha Levin
2019-11-22 6:00 ` [PATCH AUTOSEL 4.9 29/91] pinctrl: sh-pfc: sh7264: Fix PFCR3 and PFCR0 register configuration Sasha Levin
2019-11-22 6:00 ` [PATCH AUTOSEL 4.9 30/91] pinctrl: sh-pfc: sh7734: Fix shifted values in IPSR10 Sasha Levin
2019-11-22 6:00 ` [PATCH AUTOSEL 4.9 31/91] HID: doc: fix wrong data structure reference for UHID_OUTPUT Sasha Levin
2019-11-22 6:00 ` [PATCH AUTOSEL 4.9 32/91] dm flakey: Properly corrupt multi-page bios Sasha Levin
2019-11-22 6:00 ` [PATCH AUTOSEL 4.9 33/91] gfs2: take jdata unstuff into account in do_grow Sasha Levin
2019-11-22 6:00 ` [PATCH AUTOSEL 4.9 34/91] xfs: Align compat attrlist_by_handle with native implementation Sasha Levin
2019-11-22 6:00 ` [PATCH AUTOSEL 4.9 35/91] xfs: Fix bulkstat compat ioctls on x32 userspace Sasha Levin
2019-11-22 6:00 ` [PATCH AUTOSEL 4.9 36/91] IB/qib: Fix an error code in qib_sdma_verbs_send() Sasha Levin
2019-11-22 6:00 ` [PATCH AUTOSEL 4.9 37/91] powerpc/book3s/32: fix number of bats in p/v_block_mapped() Sasha Levin
2019-11-22 6:00 ` [PATCH AUTOSEL 4.9 38/91] powerpc/xmon: fix dump_segments() Sasha Levin
2019-11-22 6:00 ` [PATCH AUTOSEL 4.9 39/91] drivers/regulator: fix a missing check of return value Sasha Levin
2019-11-22 6:00 ` [PATCH AUTOSEL 4.9 40/91] serial: max310x: Fix tx_empty() callback Sasha Levin
2019-11-22 6:00 ` [PATCH AUTOSEL 4.9 41/91] openrisc: Fix broken paths to arch/or32 Sasha Levin
2019-11-22 6:00 ` [PATCH AUTOSEL 4.9 42/91] RDMA/srp: Propagate ib_post_send() failures to the SCSI mid-layer Sasha Levin
2019-11-22 6:00 ` [PATCH AUTOSEL 4.9 43/91] scsi: qla2xxx: deadlock by configfs_depend_item Sasha Levin
2019-11-22 6:00 ` [PATCH AUTOSEL 4.9 44/91] scsi: csiostor: fix incorrect dma device in case of vport Sasha Levin
2019-11-22 6:00 ` [PATCH AUTOSEL 4.9 45/91] ath6kl: Only use match sets when firmware supports it Sasha Levin
2019-11-22 6:00 ` [PATCH AUTOSEL 4.9 46/91] ath6kl: Fix off by one error in scan completion Sasha Levin
2019-11-22 6:00 ` [PATCH AUTOSEL 4.9 47/91] powerpc/prom: fix early DEBUG messages Sasha Levin
2019-11-22 6:00 ` [PATCH AUTOSEL 4.9 48/91] powerpc/mm: Make NULL pointer deferences explicit on bad page faults Sasha Levin
2019-11-22 6:00 ` [PATCH AUTOSEL 4.9 49/91] powerpc/44x/bamboo: Fix PCI range Sasha Levin
2019-11-22 6:00 ` [PATCH AUTOSEL 4.9 50/91] vfio/spapr_tce: Get rid of possible infinite loop Sasha Levin
2019-11-22 6:00 ` [PATCH AUTOSEL 4.9 51/91] powerpc/powernv/eeh/npu: Fix uninitialized variables in opal_pci_eeh_freeze_status Sasha Levin
2019-11-22 6:00 ` [PATCH AUTOSEL 4.9 52/91] drbd: ignore "all zero" peer volume sizes in handshake Sasha Levin
2019-11-22 6:00 ` [PATCH AUTOSEL 4.9 53/91] drbd: reject attach of unsuitable uuids even if connected Sasha Levin
2019-11-22 6:00 ` [PATCH AUTOSEL 4.9 54/91] drbd: do not block when adjusting "disk-options" while IO is frozen Sasha Levin
2019-11-22 6:00 ` [PATCH AUTOSEL 4.9 55/91] drbd: fix print_st_err()'s prototype to match the definition Sasha Levin
2019-11-22 6:00 ` [PATCH AUTOSEL 4.9 56/91] regulator: tps65910: fix a missing check of return value Sasha Levin
2019-11-22 6:00 ` Sasha Levin [this message]
2019-11-22 6:00 ` [PATCH AUTOSEL 4.9 58/91] powerpc/pseries: Fix node leak in update_lmb_associativity_index() Sasha Levin
2019-11-22 6:00 ` [PATCH AUTOSEL 4.9 59/91] crypto: mxc-scc - fix build warnings on ARM64 Sasha Levin
2019-11-22 6:00 ` [PATCH AUTOSEL 4.9 60/91] pwm: clps711x: Fix period calculation Sasha Levin
2019-11-22 6:00 ` [PATCH AUTOSEL 4.9 61/91] net/net_namespace: Check the return value of register_pernet_subsys() Sasha Levin
2019-11-22 6:01 ` [PATCH AUTOSEL 4.9 62/91] um: Make GCOV depend on !KCOV Sasha Levin
2019-11-22 6:01 ` [PATCH AUTOSEL 4.9 63/91] net: stmicro: fix a missing check of clk_prepare Sasha Levin
2019-11-22 6:01 ` [PATCH AUTOSEL 4.9 64/91] net: dsa: bcm_sf2: Propagate error value from mdio_write Sasha Levin
2019-11-22 6:01 ` [PATCH AUTOSEL 4.9 65/91] atl1e: checking the status of atl1e_write_phy_reg Sasha Levin
2019-11-22 6:01 ` [PATCH AUTOSEL 4.9 66/91] tipc: fix a missing check of genlmsg_put Sasha Levin
2019-11-22 6:01 ` [PATCH AUTOSEL 4.9 67/91] net/wan/fsl_ucc_hdlc: Avoid double free in ucc_hdlc_probe() Sasha Levin
2019-11-22 6:01 ` [PATCH AUTOSEL 4.9 68/91] ocfs2: clear journal dirty flag after shutdown journal Sasha Levin
2019-11-22 6:01 ` [PATCH AUTOSEL 4.9 69/91] vmscan: return NODE_RECLAIM_NOSCAN in node_reclaim() when CONFIG_NUMA is n Sasha Levin
2019-11-22 6:01 ` [PATCH AUTOSEL 4.9 70/91] lib/genalloc.c: fix allocation of aligned buffer from non-aligned chunk Sasha Levin
2019-11-22 6:01 ` [PATCH AUTOSEL 4.9 71/91] lib/genalloc.c: use vzalloc_node() to allocate the bitmap Sasha Levin
2019-11-22 6:01 ` [PATCH AUTOSEL 4.9 72/91] drivers/base/platform.c: kmemleak ignore a known leak Sasha Levin
2019-11-22 6:01 ` [PATCH AUTOSEL 4.9 73/91] lib/genalloc.c: include vmalloc.h Sasha Levin
2019-11-22 6:01 ` [PATCH AUTOSEL 4.9 74/91] mtd: Check add_mtd_device() ret code Sasha Levin
2019-11-22 6:01 ` [PATCH AUTOSEL 4.9 75/91] tipc: fix memory leak in tipc_nl_compat_publ_dump Sasha Levin
2019-11-22 6:01 ` [PATCH AUTOSEL 4.9 76/91] net/core/neighbour: tell kmemleak about hash tables Sasha Levin
2019-11-22 6:01 ` [PATCH AUTOSEL 4.9 77/91] net/core/neighbour: fix kmemleak minimal reference count for " Sasha Levin
2019-11-22 6:01 ` [PATCH AUTOSEL 4.9 78/91] sfc: suppress duplicate nvmem partition types in efx_ef10_mtd_probe Sasha Levin
2019-11-22 6:01 ` [PATCH AUTOSEL 4.9 79/91] ip_tunnel: Make none-tunnel-dst tunnel port work with lwtunnel Sasha Levin
2019-11-22 6:01 ` [PATCH AUTOSEL 4.9 80/91] decnet: fix DN_IFREQ_SIZE Sasha Levin
2019-11-22 6:01 ` [PATCH AUTOSEL 4.9 81/91] tipc: fix skb may be leaky in tipc_link_input Sasha Levin
2019-11-22 6:01 ` [PATCH AUTOSEL 4.9 82/91] sfc: initialise found bitmap in efx_ef10_mtd_probe Sasha Levin
2019-11-22 6:01 ` [PATCH AUTOSEL 4.9 83/91] net: fix possible overflow in __sk_mem_raise_allocated() Sasha Levin
2019-11-22 6:01 ` [PATCH AUTOSEL 4.9 84/91] sctp: don't compare hb_timer expire date before starting it Sasha Levin
2019-11-22 6:01 ` [PATCH AUTOSEL 4.9 85/91] net: dev: Use unsigned integer as an argument to left-shift Sasha Levin
2019-11-22 6:01 ` [PATCH AUTOSEL 4.9 86/91] iommu/amd: Fix NULL dereference bug in match_hid_uid Sasha Levin
2019-11-22 6:01 ` [PATCH AUTOSEL 4.9 87/91] scsi: libsas: Support SATA PHY connection rate unmatch fixing during discovery Sasha Levin
2019-11-22 6:01 ` [PATCH AUTOSEL 4.9 88/91] ACPI / APEI: Switch estatus pool to use vmalloc memory Sasha Levin
2019-11-22 6:01 ` [PATCH AUTOSEL 4.9 89/91] scsi: libsas: Check SMP PHY control function result Sasha Levin
2019-11-22 6:01 ` [PATCH AUTOSEL 4.9 90/91] powerpc/pseries/dlpar: Fix a missing check in dlpar_parse_cc_property() Sasha Levin
2019-11-22 6:01 ` [PATCH AUTOSEL 4.9 91/91] mtd: Remove a debug trace in mtdpart.c Sasha Levin
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20191122060129.4239-56-sashal@kernel.org \
--to=sashal@kernel.org \
--cc=christophe.leroy@c-s.fr \
--cc=linux-kernel@vger.kernel.org \
--cc=linuxppc-dev@lists.ozlabs.org \
--cc=oss@buserror.net \
--cc=stable@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox