powerpc: Don't crash on cell with 2 BEs when !CONFIG_NUMA
Subsystems (2)
PATCH 1/1 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 Benjamin Herrenschmidt <[email protected]>
arch/powerpc/platforms/cell/spu_base.c +11 -4
@@ -847,6 +847,17 @@ static int __init create_spu(struct deviif (!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)
@@ -854,10 +865,6 @@ static int __init create_spu(struct deviif (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);