diff mbox

powerpc/ipic: unmask all interrupt sources

Message ID 20090805194112.GA18204@www.tglx.de (mailing list archive)
State Accepted, archived
Commit 8640d3bf71fa0f25adf86527fe69a32372427d4b
Delegated to: Kumar Gala
Headers show

Commit Message

Sebastian Andrzej Siewior Aug. 5, 2009, 7:41 p.m. UTC
in case the interrupt controller was used in an earlier life then it is
possible it is that some of its sources were used and are still unmask.
If the (unmasked) device is active and is creating interrupts (or one
interrupts was pending since the interrupts were disabled) then the boot
process "ends" very soon. Once external interrupts are enabled, we land in
-> do_IRQ
  -> call ppc_md.get_irq()
     -> ipic_read() gets the source number
     -> irq_linear_revmap(source)
        -> revmap[source] == NO_IRQ
           -> irq_find_mapping(source) returns NO_IRQ because no source
              is registered
  -> source is NO_IRQ, ppc_spurious_interrupts gets incremented, no
     further action.

Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
---
This solves my kexec problem I had earlier. I could disable the device
in ->shutdown path but the device in question could been used in the
boot loader. Usually one gets the "nobody cared" message for unhandled
interrupts but in this (rare) case nothing happens and box stands still.

 arch/powerpc/sysdev/ipic.c |    3 +++
 1 files changed, 3 insertions(+), 0 deletions(-)

Comments

Kumar Gala Aug. 5, 2009, 8:04 p.m. UTC | #1
On Aug 5, 2009, at 2:41 PM, Sebastian Andrzej Siewior wrote:

> in case the interrupt controller was used in an earlier life then it  
> is
> possible it is that some of its sources were used and are still  
> unmask.
> If the (unmasked) device is active and is creating interrupts (or one
> interrupts was pending since the interrupts were disabled) then the  
> boot
> process "ends" very soon. Once external interrupts are enabled, we  
> land in
> -> do_IRQ
>  -> call ppc_md.get_irq()
>     -> ipic_read() gets the source number
>     -> irq_linear_revmap(source)
>        -> revmap[source] == NO_IRQ
>           -> irq_find_mapping(source) returns NO_IRQ because no source
>              is registered
>  -> source is NO_IRQ, ppc_spurious_interrupts gets incremented, no
>     further action.
>
> Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
> ---
> This solves my kexec problem I had earlier. I could disable the device
> in ->shutdown path but the device in question could been used in the
> boot loader. Usually one gets the "nobody cared" message for unhandled
> interrupts but in this (rare) case nothing happens and box stands  
> still.
>
> arch/powerpc/sysdev/ipic.c |    3 +++
> 1 files changed, 3 insertions(+), 0 deletions(-)

looks good.. I'll pick this up for .32 since it doesn't seem to be a  
bug until we have kexec.

- k
Sebastian Andrzej Siewior Aug. 5, 2009, 9:29 p.m. UTC | #2
* Kumar Gala | 2009-08-05 15:04:16 [-0500]:
>
> looks good.. I'll pick this up for .32 since it doesn't seem to be a bug 
> until we have kexec.
Well, the code for the non-mmu variant is there and is working. It was
just the ipic thing which was holding me back. However I'm fine with .32
I'm stocked here with .26.
The bigger issue is the user space for ppc32 which is non-working in
current upstream since it is pre-device tree and game cube only.
Once you have time to review the kernel interface (the part where we
jump to the new kernel / kernel wrapper) I could try to rebase my
patches and repost them :)

> - k

Sebastian
Kumar Gala Aug. 7, 2009, 2:26 a.m. UTC | #3
On Aug 5, 2009, at 2:41 PM, Sebastian Andrzej Siewior wrote:

> in case the interrupt controller was used in an earlier life then it  
> is
> possible it is that some of its sources were used and are still  
> unmask.
> If the (unmasked) device is active and is creating interrupts (or one
> interrupts was pending since the interrupts were disabled) then the  
> boot
> process "ends" very soon. Once external interrupts are enabled, we  
> land in
> -> do_IRQ
>  -> call ppc_md.get_irq()
>     -> ipic_read() gets the source number
>     -> irq_linear_revmap(source)
>        -> revmap[source] == NO_IRQ
>           -> irq_find_mapping(source) returns NO_IRQ because no source
>              is registered
>  -> source is NO_IRQ, ppc_spurious_interrupts gets incremented, no
>     further action.
>
> Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
> ---
> This solves my kexec problem I had earlier. I could disable the device
> in ->shutdown path but the device in question could been used in the
> boot loader. Usually one gets the "nobody cared" message for unhandled
> interrupts but in this (rare) case nothing happens and box stands  
> still.
>
> arch/powerpc/sysdev/ipic.c |    3 +++
> 1 files changed, 3 insertions(+), 0 deletions(-)


applied to next

- k
diff mbox

Patch

diff --git a/arch/powerpc/sysdev/ipic.c b/arch/powerpc/sysdev/ipic.c
index 69e2630..ebb7e58 100644
--- a/arch/powerpc/sysdev/ipic.c
+++ b/arch/powerpc/sysdev/ipic.c
@@ -781,6 +781,9 @@  struct ipic * __init ipic_init(struct device_node *node, unsigned int flags)
 	primary_ipic = ipic;
 	irq_set_default_host(primary_ipic->irqhost);
 
+	ipic_write(ipic->regs, IPIC_SIMSR_H, 0);
+	ipic_write(ipic->regs, IPIC_SIMSR_L, 0);
+
 	printk ("IPIC (%d IRQ sources) at %p\n", NR_IPIC_INTS,
 			primary_ipic->regs);