]> err.no Git - linux-2.6/commitdiff
[IA64] altix: Abstract irq_affinity at the sn pci provider
authorMark Maule <maule@sgi.com>
Thu, 25 Aug 2005 18:45:00 +0000 (11:45 -0700)
committerTony Luck <tony.luck@intel.com>
Fri, 26 Aug 2005 19:09:01 +0000 (12:09 -0700)
Altix patch to abstract irq_affinity down to the pci provider level since
different SGI hardware implements this in different ways.

Signed-off-by: Mark Maule <maule@sgi.com>
Signed-off-by: Tony Luck <tony.luck@intel.com>
arch/ia64/sn/kernel/irq.c
arch/ia64/sn/pci/pcibr/pcibr_provider.c
arch/ia64/sn/pci/tioca_provider.c
arch/ia64/sn/pci/tioce_provider.c
include/asm-ia64/sn/pcibus_provider_defs.h

index 607938c288bb708f8b5edb014a3ff777c48a836d..9fc74631ba8aa92568a8fed1e27c0a202e00f92f 100644 (file)
@@ -127,6 +127,7 @@ static void sn_set_affinity_irq(unsigned int irq, cpumask_t mask)
                int local_widget, status;
                nasid_t local_nasid;
                struct sn_irq_info *new_irq_info;
+               struct sn_pcibus_provider *pci_provider;
 
                new_irq_info = kmalloc(sizeof(struct sn_irq_info), GFP_ATOMIC);
                if (new_irq_info == NULL)
@@ -166,8 +167,9 @@ static void sn_set_affinity_irq(unsigned int irq, cpumask_t mask)
                new_irq_info->irq_cpuid = cpuid;
                register_intr_pda(new_irq_info);
 
-               if (IS_PCI_BRIDGE_ASIC(new_irq_info->irq_bridge_type))
-                       pcibr_change_devices_irq(new_irq_info);
+               pci_provider = sn_pci_provider[new_irq_info->irq_bridge_type];
+               if (pci_provider && pci_provider->target_interrupt)
+                       (pci_provider->target_interrupt)(new_irq_info);
 
                spin_lock(&sn_irq_info_lock);
                list_replace_rcu(&sn_irq_info->list, &new_irq_info->list);
index 5862a709adf5efca0499d9abaf474e9eec05ec3b..7b03b8084ffc441d90d3725e601816f6b856d741 100644 (file)
@@ -198,7 +198,7 @@ void pcibr_force_interrupt(struct sn_irq_info *sn_irq_info)
        }
 }
 
-void pcibr_change_devices_irq(struct sn_irq_info *sn_irq_info)
+void pcibr_target_interrupt(struct sn_irq_info *sn_irq_info)
 {
        struct pcidev_info *pcidev_info;
        struct pcibus_info *pcibus_info;
@@ -233,7 +233,8 @@ struct sn_pcibus_provider pcibr_provider = {
        .dma_map_consistent = pcibr_dma_map_consistent,
        .dma_unmap = pcibr_dma_unmap,
        .bus_fixup = pcibr_bus_fixup,
-       .force_interrupt = pcibr_force_interrupt
+       .force_interrupt = pcibr_force_interrupt,
+       .target_interrupt = pcibr_target_interrupt
 };
 
 int
index 4ea04cfa30ffd67e2598cc710b3638e7a6e303ea..ea09c12f02586de9d6bc49507951fb919420ea70 100644 (file)
@@ -657,7 +657,8 @@ static struct sn_pcibus_provider tioca_pci_interfaces = {
        .dma_map_consistent = tioca_dma_map,
        .dma_unmap = tioca_dma_unmap,
        .bus_fixup = tioca_bus_fixup,
-       .force_interrupt = NULL
+       .force_interrupt = NULL,
+       .target_interrupt = NULL
 };
 
 /**
index d9081369cf96ac3aa5ef57d1701ddf07d0843708..8e75db2b825d7f3380e645f4408ec06d2f324951 100644 (file)
@@ -668,6 +668,43 @@ tioce_force_interrupt(struct sn_irq_info *sn_irq_info)
        ce_mmr->ce_adm_force_int = force_int_val;
 }
 
+/**
+ * tioce_target_interrupt - implement set_irq_affinity for tioce resident
+ * functions.  Note:  only applies to line interrupts, not MSI's.
+ *
+ * @sn_irq_info: SN IRQ context
+ *
+ * Given an sn_irq_info, set the associated CE device's interrupt destination
+ * register.  Since the interrupt destination registers are on a per-ce-slot
+ * basis, this will retarget line interrupts for all functions downstream of
+ * the slot.
+ */
+static void
+tioce_target_interrupt(struct sn_irq_info *sn_irq_info)
+{
+       struct pcidev_info *pcidev_info;
+       struct tioce_common *ce_common;
+       struct tioce *ce_mmr;
+       int bit;
+
+       pcidev_info = (struct pcidev_info *)sn_irq_info->irq_pciioinfo;
+       if (!pcidev_info)
+               return;
+
+       ce_common = (struct tioce_common *)pcidev_info->pdi_pcibus_info;
+       ce_mmr = (struct tioce *)ce_common->ce_pcibus.bs_base;
+
+       bit = sn_irq_info->irq_int_bit;
+
+       ce_mmr->ce_adm_int_mask |= (1UL << bit);
+       ce_mmr->ce_adm_int_dest[bit] =
+               ((uint64_t)sn_irq_info->irq_irq << INTR_VECTOR_SHFT) |
+                          sn_irq_info->irq_xtalkaddr;
+       ce_mmr->ce_adm_int_mask &= ~(1UL << bit);
+
+       tioce_force_interrupt(sn_irq_info);
+}
+
 /**
  * tioce_bus_fixup - perform final PCI fixup for a TIO CE bus
  * @prom_bussoft: Common prom/kernel struct representing the bus
@@ -719,7 +756,8 @@ static struct sn_pcibus_provider tioce_pci_interfaces = {
        .dma_map_consistent = tioce_dma_consistent,
        .dma_unmap = tioce_dma_unmap,
        .bus_fixup = tioce_bus_fixup,
-       .force_interrupt = tioce_force_interrupt
+       .force_interrupt = tioce_force_interrupt,
+       .target_interrupt = tioce_target_interrupt
 };
 
 /**
index 5a92f5149a94eb3c7f80f40ed6fbf0cb1861ce1d..ad0e8e8ae53fef47a2a6abaa3a5efaebf2090cce 100644 (file)
@@ -50,6 +50,7 @@ struct sn_pcibus_provider {
        void            (*dma_unmap)(struct pci_dev *, dma_addr_t, int);
        void *          (*bus_fixup)(struct pcibus_bussoft *, struct pci_controller *);
        void            (*force_interrupt)(struct sn_irq_info *);
+       void            (*target_interrupt)(struct sn_irq_info *);
 };
 
 extern struct sn_pcibus_provider *sn_pci_provider[];