aboutsummaryrefslogtreecommitdiff
path: root/sys/mips/rmi/xlr_pci.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_pci.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_pci.c')
-rw-r--r--sys/mips/rmi/xlr_pci.c37
1 files changed, 8 insertions, 29 deletions
diff --git a/sys/mips/rmi/xlr_pci.c b/sys/mips/rmi/xlr_pci.c
index 6178985fe16a..aa1458929a86 100644
--- a/sys/mips/rmi/xlr_pci.c
+++ b/sys/mips/rmi/xlr_pci.c
@@ -403,24 +403,15 @@ xlr_map_msi(device_t pcib, device_t dev, int irq, uint64_t * addr,
}
static void
-bridge_pcix_ack(void *arg)
+bridge_pcix_ack(int irq)
{
xlr_read_reg(xlr_io_mmio(XLR_IO_PCIX_OFFSET), 0x140 >> 2);
}
static void
-bridge_pcix_mask_ack(void *arg)
+bridge_pcie_ack(int irq)
{
-
- xlr_mask_hard_irq(arg);
- bridge_pcix_ack(arg);
-}
-
-static void
-bridge_pcie_ack(void *arg)
-{
- int irq = (intptr_t)arg;
uint32_t reg;
xlr_reg_t *pcie_mmio_le = xlr_io_mmio(XLR_IO_PCIE_1_OFFSET);
@@ -443,14 +434,6 @@ bridge_pcie_ack(void *arg)
xlr_write_reg(pcie_mmio_le, reg>>2, 0xffffffff);
}
-static void
-bridge_pcie_mask_ack(void *arg)
-{
-
- xlr_mask_hard_irq(arg);
- bridge_pcie_ack(arg);
-}
-
static int
mips_platform_pci_setup_intr(device_t dev, device_t child,
struct resource *irq, int flags,
@@ -475,17 +458,13 @@ mips_platform_pci_setup_intr(device_t dev, device_t child,
return (0);
if (xlr_board_info.is_xls == 0) {
- xlr_cpu_establish_hardintr(device_get_name(child), filt,
- intr, arg, PIC_PCIX_IRQ, flags, cookiep,
- bridge_pcix_mask_ack, xlr_unmask_hard_irq,
- bridge_pcix_ack, NULL);
- pic_setup_intr(PIC_IRT_PCIX_INDEX, PIC_PCIX_IRQ, 0x1);
+ xlr_establish_intr(device_get_name(child), filt,
+ intr, arg, PIC_PCIX_IRQ, flags, cookiep, bridge_pcix_ack);
+ pic_setup_intr(PIC_IRT_PCIX_INDEX, PIC_PCIX_IRQ, 0x1, 0);
} else {
- xlr_cpu_establish_hardintr(device_get_name(child), filt,
- intr, arg, xlrirq, flags, cookiep,
- bridge_pcie_mask_ack, xlr_unmask_hard_irq,
- bridge_pcie_ack, NULL);
- pic_setup_intr(xlrirq - PIC_IRQ_BASE, xlrirq, 0x1);
+ xlr_establish_intr(device_get_name(child), filt,
+ intr, arg, xlrirq, flags, cookiep, bridge_pcie_ack);
+ pic_setup_intr(xlrirq - PIC_IRQ_BASE, xlrirq, 0x1, 0);
}
return (bus_generic_setup_intr(dev, child, irq, flags, filt, intr,