From: David Gibson <hidden> Date: 2007-08-14 03:48:11
This series fixes several small problems with the driver for the UIC
interrupt controller found in PowerPC 4xx embedded CPUs.
--
David Gibson | I'll have my music baroque, and my code
david AT gibson.dropbear.id.au | minimalist, thank you. NOT _the_ _other_
| _way_ _around_!
http://www.ozlabs.org/~dgibson
From: David Gibson <hidden> Date: 2007-08-14 03:52:42
At present the driver for the UIC (the embedded interrupt controller
in 4xx chips) uses the handle_level_irq() flow handler. It turns out
this does not correctly handle level triggered interrupts on the UIC.
Specifically, acknowledging an irq on the UIC (i.e. clearing the
relevant bit in UIC_SR) will have no effect for a level interrupt
which is still asserted by the external device, even if the irq is
already masked. Therefore, unlike handle_level_irq() we must ack the
interrupt after invoking the ISR (which should cause the device to
stop asserting the irq) instead of acking it when we mask it, before
the ISR.
This patch implements this change, in a new handle_uic_irq(), a
customised irq flow handler for the UIC. For edge triggered
interrupts, handle_uic_irq() still uses the old flow - we must ack
edge triggered interrupt before the ISR not after, or we could miss a
second event which occurred between invoking the ISR and acking the
irq.
Signed-off-by: David Gibson <redacted>
---
arch/powerpc/sysdev/uic.c | 61 +++++++++++++++++++++++++++++++++++++++++++++-
1 file changed, 60 insertions(+), 1 deletion(-)
Index: working-2.6/arch/powerpc/sysdev/uic.c
===================================================================
@@ -173,7 +232,7 @@ static int uic_host_map(struct irq_host set_irq_chip_data(virq,uic);/* Despite the name, handle_level_irq() works for both level*andedgeirqsonUIC.FIXME:checkthisiscorrect*/-set_irq_chip_and_handler(virq,&uic_irq_chip,handle_level_irq);+set_irq_chip_and_handler(virq,&uic_irq_chip,handle_uic_irq);/* Set default irq type */set_irq_type(virq,IRQ_TYPE_NONE);
From: David Gibson <hidden> Date: 2007-08-14 03:52:42
The UIC (interrupt controller in 4xx embedded CPUs) driver currently
missets the IRQ_lEVEL flag in desc->status, due to a thinko. This
patch fixes the bug.
Currently this is only a cosmetic problem (affects the output in
/proc/interrupts), however subsequent patches will use the IRQ_LEVEL
flag to affect flow handling.
Signed-off-by: Valentine Barshak <redacted>
Signed-off-by: David Gibson <redacted>
---
arch/powerpc/sysdev/uic.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
Index: working-2.6/arch/powerpc/sysdev/uic.c
===================================================================
From: David Gibson <hidden> Date: 2007-08-14 03:52:42
At present the cascade interrupt handler for the UIC (interrupt
controller on 4xx embedded chips) will misbehave badly if it is called
spuriously - that is if the handler is invoked when no interrupts are
asserted in the child UIC.
Although spurious interrupts shouldn't happen, it's good to behave
robustly if they do. This patch does so by checking for and ignoring
spurious interrupts.
Signed-off-by: Valentine Barshak <redacted>
Signed-off-by: David Gibson <redacted>
---
arch/powerpc/sysdev/uic.c | 3 +++
1 file changed, 3 insertions(+)
Index: working-2.6/arch/powerpc/sysdev/uic.c
===================================================================
On Tue, 14 Aug 2007 13:52:42 +1000 (EST)
David Gibson [off-list ref] wrote:
The UIC (interrupt controller in 4xx embedded CPUs) driver currently
missets the IRQ_lEVEL flag in desc->status, due to a thinko. This
patch fixes the bug.
Currently this is only a cosmetic problem (affects the output in
/proc/interrupts), however subsequent patches will use the IRQ_LEVEL
flag to affect flow handling.
Signed-off-by: Valentine Barshak <redacted>
Signed-off-by: David Gibson <redacted>
On Tue, 14 Aug 2007 13:52:42 +1000 (EST)
David Gibson [off-list ref] wrote:
At present the driver for the UIC (the embedded interrupt controller
in 4xx chips) uses the handle_level_irq() flow handler. It turns out
this does not correctly handle level triggered interrupts on the UIC.
Specifically, acknowledging an irq on the UIC (i.e. clearing the
relevant bit in UIC_SR) will have no effect for a level interrupt
which is still asserted by the external device, even if the irq is
already masked. Therefore, unlike handle_level_irq() we must ack the
interrupt after invoking the ISR (which should cause the device to
stop asserting the irq) instead of acking it when we mask it, before
the ISR.
This patch implements this change, in a new handle_uic_irq(), a
customised irq flow handler for the UIC. For edge triggered
interrupts, handle_uic_irq() still uses the old flow - we must ack
edge triggered interrupt before the ISR not after, or we could miss a
second event which occurred between invoking the ISR and acking the
irq.
Signed-off-by: David Gibson <redacted>
On Tue, 14 Aug 2007 13:52:42 +1000 (EST)
David Gibson [off-list ref] wrote:
quoted hunk
At present the cascade interrupt handler for the UIC (interrupt
controller on 4xx embedded chips) will misbehave badly if it is called
spuriously - that is if the handler is invoked when no interrupts are
asserted in the child UIC.
Although spurious interrupts shouldn't happen, it's good to behave
robustly if they do. This patch does so by checking for and ignoring
spurious interrupts.
Signed-off-by: Valentine Barshak <redacted>
Signed-off-by: David Gibson <redacted>
---
arch/powerpc/sysdev/uic.c | 3 +++
1 file changed, 3 insertions(+)
Index: working-2.6/arch/powerpc/sysdev/uic.c
===================================================================
Hm. Is there was a way we could have this case increment
ppc_spurious_interrupts so that the BAD entry in /proc/interrupts would
be updated with these? Not a huge deal, but it might be nice to have.
Otherwise the patch looks fine.
Acked-by: Josh Boyer <redacted>
josh