linuxppc-dev.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] powerpc: Disable and EOI interrupts in machine_crash_shutdown()
@ 2006-04-04 11:43 Michael Ellerman
  2006-04-05 22:50 ` Haren Myneni
  0 siblings, 1 reply; 2+ messages in thread
From: Michael Ellerman @ 2006-04-04 11:43 UTC (permalink / raw)
  To: Paul Mackerras, linuxppc-dev; +Cc: Milton Miller

We've seen several bugs caused by interrupt weirdness in the kdump kernel.
Panicking from an interrupt handler means we fail to EOI the interrupt, and
so the second kernel never gets that interrupt ever again. We also see hangs
on JS20 where we take interrupts in the second kernel early during boot.

This patch fixes both those problems, and although it adds more code to the
crash path I think it is the best solution.

Signed-off-by: Michael Ellerman <michael@ellerman.id.au>
---

 arch/powerpc/kernel/crash.c |   13 +++++++++++++
 1 file changed, 13 insertions(+)

Index: kdump/arch/powerpc/kernel/crash.c
===================================================================
--- kdump.orig/arch/powerpc/kernel/crash.c
+++ kdump/arch/powerpc/kernel/crash.c
@@ -22,6 +22,7 @@
 #include <linux/elf.h>
 #include <linux/elfcore.h>
 #include <linux/init.h>
+#include <linux/irq.h>
 #include <linux/types.h>
 
 #include <asm/processor.h>
@@ -174,6 +175,8 @@ static void crash_kexec_prepare_cpus(voi
 
 void default_machine_crash_shutdown(struct pt_regs *regs)
 {
+	unsigned int irq;
+
 	/*
 	 * This function is only called after the system
 	 * has paniced or is otherwise in a critical state.
@@ -186,6 +189,16 @@ void default_machine_crash_shutdown(stru
 	 */
 	local_irq_disable();
 
+	for_each_irq(irq) {
+		struct irq_desc *desc = irq_descp(irq);
+
+		if (desc->status & IRQ_INPROGRESS)
+			desc->handler->end(irq);
+
+		if (!(desc->status & IRQ_DISABLED))
+			desc->handler->disable(irq);
+	}
+
 	if (ppc_md.kexec_cpu_down)
 		ppc_md.kexec_cpu_down(1, 0);
 

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

* Re: [PATCH] powerpc: Disable and EOI interrupts in machine_crash_shutdown()
  2006-04-04 11:43 [PATCH] powerpc: Disable and EOI interrupts in machine_crash_shutdown() Michael Ellerman
@ 2006-04-05 22:50 ` Haren Myneni
  0 siblings, 0 replies; 2+ messages in thread
From: Haren Myneni @ 2006-04-05 22:50 UTC (permalink / raw)
  To: Michael Ellerman; +Cc: linuxppc-dev, Paul Mackerras, Milton Miller

[-- Attachment #1: Type: text/plain, Size: 2775 bytes --]

linuxppc-dev-bounces+hbabu=us.ibm.com@ozlabs.org wrote on 04/04/2006 
04:43:01 AM:

> We've seen several bugs caused by interrupt weirdness in the kdump 
kernel.
> Panicking from an interrupt handler means we fail to EOI the interrupt, 
and
> so the second kernel never gets that interrupt ever again. We also see 
hangs
> on JS20 where we take interrupts in the second kernel early during boot.
> 
> This patch fixes both those problems, and although it adds more code to 
the
> crash path I think it is the best solution.
> 

Michael,
        Noticing the following issues when invoked kdump boot using 
soft-reset. But the kdump boot is successful. Not a problem using sysrq-c 
or Oops.

rtas_call retuned these error messages
"xics_disable_irq: irq=655360: ibm_set_xive(0xff) returned -3" for IRQ# 
182

"xics_disable_irq: irq=589825: ibm_set_xive(0xff) returned -3" for IRQ# 
216

cat /proc/interrupts
18:       2997       3401       1317       1442   XICS      Edge      IPI
134:          0          0          0          0   XICS      Edge 
ehci_hcd:usb1, ohci_hcd:usb2, ohci_hcd:usb3
167:       2169          0          0          0   XICS      Edge      ipr
182:         55          0          0          0   XICS      Edge 
hvc_console
216:          0          0          0          0   XICS      Edge RAS_EPOW
BAD:        117

Thanks
Haren
> Signed-off-by: Michael Ellerman <michael@ellerman.id.au>
> ---
> 
>  arch/powerpc/kernel/crash.c |   13 +++++++++++++
>  1 file changed, 13 insertions(+)
> 
> Index: kdump/arch/powerpc/kernel/crash.c
> ===================================================================
> --- kdump.orig/arch/powerpc/kernel/crash.c
> +++ kdump/arch/powerpc/kernel/crash.c
> @@ -22,6 +22,7 @@
>  #include <linux/elf.h>
>  #include <linux/elfcore.h>
>  #include <linux/init.h>
> +#include <linux/irq.h>
>  #include <linux/types.h>
> 
>  #include <asm/processor.h>
> @@ -174,6 +175,8 @@ static void crash_kexec_prepare_cpus(voi
> 
>  void default_machine_crash_shutdown(struct pt_regs *regs)
>  {
> +   unsigned int irq;
> +
>     /*
>      * This function is only called after the system
>      * has paniced or is otherwise in a critical state.
> @@ -186,6 +189,16 @@ void default_machine_crash_shutdown(stru
>      */
>     local_irq_disable();
> 
> +   for_each_irq(irq) {
> +      struct irq_desc *desc = irq_descp(irq);
> +
> +      if (desc->status & IRQ_INPROGRESS)
> +         desc->handler->end(irq);
> +
> +      if (!(desc->status & IRQ_DISABLED))
> +         desc->handler->disable(irq);
> +   }
> +
>     if (ppc_md.kexec_cpu_down)
>        ppc_md.kexec_cpu_down(1, 0);
> 
> _______________________________________________
> Linuxppc-dev mailing list
> Linuxppc-dev@ozlabs.org
> https://ozlabs.org/mailman/listinfo/linuxppc-dev

[-- Attachment #2: Type: text/html, Size: 4485 bytes --]

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

end of thread, other threads:[~2006-04-05 22:46 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-04-04 11:43 [PATCH] powerpc: Disable and EOI interrupts in machine_crash_shutdown() Michael Ellerman
2006-04-05 22:50 ` Haren Myneni

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