powerpc/xics: Initialization code cleanups
We only need to check the ibm,interrupt-server#-size property once, not once per global server and thread. We can use !CONFIG_SMP cpu masks and hard_smp_processor_id() to avoid an ifdef. Put the node when breaking out of the loop on lpar systems. Signed-off-by: Milton Miller <miltonm@bga.com> Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
This commit is contained in:
committed by
Benjamin Herrenschmidt
parent
188bdddd24
commit
a244a957ab
@@ -606,13 +606,13 @@ static void xics_update_irq_servers(void)
|
|||||||
if (ireg[j] == hcpuid) {
|
if (ireg[j] == hcpuid) {
|
||||||
default_server = hcpuid;
|
default_server = hcpuid;
|
||||||
default_distrib_server = ireg[j+1];
|
default_distrib_server = ireg[j+1];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
isize = of_get_property(np,
|
/* get the bit size of server numbers */
|
||||||
"ibm,interrupt-server#-size", NULL);
|
isize = of_get_property(np, "ibm,interrupt-server#-size", NULL);
|
||||||
if (isize)
|
if (isize)
|
||||||
interrupt_server_size = *isize;
|
interrupt_server_size = *isize;
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
of_node_put(np);
|
of_node_put(np);
|
||||||
}
|
}
|
||||||
@@ -620,7 +620,6 @@ static void xics_update_irq_servers(void)
|
|||||||
static void __init xics_map_one_cpu(int hw_id, unsigned long addr,
|
static void __init xics_map_one_cpu(int hw_id, unsigned long addr,
|
||||||
unsigned long size)
|
unsigned long size)
|
||||||
{
|
{
|
||||||
#ifdef CONFIG_SMP
|
|
||||||
int i;
|
int i;
|
||||||
|
|
||||||
/* This may look gross but it's good enough for now, we don't quite
|
/* This may look gross but it's good enough for now, we don't quite
|
||||||
@@ -634,11 +633,6 @@ static void __init xics_map_one_cpu(int hw_id, unsigned long addr,
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
#else
|
|
||||||
if (hw_id != 0)
|
|
||||||
return;
|
|
||||||
xics_per_cpu[0] = ioremap(addr, size);
|
|
||||||
#endif /* CONFIG_SMP */
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static void __init xics_init_one_node(struct device_node *np,
|
static void __init xics_init_one_node(struct device_node *np,
|
||||||
@@ -700,8 +694,10 @@ void __init xics_init_IRQ(void)
|
|||||||
|
|
||||||
for_each_node_by_type(np, "PowerPC-External-Interrupt-Presentation") {
|
for_each_node_by_type(np, "PowerPC-External-Interrupt-Presentation") {
|
||||||
found = 1;
|
found = 1;
|
||||||
if (firmware_has_feature(FW_FEATURE_LPAR))
|
if (firmware_has_feature(FW_FEATURE_LPAR)) {
|
||||||
|
of_node_put(np);
|
||||||
break;
|
break;
|
||||||
|
}
|
||||||
xics_init_one_node(np, &indx);
|
xics_init_one_node(np, &indx);
|
||||||
}
|
}
|
||||||
if (found == 0)
|
if (found == 0)
|
||||||
|
Reference in New Issue
Block a user