aboutsummaryrefslogtreecommitdiff
path: root/sys/mips/rmi/xlr_machdep.c
diff options
context:
space:
mode:
authorJayachandran C. <jchandra@FreeBSD.org>2010-08-27 19:53:57 +0000
committerJayachandran C. <jchandra@FreeBSD.org>2010-08-27 19:53:57 +0000
commitb47f51b4a0739e624c34677044a6a5cc5b8faeb3 (patch)
treec61d96d6af056f9cac9277fbc21a50cf4a297612 /sys/mips/rmi/xlr_machdep.c
parent98b9eb0db20f0f604d3879a668824de9024fd49c (diff)
downloadsrc-b47f51b4a0739e624c34677044a6a5cc5b8faeb3.tar.gz
src-b47f51b4a0739e624c34677044a6a5cc5b8faeb3.zip
Revamp XLR interrupt handling, the previous scheme does not work well on
SMP. We used to route all PIC based interrupts to cpu 0, and used the per-CPU interrupt mask to enable/disable interrupts. But the interrupt threads can run on any cpu on SMP, and the interrupt thread will re-enable the interrupts on the CPU it runs on when it is done, and not on cpu0 where the PIC will still send interrupts to. The fix is move the disable/enable for PIC based interrupts to PIC, we will ack on PIC only when the interrupt thread is done, and we do not use the per-CPU interrupt mask. The changes also introduce a way for subsystems to add a function that will be called to clear the interrupt on the subsystem. Currently This is used by the PCI/PCIe for doing additional work during the interrupt handling.
Notes
Notes: svn path=/head/; revision=211893
Diffstat (limited to 'sys/mips/rmi/xlr_machdep.c')
-rw-r--r--sys/mips/rmi/xlr_machdep.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/sys/mips/rmi/xlr_machdep.c b/sys/mips/rmi/xlr_machdep.c
index dd50b9272b0e..dec8bc6bbf48 100644
--- a/sys/mips/rmi/xlr_machdep.c
+++ b/sys/mips/rmi/xlr_machdep.c
@@ -305,7 +305,7 @@ xlr_pic_init(void)
/* Initialize all IRT entries */
for (i = 0; i < PIC_NUM_IRTS; i++) {
irq = PIC_INTR_TO_IRQ(i);
- level = PIC_IRQ_IS_EDGE_TRIGGERED(irq);
+ level = PIC_IS_EDGE_TRIGGERED(i);
/* Bind all PIC irqs to cpu 0 */
xlr_write_reg(mmio, PIC_IRT_0(i), 0x01);
@@ -575,11 +575,11 @@ platform_init_ap(int cpuid)
stat |= MIPS_SR_COP_2_BIT | MIPS_SR_COP_0_BIT;
mips_wr_status(stat);
- xlr_unmask_hard_irq((void *)IRQ_IPI);
- xlr_unmask_hard_irq((void *)IRQ_TIMER);
+ xlr_enable_irq(IRQ_IPI);
+ xlr_enable_irq(IRQ_TIMER);
if (xlr_thr_id() == 0) {
xlr_msgring_cpu_init();
- xlr_unmask_hard_irq((void *)IRQ_MSGRING);
+ xlr_enable_irq(IRQ_MSGRING);
}
return;