Skip to content

Commit

Permalink
[POWERPC] Don't crash on cell with 2 BEs when !CONFIG_NUMA
Browse files Browse the repository at this point in the history
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: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Signed-off-by: Paul Mackerras <paulus@samba.org>
  • Loading branch information
Benjamin Herrenschmidt authored and Paul Mackerras committed Oct 16, 2006
1 parent 51018b0 commit e5267b4
Showing 1 changed file with 11 additions and 4 deletions.
15 changes: 11 additions & 4 deletions arch/powerpc/platforms/cell/spu_base.c
Original file line number Diff line number Diff line change
Expand Up @@ -781,17 +781,24 @@ static int __init create_spu(struct device_node *spe)
if (!spu)
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);
/* try old method */
if (ret)
ret = spu_map_device_old(spu, spe);
if (ret)
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);
if (ret)
ret = spu_map_interrupts_old(spu, spe);
Expand Down

0 comments on commit e5267b4

Please sign in to comment.