From a1027f20475bc513986fdeba977243b96779dc64 Mon Sep 17 00:00:00 2001 From: Andrew Morton Date: Sun, 18 Jan 2004 18:48:14 -0800 Subject: [PATCH] [PATCH] sn: A few small clean ups From: Pat Gefre A few small clean ups --- arch/ia64/sn/io/platform_init/irix_io_init.c | 2 ++ arch/ia64/sn/io/sn2/klgraph.c | 5 ++-- arch/ia64/sn/io/sn2/ml_SN_init.c | 29 +++++++++++++++----- arch/ia64/sn/kernel/setup.c | 6 ++++ include/asm-ia64/sn/ioerror.h | 4 --- 5 files changed, 32 insertions(+), 14 deletions(-) diff --git a/arch/ia64/sn/io/platform_init/irix_io_init.c b/arch/ia64/sn/io/platform_init/irix_io_init.c index 2a27c5b18527b..26f5ff6b7cfff 100644 --- a/arch/ia64/sn/io/platform_init/irix_io_init.c +++ b/arch/ia64/sn/io/platform_init/irix_io_init.c @@ -26,6 +26,8 @@ extern vertex_hdl_t hwgraph_root; extern void io_module_init(void); extern int pci_bus_to_hcl_cvlink(void); +nasid_t master_baseio_nasid; +nasid_t master_nasid = INVALID_NASID; /* This is the partition master nasid */ /* * This routine is responsible for the setup of all the IRIX hwgraph style diff --git a/arch/ia64/sn/io/sn2/klgraph.c b/arch/ia64/sn/io/sn2/klgraph.c index 4bad9384f27cb..8ec43eaef7bd6 100644 --- a/arch/ia64/sn/io/sn2/klgraph.c +++ b/arch/ia64/sn/io/sn2/klgraph.c @@ -29,7 +29,6 @@ #define GRPRINTF(x) #endif -extern char arg_maxnodes[]; void mark_cpuvertex_as_cpu(vertex_hdl_t vhdl, cpuid_t cpuid); @@ -159,7 +158,7 @@ klhwg_add_xbow(cnodeid_t cnode, nasid_t nasid) printk(KERN_WARNING "klhwg_add_xbow: Check for " "working routers and router links!"); - panic("klhwg_add_xbow: Failed to add " + printk("klhwg_add_xbow: Failed to add " "edge: vertex 0x%p to vertex 0x%p," "error %d\n", (void *)hubv, (void *)xbow_v, err); @@ -346,7 +345,7 @@ klhwg_connect_one_router(vertex_hdl_t hwgraph_root, lboard_t *brd, /* We don't know what to do with multiple router components */ if (brd->brd_numcompts != 1) { - panic("klhwg_connect_one_router: %d cmpts on router\n", + printk("klhwg_connect_one_router: %d cmpts on router\n", brd->brd_numcompts); return; } diff --git a/arch/ia64/sn/io/sn2/ml_SN_init.c b/arch/ia64/sn/io/sn2/ml_SN_init.c index bd98ec42e9355..fa80b05f4f582 100644 --- a/arch/ia64/sn/io/sn2/ml_SN_init.c +++ b/arch/ia64/sn/io/sn2/ml_SN_init.c @@ -23,10 +23,6 @@ int maxcpus; extern xwidgetnum_t hub_widget_id(nasid_t); -nasid_t master_nasid = INVALID_NASID; /* This is the partition master nasid */ -nasid_t master_baseio_nasid = INVALID_NASID; /* This is the master base I/O nasid */ - - /* XXX - Move the meat of this to intr.c ? */ /* * Set up the platform-dependent fields in the nodepda. @@ -34,22 +30,26 @@ nasid_t master_baseio_nasid = INVALID_NASID; /* This is the master base I/O nasi void init_platform_nodepda(nodepda_t *npda, cnodeid_t node) { hubinfo_t hubinfo; + nasid_t nasid; extern void router_map_init(nodepda_t *); extern void router_queue_init(nodepda_t *,cnodeid_t); extern void intr_init_vecblk(nodepda_t *, cnodeid_t, int); /* Allocate per-node platform-dependent data */ - hubinfo = (hubinfo_t)alloc_bootmem_node(NODE_DATA(node), sizeof(struct hubinfo_s)); + + nasid = COMPACT_TO_NASID_NODEID(node); + if (node >= numnodes) /* Headless/memless IO nodes */ + hubinfo = (hubinfo_t)alloc_bootmem_node(NODE_DATA(0), sizeof(struct hubinfo_s)); + else + hubinfo = (hubinfo_t)alloc_bootmem_node(NODE_DATA(node), sizeof(struct hubinfo_s)); npda->pdinfo = (void *)hubinfo; hubinfo->h_nodepda = npda; hubinfo->h_cnodeid = node; - hubinfo->h_nasid = COMPACT_TO_NASID_NODEID(node); spin_lock_init(&hubinfo->h_crblock); - hubinfo->h_widgetid = hub_widget_id(hubinfo->h_nasid); npda->xbow_peer = INVALID_NASID; /* @@ -69,6 +69,21 @@ void init_platform_nodepda(nodepda_t *npda, cnodeid_t node) init_MUTEX_LOCKED(&npda->xbow_sema); /* init it locked? */ } +void +init_platform_hubinfo(nodepda_t **nodepdaindr) { + cnodeid_t cnode; + hubinfo_t hubinfo; + nodepda_t *npda; + extern int numionodes; + + for (cnode = 0; cnode < numionodes; cnode++) { + npda = nodepdaindr[cnode]; + hubinfo = (hubinfo_t)npda->pdinfo; + hubinfo->h_nasid = COMPACT_TO_NASID_NODEID(cnode); + hubinfo->h_widgetid = hub_widget_id(hubinfo->h_nasid); + } +} + void update_node_information(cnodeid_t cnodeid) { diff --git a/arch/ia64/sn/kernel/setup.c b/arch/ia64/sn/kernel/setup.c index 29b06591c6bc7..1e4b7ea2732ad 100644 --- a/arch/ia64/sn/kernel/setup.c +++ b/arch/ia64/sn/kernel/setup.c @@ -287,6 +287,12 @@ sn_setup(char **cmdline_p) */ sn_cpu_init(); + /* + * Setup hubinfo stuff. Has to happen AFTER sn_cpu_init(), + * because it uses the cnode to nasid tables. + */ + init_platform_hubinfo(nodepdaindr); + #ifdef CONFIG_SMP init_smp_config(); #endif diff --git a/include/asm-ia64/sn/ioerror.h b/include/asm-ia64/sn/ioerror.h index ccff4ebf6aebf..5467a25c650b8 100644 --- a/include/asm-ia64/sn/ioerror.h +++ b/include/asm-ia64/sn/ioerror.h @@ -184,13 +184,9 @@ typedef enum { typedef int error_handler_f(void *, int, ioerror_mode_t, ioerror_t *); typedef void *error_handler_arg_t; -extern void sn_ioerror_dump(char *, int, int, ioerror_t *); - #ifdef ERROR_DEBUG -#define IOERROR_DUMP(x, y, z, t) sn_ioerror_dump((x), (y), (z), (t)) #define IOERR_PRINTF(x) (x) #else -#define IOERROR_DUMP(x, y, z, t) #define IOERR_PRINTF(x) #endif /* ERROR_DEBUG */ -- 2.53.0