Commit 6e0e96e8 authored by Jesse Barnes's avatar Jesse Barnes Committed by David Mosberger

[PATCH] ia64: sn_get_node_first_cpu() is redundant

sn_get_node_first_cpu() is redundant, so kill it.  Since calls to this routine 
happen rather late in the boot process, using the generic topology functions 
is safe.  Fixup the callers and kill the function.
parent 9f579d55
...@@ -12,6 +12,7 @@ ...@@ -12,6 +12,7 @@
#include <asm/smp.h> #include <asm/smp.h>
#include <asm/irq.h> #include <asm/irq.h>
#include <asm/hw_irq.h> #include <asm/hw_irq.h>
#include <asm/topology.h>
#include <asm/sn/sgi.h> #include <asm/sn/sgi.h>
#include <asm/sn/iograph.h> #include <asm/sn/iograph.h>
#include <asm/sn/hcl.h> #include <asm/sn/hcl.h>
...@@ -36,25 +37,6 @@ extern irqpda_t *irqpdaindr; ...@@ -36,25 +37,6 @@ extern irqpda_t *irqpdaindr;
extern cnodeid_t master_node_get(vertex_hdl_t vhdl); extern cnodeid_t master_node_get(vertex_hdl_t vhdl);
extern nasid_t master_nasid; extern nasid_t master_nasid;
cpuid_t
sn_get_node_first_cpu(cnodeid_t cnode) {
int cpuid = -1, slice;
for (slice = CPUS_PER_NODE - 1; slice >= 0; slice--) {
cpuid = cnode_slice_to_cpuid(cnode, slice);
if (cpuid == NR_CPUS)
continue;
if (!cpu_online(cpuid))
continue;
break;
}
if (slice < 0) {
return CPU_NONE;
}
return cpuid;
}
/* Initialize some shub registers for interrupts, both IO and error. */ /* Initialize some shub registers for interrupts, both IO and error. */
void intr_init_vecblk(cnodeid_t node) void intr_init_vecblk(cnodeid_t node)
{ {
...@@ -78,13 +60,13 @@ void intr_init_vecblk(cnodeid_t node) ...@@ -78,13 +60,13 @@ void intr_init_vecblk(cnodeid_t node)
HUB_S((unsigned long *)GLOBAL_MMR_ADDR(nasid, SH_INT_NODE_ID_CONFIG), HUB_S((unsigned long *)GLOBAL_MMR_ADDR(nasid, SH_INT_NODE_ID_CONFIG),
node_id_config.sh_int_node_id_config_regval); node_id_config.sh_int_node_id_config_regval);
cnode = nasid_to_cnodeid(master_nasid); cnode = nasid_to_cnodeid(master_nasid);
cpu = sn_get_node_first_cpu(cnode); cpu = first_cpu(node_to_cpumask(cnode));
cpu = cpu_physical_id(cpu); cpu = cpu_physical_id(cpu);
SAL_CALL(ret_stuff, SN_SAL_REGISTER_CE, nasid, cpu, master_nasid,0,0,0,0); SAL_CALL(ret_stuff, SN_SAL_REGISTER_CE, nasid, cpu, master_nasid,0,0,0,0);
if (ret_stuff.status < 0) if (ret_stuff.status < 0)
printk("%s: SN_SAL_REGISTER_CE SAL_CALL failed\n",__FUNCTION__); printk("%s: SN_SAL_REGISTER_CE SAL_CALL failed\n",__FUNCTION__);
} else { } else {
cpu = sn_get_node_first_cpu(node); cpu = first_cpu(node_to_cpumask(node));
cpu = cpu_physical_id(cpu); cpu = cpu_physical_id(cpu);
} }
......
...@@ -500,10 +500,9 @@ sn_sal_connect_interrupt(void) ...@@ -500,10 +500,9 @@ sn_sal_connect_interrupt(void)
nasid_t console_nasid; nasid_t console_nasid;
unsigned int console_irq; unsigned int console_irq;
int result; int result;
extern cpuid_t sn_get_node_first_cpu(cnodeid_t cnode);
console_nasid = ia64_sn_get_console_nasid(); console_nasid = ia64_sn_get_console_nasid();
intr_cpuid = sn_get_node_first_cpu(NASID_TO_COMPACT_NODEID(console_nasid)); intr_cpuid = first_cpu(node_to_cpumask(NASID_TO_COMPACT_NODEID(console_nasid)));
intr_cpuloc = cpu_physical_id(intr_cpuid); intr_cpuloc = cpu_physical_id(intr_cpuid);
console_irq = CPU_VECTOR_TO_IRQ(intr_cpuloc, SGI_UART_VECTOR); console_irq = CPU_VECTOR_TO_IRQ(intr_cpuloc, SGI_UART_VECTOR);
......
...@@ -20,8 +20,6 @@ typedef u64 hubreg_t; ...@@ -20,8 +20,6 @@ typedef u64 hubreg_t;
typedef u64 mmr_t; typedef u64 mmr_t;
typedef u64 nic_t; typedef u64 nic_t;
#define CNODE_TO_CPU_BASE(_cnode) (sn_get_node_first_cpu(_cnode))
#define NASID_TO_COMPACT_NODEID(nasid) (nasid_to_cnodeid(nasid)) #define NASID_TO_COMPACT_NODEID(nasid) (nasid_to_cnodeid(nasid))
#define COMPACT_TO_NASID_NODEID(cnode) (cnodeid_to_nasid(cnode)) #define COMPACT_TO_NASID_NODEID(cnode) (cnodeid_to_nasid(cnode))
...@@ -34,9 +32,7 @@ typedef u64 nic_t; ...@@ -34,9 +32,7 @@ typedef u64 nic_t;
#define INVALID_PARTID ((partid_t)-1) #define INVALID_PARTID ((partid_t)-1)
extern cpuid_t cnodetocpu(cnodeid_t); extern cpuid_t cnodetocpu(cnodeid_t);
void sn_flush_all_caches(long addr, long bytes); extern void sn_flush_all_caches(long addr, long bytes);
extern int is_fine_dirmode(void);
extern int is_fine_dirmode(void);
#endif /* _ASM_IA64_SN_ARCH_H */ #endif /* _ASM_IA64_SN_ARCH_H */
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment