Re: [PATCH HACK] powerpc: quick hack to get a functional eHEA with hardirq preemption
From: Christoph Raisch <hidden>
Date: 2008-09-18 07:54:26
Also in:
linuxppc-dev, lkml, netdev
Sebastien Dugue [off-list ref] wrote on 15.09.2008 10:04:06:
quoted hunk ↗ jump to hunk
[PATCH HACK] powerpc: quick hack to get a functional eHEA with hardirq preemption Sebastien Dugue to: 15.09.2008 10:07 Cc: linux-ppc, linux-kernel, Linux-rt, netdev, Jan-Bernd Themann, Thomas Q Klein, Christoph Raisch, jean-pierre.dion, gilles.carry, tinytim WARNING: HACK - HACK - HACK Not-Signed-off-by: Sebastien Dugue [off-list ref] ------ a/arch/powerpc/kernel/ibmebus.c +++ b/arch/powerpc/kernel/ibmebus.c@@ -41,6 +41,7 @@ - return request_irq(irq, handler, irq_flags, devname, dev_id); + ret = request_irq(irq, handler, irq_flags, devname, dev_id); + + desc = irq_desc + irq; + desc->status &= ~(IRQ_TYPE_SENSE_MASK | IRQ_LEVEL); + desc->status |= IRQ_TYPE_EDGE_RISING; + + return ret;
This looks a bit like a set_irq_type call. Don't know if this is fully implemented for xics though...
quoted hunk ↗ jump to hunk
} EXPORT_SYMBOL(ibmebus_request_irq);diff --git a/kernel/irq/chip.c b/kernel/irq/chip.c index b7b397a..6d366ca 100644 --- a/kernel/irq/chip.c +++ b/kernel/irq/chip.c@@ -430,7 +430,7 @@ handle_fasteoi_irq(unsigned int irq, structirq_desc *desc) action = desc->action; if (unlikely(!action || (desc->status & (IRQ_INPROGRESS | IRQ_DISABLED)))) { - desc->status |= IRQ_PENDING; + desc->status |= IRQ_PENDING | IRQ_MASKED; if (desc->chip->mask) desc->chip->mask(irq); goto out;@@ -439,9 +439,10 @@ handle_fasteoi_irq(unsigned int irq, structirq_desc *desc) desc->status |= IRQ_INPROGRESS; /* * In the threaded case we fall back to a mask+eoi sequence: + * excepted for edge interrupts which are not masked. */ if (redirect_hardirq(desc)) { - if (desc->chip->mask) + if (desc->chip->mask && !(desc->status & IRQ_TYPE_EDGE_BOTH)) desc->chip->mask(irq); goto out; }diff --git a/kernel/irq/manage.c b/kernel/irq/manage.c index 3bffa20..3e39c71 100644 --- a/kernel/irq/manage.c +++ b/kernel/irq/manage.c@@ -788,9 +788,12 @@ static void do_hardirq(struct irq_desc *desc) thread_simple_irq(desc); else if (desc->handle_irq == handle_level_irq) thread_level_irq(desc); - else if (desc->handle_irq == handle_fasteoi_irq) - thread_fasteoi_irq(desc); - else if (desc->handle_irq == handle_edge_irq) + else if (desc->handle_irq == handle_fasteoi_irq) { + if (desc->status & IRQ_TYPE_EDGE_BOTH) + thread_edge_irq(desc); + else + thread_fasteoi_irq(desc); + } else if (desc->handle_irq == handle_edge_irq) thread_edge_irq(desc); else thread_do_irq(desc); --1.6.0.1.308.gede4c
According to the specs at some point in the system the HEA IRQs have a edge characteristic. But since PCI-E edge and level can both be forwarded through a message interface (HEA is not PCI-E, it's only connected to the same internal bus, where the PHB resides) Anybody from the xics experts want to comment on this? Gruss / Regards Christoph R. & Jan-Bernd