linuxppc-dev.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] [POWERPC] Fix QEIC->MPIC cascading
@ 2007-09-20 13:02 Anton Vorontsov
  2007-09-20 17:03 ` Timur Tabi
  0 siblings, 1 reply; 6+ messages in thread
From: Anton Vorontsov @ 2007-09-20 13:02 UTC (permalink / raw)
  To: linuxppc-dev

set_irq_chained_handler overwrites MPIC's handle_irq function
(handle_fasteoi_irq) thus MPIC never gets eoi event from the
cascaded IRQ. This situation hangs MPIC on MPC8568E.

Patch adds flow level "end" handler to the MPIC, and QEIC calls
it when QEIC's interrupt processing finished.

Signed-off-by: Anton Vorontsov <avorontsov@ru.mvista.com>
---
 arch/powerpc/sysdev/mpic.c         |    3 +++
 arch/powerpc/sysdev/qe_lib/qe_ic.c |    6 ++++++
 2 files changed, 9 insertions(+), 0 deletions(-)

diff --git a/arch/powerpc/sysdev/mpic.c b/arch/powerpc/sysdev/mpic.c
index 8de29f2..bee2d5b 100644
--- a/arch/powerpc/sysdev/mpic.c
+++ b/arch/powerpc/sysdev/mpic.c
@@ -846,6 +846,7 @@ static struct irq_chip mpic_irq_chip = {
 	.mask		= mpic_mask_irq,
 	.unmask		= mpic_unmask_irq,
 	.eoi		= mpic_end_irq,
+	.end		= mpic_end_irq,
 	.set_type	= mpic_set_irq_type,
 };
 
@@ -854,6 +855,7 @@ static struct irq_chip mpic_ipi_chip = {
 	.mask		= mpic_mask_ipi,
 	.unmask		= mpic_unmask_ipi,
 	.eoi		= mpic_end_ipi,
+	.end		= mpic_end_ipi,
 };
 #endif /* CONFIG_SMP */
 
@@ -864,6 +866,7 @@ static struct irq_chip mpic_irq_ht_chip = {
 	.mask		= mpic_mask_irq,
 	.unmask		= mpic_unmask_ht_irq,
 	.eoi		= mpic_end_ht_irq,
+	.end		= mpic_end_ht_irq,
 	.set_type	= mpic_set_irq_type,
 };
 #endif /* CONFIG_MPIC_U3_HT_IRQS */
diff --git a/arch/powerpc/sysdev/qe_lib/qe_ic.c b/arch/powerpc/sysdev/qe_lib/qe_ic.c
index 55e6f39..8e743e0 100644
--- a/arch/powerpc/sysdev/qe_lib/qe_ic.c
+++ b/arch/powerpc/sysdev/qe_lib/qe_ic.c
@@ -328,6 +328,9 @@ void qe_ic_cascade_low(unsigned int irq, struct irq_desc *desc)
 
 	if (cascade_irq != NO_IRQ)
 		generic_handle_irq(cascade_irq);
+
+	if (desc->chip->end)
+		desc->chip->end(irq);
 }
 
 void qe_ic_cascade_high(unsigned int irq, struct irq_desc *desc)
@@ -337,6 +340,9 @@ void qe_ic_cascade_high(unsigned int irq, struct irq_desc *desc)
 
 	if (cascade_irq != NO_IRQ)
 		generic_handle_irq(cascade_irq);
+
+	if (desc->chip->end)
+		desc->chip->end(irq);
 }
 
 void __init qe_ic_init(struct device_node *node, unsigned int flags)
-- 
1.5.0.6

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

* Re: [PATCH] [POWERPC] Fix QEIC->MPIC cascading
  2007-09-20 13:02 [PATCH] [POWERPC] Fix QEIC->MPIC cascading Anton Vorontsov
@ 2007-09-20 17:03 ` Timur Tabi
  2007-09-20 17:41   ` Anton Vorontsov
  0 siblings, 1 reply; 6+ messages in thread
From: Timur Tabi @ 2007-09-20 17:03 UTC (permalink / raw)
  To: Anton Vorontsov; +Cc: linuxppc-dev

Anton Vorontsov wrote:
> set_irq_chained_handler overwrites MPIC's handle_irq function
> (handle_fasteoi_irq) thus MPIC never gets eoi event from the
> cascaded IRQ. This situation hangs MPIC on MPC8568E.

I'm not familiar with the differences between IPIC and MPIC.  What is this 
patch not needed for 83xx?

-- 
Timur Tabi
Linux Kernel Developer @ Freescale

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

* Re: [PATCH] [POWERPC] Fix QEIC->MPIC cascading
  2007-09-20 17:03 ` Timur Tabi
@ 2007-09-20 17:41   ` Anton Vorontsov
  2007-09-20 18:16     ` Timur Tabi
  0 siblings, 1 reply; 6+ messages in thread
