Skip to contentSkip to conversation

powerpc/ipic: support external edge triggered IRQ0

PATCH New Norbert van Bolhuis 1 participant 1 message Nov 27, 2009 PowerPC

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 powerpc/ipic: support external edge triggered IRQ0

Currently an external edge triggered IRQ0 gives 2 problems.
It gives a sense error ("edge sense not supported on internal interrupts") and it isn't acked.
This patch takes into account IRQ0 can be internal or external and fixes both issues.

---
 arch/powerpc/sysdev/ipic.c |    5 ++++-
 1 files changed, 4 insertions(+), 1 deletions(-)
arch/powerpc/sysdev/ipic.c +4 -1
index cb7689c..3201db1 100644
@@ -316,6 +316,7 @@ static struct ipic_info ipic_info[] = {
 		.prio_mask = 7,
 	},
 	[48] = {
+		.ack	= IPIC_SEPNR,
 		.mask	= IPIC_SEMSR,
 		.prio	= IPIC_SMPRR_A,
 		.force	= IPIC_SEFCR,
@@ -619,7 +620,9 @@ static int ipic_set_irq_type(unsigned int virq, unsigned int flow_type)
 		return -EINVAL;
 	}
 	/* ipic supports only edge mode on external interrupts */
-	if ((flow_type & IRQ_TYPE_EDGE_FALLING) && !ipic_info[src].ack) {
+	if ((flow_type & IRQ_TYPE_EDGE_FALLING) &&
+	    ((src != IPIC_IRQ_EXT0 && !ipic_info[src].ack) ||
+	     (src == IPIC_IRQ_EXT0 && (ipic_read(ipic->regs, IPIC_SEMSR) & SEMSR_SIRQ0)))) {
 		printk(KERN_ERR "ipic: edge sense not supported on internal "
 				"interrupts\n");
 		return -EINVAL;
Signature · 1 line
1.5.2.2