linuxppc-dev.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
From: Christophe Leroy <christophe.leroy@c-s.fr>
To: Benjamin Herrenschmidt <benh@kernel.crashing.org>,
	Paul Mackerras <paulus@samba.org>,
	Michael Ellerman <mpe@ellerman.id.au>,
	Scott Wood <oss@buserror.net>
Cc: linux-kernel@vger.kernel.org, linuxppc-dev@lists.ozlabs.org
Subject: [PATCH 02/12] powerpc/8xx: Move 8xx machine check handlers into platforms/8xx
Date: Tue,  8 Aug 2017 13:58:42 +0200 (CEST)	[thread overview]
Message-ID: <3d39290f4a49b8cedd6306513b1b2999d1aeb053.1502191399.git.christophe.leroy@c-s.fr> (raw)
In-Reply-To: <cover.1502191399.git.christophe.leroy@c-s.fr>

In the same spirit as what was done for 4xx and 44x, move
the 8xx machine check into platforms/8xx

Signed-off-by: Christophe Leroy <christophe.leroy@c-s.fr>
---
 arch/powerpc/kernel/traps.c                | 25 --------------------
 arch/powerpc/platforms/8xx/Makefile        |  2 +-
 arch/powerpc/platforms/8xx/machine_check.c | 37 ++++++++++++++++++++++++++++++
 3 files changed, 38 insertions(+), 26 deletions(-)
 create mode 100644 arch/powerpc/platforms/8xx/machine_check.c

diff --git a/arch/powerpc/kernel/traps.c b/arch/powerpc/kernel/traps.c
index 9107f7f86058..b328ca2aef9c 100644
--- a/arch/powerpc/kernel/traps.c
+++ b/arch/powerpc/kernel/traps.c
@@ -558,31 +558,6 @@ int machine_check_e200(struct pt_regs *regs)
 
 	return 0;
 }
-#elif defined(CONFIG_PPC_8xx)
-int machine_check_8xx(struct pt_regs *regs)
-{
-	unsigned long reason = regs->msr;
-
-	pr_err("Machine check in kernel mode.\n");
-	pr_err("Caused by (from SRR1=%lx): ", reason);
-	if (reason & 0x40000000)
-		pr_err("Fetch error at address %lx\n", regs->nip);
-	else
-		pr_err("Data access error at address %lx\n", regs->dar);
-
-#ifdef CONFIG_PCI
-	/* the qspan pci read routines can cause machine checks -- Cort
-	 *
-	 * yuck !!! that totally needs to go away ! There are better ways
-	 * to deal with that than having a wart in the mcheck handler.
-	 * -- BenH
-	 */
-	bad_page_fault(regs, regs->dar, SIGBUS);
-	return 1;
-#else
-	return 0;
-#endif
-}
 #elif defined(CONFIG_PPC32)
 int machine_check_generic(struct pt_regs *regs)
 {
diff --git a/arch/powerpc/platforms/8xx/Makefile b/arch/powerpc/platforms/8xx/Makefile
index 161f367ebf1e..756be8345868 100644
--- a/arch/powerpc/platforms/8xx/Makefile
+++ b/arch/powerpc/platforms/8xx/Makefile
@@ -1,7 +1,7 @@
 #
 # Makefile for the PowerPC 8xx linux kernel.
 #
-obj-y			+= m8xx_setup.o
+obj-y			+= m8xx_setup.o machine_check.o
 obj-$(CONFIG_MPC885ADS)   += mpc885ads_setup.o
 obj-$(CONFIG_MPC86XADS)   += mpc86xads_setup.o
 obj-$(CONFIG_PPC_EP88XC)  += ep88xc.o
diff --git a/arch/powerpc/platforms/8xx/machine_check.c b/arch/powerpc/platforms/8xx/machine_check.c
new file mode 100644
index 000000000000..402016705a39
--- /dev/null
+++ b/arch/powerpc/platforms/8xx/machine_check.c
@@ -0,0 +1,37 @@
+/*
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version
+ * 2 of the License, or (at your option) any later version.
+ */
+
+#include <linux/kernel.h>
+#include <linux/printk.h>
+#include <linux/ptrace.h>
+
+#include <asm/reg.h>
+
+int machine_check_8xx(struct pt_regs *regs)
+{
+	unsigned long reason = regs->msr;
+
+	pr_err("Machine check in kernel mode.\n");
+	pr_err("Caused by (from SRR1=%lx): ", reason);
+	if (reason & 0x40000000)
+		pr_err("Fetch error at address %lx\n", regs->nip);
+	else
+		pr_err("Data access error at address %lx\n", regs->dar);
+
+#ifdef CONFIG_PCI
+	/* the qspan pci read routines can cause machine checks -- Cort
+	 *
+	 * yuck !!! that totally needs to go away ! There are better ways
+	 * to deal with that than having a wart in the mcheck handler.
+	 * -- BenH
+	 */
+	bad_page_fault(regs, regs->dar, SIGBUS);
+	return 1;
+#else
+	return 0;
+#endif
+}
-- 
2.13.3

  parent reply	other threads:[~2017-08-08 11:58 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-08-08 11:58 [PATCH 00/12] powerpc/8xx: Some cleanup Christophe Leroy
2017-08-08 11:58 ` [PATCH 01/12] powerpc/8xx: Simplify CONFIG_8xx checks in Makefile Christophe Leroy
2017-08-11 12:20   ` [01/12] " Michael Ellerman
2017-08-08 11:58 ` Christophe Leroy [this message]
2017-08-08 11:58 ` [PATCH 03/12] powerpc/8xx: Remove SoftwareEmulation() Christophe Leroy
2017-08-08 11:58 ` [PATCH 04/12] powerpc/cpm1: link to CONFIG_CPM1 instead of CONFIG_8xx Christophe Leroy
2017-08-08 11:58 ` [PATCH 05/12] powerpc/8xx: Move mpc8xx_pic.c from sysdev to platform/8xx Christophe Leroy
2017-08-08 11:58 ` [PATCH 06/12] powerpc/time: refactor MFTB() to limit number of ifdefs Christophe Leroy
2017-08-08 11:58 ` [PATCH 07/12] powerpc/kconfig: Simplify PCI_QSPAN selection Christophe Leroy
2017-08-08 11:58 ` [PATCH 08/12] powerpc/8xx: Getting rid of remaining use of CONFIG_8xx Christophe Leroy
2017-08-08 11:58 ` [PATCH 09/12] powerpc/8xx: remove CONFIG_8xx Christophe Leroy
2017-08-08 11:58 ` [PATCH 10/12] powerpc/8xx: Use symbolic PVR value Christophe Leroy
2017-08-08 11:59 ` [PATCH 11/12] powerpc/8xx: Use symbolic names for DSISR bits in DSI Christophe Leroy
2017-08-08 11:59 ` [PATCH 12/12] powerpc/8xx: Remove cpu dependent macro instructions from head_8xx Christophe Leroy

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=3d39290f4a49b8cedd6306513b1b2999d1aeb053.1502191399.git.christophe.leroy@c-s.fr \
    --to=christophe.leroy@c-s.fr \
    --cc=benh@kernel.crashing.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linuxppc-dev@lists.ozlabs.org \
    --cc=mpe@ellerman.id.au \
    --cc=oss@buserror.net \
    --cc=paulus@samba.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;
as well as URLs for NNTP newsgroup(s).