Commit e5267b4b authored by Benjamin Herrenschmidt's avatar Benjamin Herrenschmidt Committed by Paul Mackerras

[POWERPC] Don't crash on cell with 2 BEs when !CONFIG_NUMA

The SPU code will crash if CONFIG_NUMA is not set and SPUs are found on
a non-0 node. This workaround will ignore those SPEs and just print an
message in the kernel log.
Signed-off-by: default avatarBenjamin Herrenschmidt <benh@kernel.crashing.org>
Signed-off-by: default avatarPaul Mackerras <paulus@samba.org>
parent 51018b0a
...@@ -781,6 +781,17 @@ static int __init create_spu(struct device_node *spe) ...@@ -781,6 +781,17 @@ static int __init create_spu(struct device_node *spe)
if (!spu) if (!spu)
goto out; goto out;
spu->node = find_spu_node_id(spe);
if (spu->node >= MAX_NUMNODES) {
printk(KERN_WARNING "SPE %s on node %d ignored,"
" node number too big\n", spe->full_name, spu->node);
printk(KERN_WARNING "Check if CONFIG_NUMA is enabled.\n");
return -ENODEV;
}
spu->nid = of_node_to_nid(spe);
if (spu->nid == -1)
spu->nid = 0;
ret = spu_map_device(spu, spe); ret = spu_map_device(spu, spe);
/* try old method */ /* try old method */
if (ret) if (ret)
...@@ -788,10 +799,6 @@ static int __init create_spu(struct device_node *spe) ...@@ -788,10 +799,6 @@ static int __init create_spu(struct device_node *spe)
if (ret) if (ret)
goto out_free; goto out_free;
spu->node = find_spu_node_id(spe);
spu->nid = of_node_to_nid(spe);
if (spu->nid == -1)
spu->nid = 0;
ret = spu_map_interrupts(spu, spe); ret = spu_map_interrupts(spu, spe);
if (ret) if (ret)
ret = spu_map_interrupts_old(spu, spe); ret = spu_map_interrupts_old(spu, spe);
......
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