From: Anton Vorontsov @ 2007-09-20 17:41 UTC (permalink / raw)
  To: Timur Tabi; +Cc: linuxppc-dev

On Thu, Sep 20, 2007 at 12:03:08PM -0500, Timur Tabi wrote:
> Anton Vorontsov wrote:
>> set_irq_chained_handler overwrites MPIC's handle_irq function
>> (handle_fasteoi_irq) thus MPIC never gets eoi event from the
>> cascaded IRQ. This situation hangs MPIC on MPC8568E.
>
> I'm not familiar with the differences between IPIC and MPIC.  What is this 
> patch not needed for 83xx?

Yup, this patch not needed for 83xx. IPIC doesn't have end()/eoi().
(..and MPIC doesn't have ack()).

Though...

Idially QEIC should do both ack() and end(), at the beginning and at
the end of irq handling respectively.

I don't know (didn't look) why this works for 83xx w/o ack()...
maybe IPIC don't need this. Or maybe there is a bug hiding.

-- 
Anton Vorontsov
email: cbou@mail.ru
backup email: ya-cbou@yandex.ru
irc://irc.freenode.net/bd2

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

* Re: [PATCH] [POWERPC] Fix QEIC->MPIC cascading
  2007-09-20 17:41   ` Anton Vorontsov
@ 2007-09-20 18:16     ` Timur Tabi
  2007-09-20 18:44       ` Scott Wood
  2007-09-20 19:03       ` Haiying Wang
  0 siblings, 2 replies; 6+ messages in thread
From: Timur Tabi @ 2007-09-20 18:16 UTC (permalink / raw)
  To: avorontsov; +Cc: linuxppc-dev

Anton Vorontsov wrote:

> I don't know (didn't look) why this works for 83xx w/o ack()...
> maybe IPIC don't need this. Or maybe there is a bug hiding.

Scott W told me that me that the IPIC doesn't have the concept of EOI ack.  It 
just has IRQ masks.

-- 
Timur Tabi
Linux Kernel Developer @ Freescale

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

* Re: [PATCH] [POWERPC] Fix QEIC->MPIC cascading
  2007-09-20 18:16     ` Timur Tabi
@ 2007-09-20 18:44       ` Scott Wood
  2007-09-20 19:03       ` Haiying Wang
  1 sibling, 0 replies; 6+ messages in thread
From: Scott Wood @ 2007-09-20 18:44 UTC (permalink / raw)
  To: Timur Tabi; +Cc: linuxppc-dev

Timur Tabi wrote:
> Anton Vorontsov wrote:
> 
>> I don't know (didn't look) why this works for 83xx w/o ack()...
>> maybe IPIC don't need this. Or maybe there is a bug hiding.
> 
> Scott W told me that me that the IPIC doesn't have the concept of EOI ack.  It 
> just has IRQ masks.

And the IRQ will be masked at the QEIC while being processed.  Doing it 
this way allows another QE interrupt to come through while the first is 
being serviced.

It might make sense on MPIC to ack after masking at the QEIC, for this 
reason.

-Scott

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

* Re: [PATCH] [POWERPC] Fix QEIC->MPIC cascading
  2007-09-20 18:16     ` Timur Tabi
  2007-09-20 18:44       ` Scott Wood
@ 2007-09-20 19:03       ` Haiying Wang
  1 sibling, 0 replies; 6+ messages in thread
From: Haiying Wang @ 2007-09-20 19:03 UTC (permalink / raw)
  To: Timur Tabi; +Cc: linuxppc-dev

On Thu, 2007-09-20 at 13:16 -0500, Timur Tabi wrote:
> Anton Vorontsov wrote:
> 
> > I don't know (didn't look) why this works for 83xx w/o ack()...
> > maybe IPIC don't need this. Or maybe there is a bug hiding.
> 
> Scott W told me that me that the IPIC doesn't have the concept of EOI ack.  It 
> just has IRQ masks.

That's true for IPIC, but MPIC has the concept of EOI ack - "An
interrupt is considered in-service from the time its vector is read
(through an IACK cycle) until the end of interrupt (EOI) register is
written. generating what the PIC considers an EOI signal."

On MPC8568, QEIC is a interrupt source of MPIC, so it must send a EOI
signal after the interrupt is served. otherwise, the QEIC interrupt is
always in-service.

Haiying

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

end of thread, other threads:[~2007-09-20 19:03 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-09-20 13:02 [PATCH] [POWERPC] Fix QEIC->MPIC cascading Anton Vorontsov
2007-09-20 17:03 ` Timur Tabi
2007-09-20 17:41   ` Anton Vorontsov
2007-09-20 18:16     ` Timur Tabi
2007-09-20 18:44       ` Scott Wood
2007-09-20 19:03       ` Haiying Wang

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