linuxppc-dev.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] powerpc/8xx: add system_reset_exception
@ 2016-09-05  6:42 Christophe Leroy
  2016-09-06 22:40 ` Scott Wood
  0 siblings, 1 reply; 3+ messages in thread
From: Christophe Leroy @ 2016-09-05  6:42 UTC (permalink / raw)
  To: Benjamin Herrenschmidt, Paul Mackerras, Michael Ellerman, Scott Wood
  Cc: linux-kernel, linuxppc-dev

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

Signed-off-by: Christophe Leroy <christophe.leroy@c-s.fr>
---
 arch/powerpc/kernel/head_8xx.S | 2 +-
 arch/powerpc/kernel/traps.c    | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/arch/powerpc/kernel/head_8xx.S b/arch/powerpc/kernel/head_8xx.S
index 43ddaae..f7b8007 100644
--- a/arch/powerpc/kernel/head_8xx.S
+++ b/arch/powerpc/kernel/head_8xx.S
@@ -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
diff --git a/arch/powerpc/kernel/traps.c b/arch/powerpc/kernel/traps.c
index 2cb5892..f8fa11b 100644
--- a/arch/powerpc/kernel/traps.c
+++ b/arch/powerpc/kernel/traps.c
@@ -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.
  *
-- 
2.1.0

^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH] powerpc/8xx: add system_reset_exception
  2016-09-05  6:42 [PATCH] powerpc/8xx: add system_reset_exception Christophe Leroy
@ 2016-09-06 22:40 ` Scott Wood
  2016-09-07  5:15   ` Christophe Leroy
  0 siblings, 1 reply; 3+ messages in thread
From: Scott Wood @ 2016-09-06 22:40 UTC (permalink / raw)
  To: Christophe Leroy, Benjamin Herrenschmidt, Paul Mackerras,
	Michael Ellerman
  Cc: linux-kernel, linuxppc-dev

On Mon, 2016-09-05 at 08:42 +0200, Christophe Leroy wrote:
> When the watchdog is in NMI mode, the system reset interrupt is
> generated when the watchdog counter expires.
> 
> Signed-off-by: Christophe Leroy <christophe.leroy@c-s.fr>
> ---
>  arch/powerpc/kernel/head_8xx.S | 2 +-
>  arch/powerpc/kernel/traps.c    | 2 +-
>  2 files changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/arch/powerpc/kernel/head_8xx.S b/arch/powerpc/kernel/head_8xx.S
> index 43ddaae..f7b8007 100644
> --- a/arch/powerpc/kernel/head_8xx.S
> +++ b/arch/powerpc/kernel/head_8xx.S
> @@ -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)

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

-Scott

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] powerpc/8xx: add system_reset_exception
  2016-09-06 22:40 ` Scott Wood
@ 2016-09-07  5:15   ` Christophe Leroy
  0 siblings, 0 replies; 3+ messages in thread
From: Christophe Leroy @ 2016-09-07  5:15 UTC (permalink / raw)
  To: Scott Wood, Benjamin Herrenschmidt, Paul Mackerras, Michael Ellerman
  Cc: linux-kernel, linuxppc-dev



Le 07/09/2016 à 00:40, Scott Wood a écrit :
> On Mon, 2016-09-05 at 08:42 +0200, Christophe Leroy wrote:
>> When the watchdog is in NMI mode, the system reset interrupt is
>> generated when the watchdog counter expires.
>>
>> Signed-off-by: Christophe Leroy <christophe.leroy@c-s.fr>
>> ---
>>  arch/powerpc/kernel/head_8xx.S | 2 +-
>>  arch/powerpc/kernel/traps.c    | 2 +-
>>  2 files changed, 2 insertions(+), 2 deletions(-)
>>
>> diff --git a/arch/powerpc/kernel/head_8xx.S b/arch/powerpc/kernel/head_8xx.S
>> index 43ddaae..f7b8007 100644
>> --- a/arch/powerpc/kernel/head_8xx.S
>> +++ b/arch/powerpc/kernel/head_8xx.S
>> @@ -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)
>
> 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

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2016-09-07  5:16 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-09-05  6:42 [PATCH] powerpc/8xx: add system_reset_exception Christophe Leroy
2016-09-06 22:40 ` Scott Wood
2016-09-07  5:15   ` Christophe Leroy

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).