Skip to contentSkip to conversation

powerpc/8xx: add system_reset_exception

PATCH In review Christophe Leroy 2 participants 3 messages Sep 5, 2016 – Sep 7, 2016 PowerPC

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 powerpc/8xx: add system_reset_exception

When the watchdog is in NMI mode, the system reset interrupt is generated when the watchdog counter expires.

---
 arch/powerpc/kernel/head_8xx.S | 2 +-
 arch/powerpc/kernel/traps.c    | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)
arch/powerpc/kernel/head_8xx.S +1 -1
index 43ddaae..f7b8007 100644
@@ -227,7 +227,7 @@ i##n:								\
 			  ret_from_except)
 
 /* System reset */
-	EXCEPTION(0x100, Reset, unknown_exception, EXC_XFER_STD)
+	EXCEPTION(0x100, Reset, system_reset_exception, EXC_XFER_STD)
 
 /* Machine check */
 	. = 0x200
arch/powerpc/kernel/traps.c +1 -1
index 2cb5892..f8fa11b 100644
@@ -269,7 +269,6 @@ void _exception(int signr, struct pt_regs *regs, int code, unsigned long addr)
 	force_sig_info(signr, &info, current);
 }
 
-#ifdef CONFIG_PPC64
 void system_reset_exception(struct pt_regs *regs)
 {
 	/* See if any machine dependent calls */
@@ -287,6 +286,7 @@ void system_reset_exception(struct pt_regs *regs)
 	/* What should we do here? We could issue a shutdown or hard reset. */
 }
 
+#ifdef CONFIG_PPC64
 /*
  * This function is called in real mode. Strictly no printk's please.
  *
Signature · 1 line
2.1.0
#1 lore raw
Quoted 18 lines · Christophe Leroy

When the watchdog is in NMI mode, the system reset interrupt is generated when the watchdog counter expires.

---
 arch/powerpc/kernel/head_8xx.S | 2 +-
 arch/powerpc/kernel/traps.c    | 2 +-

 2 files changed, 2 insertions(+), 2 deletions(-)
arch/powerpc/kernel/head_8xx.S +0 -0
index 43ddaae..f7b8007 100644
@@ -227,7 +227,7 @@ i##n:							
 	\
  			  ret_from_except)


 /* System reset */

arch/powerpc/kernel/head_8xx.S i##n: \ · line 230

Quoted 2 lines
arch/powerpc/kernel/head_8xx.S +1 -1
-	EXCEPTION(0x100, Reset, unknown_exception, EXC_XFER_STD)
+	EXCEPTION(0x100, Reset, system_reset_exception, EXC_XFER_STD)

Does this do anything useful beyond what unknown_exception does?  Do you plan to have a ppc_md.system_reset_exception callback?

-Scott

#2 lore raw
Quoted 18 lines · Scott Wood
Quoted 17 lines · Christophe Leroy

When the watchdog is in NMI mode, the system reset interrupt is generated when the watchdog counter expires.

---
 arch/powerpc/kernel/head_8xx.S | 2 +-
 arch/powerpc/kernel/traps.c    | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)
arch/powerpc/kernel/head_8xx.S +0 -0
index 43ddaae..f7b8007 100644
@@ -227,7 +227,7 @@ i##n:							
 	\
 			  ret_from_except)
 
Quoted 7 lines

arch/powerpc/kernel/head_8xx.S i##n: \ · line 230

Quoted 3 lines
arch/powerpc/kernel/head_8xx.S +1 -1
 /* System reset */
-	EXCEPTION(0x100, Reset, unknown_exception, EXC_XFER_STD)
+	EXCEPTION(0x100, Reset, system_reset_exception, EXC_XFER_STD)

Does this do anything useful beyond what unknown_exception does? Do you plan to have a ppc_md.system_reset_exception callback?

Yes that's the plan, having a platform specific callback to take emergency actions in order to speed up systemwise recovery, then restart the board.

In addition, unknown_exception doesn't show you that the exception comes from the NMI watchdog.

Christophe