tree 37a15b2e8249386b230e29fe6a067ad7184d0223
parent 60a3ba0bb45995ecf9cfe208527d7cfd6128d053
author Mark Goodwin <[EMAIL PROTECTED]> Tue, 16 Aug 2005 14:51:00 -0700
committer Tony Luck <[EMAIL PROTECTED]> Thu, 25 Aug 2005 06:25:21 -0700

[IA64] - SGI SN hwperf enhancements -

Update the SN pci device info to use the nearest node function
to allocate driver memory on the nearest node (rather than
defaulting to node 0).

Signed-off-by: Mark Goodwin <[EMAIL PROTECTED]>
Signed-off-by: Tony Luck <[EMAIL PROTECTED]>

 arch/ia64/sn/pci/pcibr/pcibr_provider.c |   20 ++++++++++++++------
 1 files changed, 14 insertions(+), 6 deletions(-)

diff --git a/arch/ia64/sn/pci/pcibr/pcibr_provider.c 
b/arch/ia64/sn/pci/pcibr/pcibr_provider.c
--- a/arch/ia64/sn/pci/pcibr/pcibr_provider.c
+++ b/arch/ia64/sn/pci/pcibr/pcibr_provider.c
@@ -15,6 +15,7 @@
 #include <asm/sn/pcibus_provider_defs.h>
 #include <asm/sn/pcidev.h>
 #include <asm/sn/sn_sal.h>
+#include <asm/sn/sn2/sn_hwperf.h>
 #include "xtalk/xwidgetdev.h"
 #include "xtalk/hubdev.h"
 
@@ -88,6 +89,7 @@ void *
 pcibr_bus_fixup(struct pcibus_bussoft *prom_bussoft, struct pci_controller 
*controller)
 {
        int nasid, cnode, j;
+       cnodeid_t near_cnode;
        struct hubdev_info *hubdev_info;
        struct pcibus_info *soft;
        struct sn_flush_device_list *sn_flush_device_list;
@@ -161,12 +163,18 @@ pcibr_bus_fixup(struct pcibus_bussoft *p
        memset(soft->pbi_int_ate_resource.ate, 0,
               (soft->pbi_int_ate_size * sizeof(uint64_t)));
 
-       if (prom_bussoft->bs_asic_type == PCIIO_ASIC_TYPE_TIOCP)
-               /*
-                * TIO PCI Bridge with no closest node information.
-                * FIXME: Find another way to determine the closest node
-                */
-               controller->node = -1;
+       if (prom_bussoft->bs_asic_type == PCIIO_ASIC_TYPE_TIOCP) {
+               /* TIO PCI Bridge: find nearest node with CPUs */
+               int e = sn_hwperf_get_nearest_node(cnode, NULL, &near_cnode);
+
+               if (e < 0) {
+                       near_cnode = (cnodeid_t)-1; /* use any node */
+                       printk(KERN_WARNING "pcibr_bus_fixup: failed to find "
+                               "near node with CPUs to TIO node %d, err=%d\n",
+                               cnode, e);
+               }
+               controller->node = near_cnode;
+       }
        else
                controller->node = cnode;
        return soft;
-
To unsubscribe from this list: send the line "unsubscribe git-commits-head" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to