[Cbe-oss-dev] [PATCH] spu_base: move spu_init_channels out of spu_mutex

Christoph Hellwig hch at lst.de
Fri Feb 9 10:37:59 EST 2007


There is no reason to execute spu_init_channels under spu_mutex - 
after the spu has been taken off the freelist it's ours.


Signed-off-by: Christoph Hellwig <hch at lst.de>

Index: linux-2.6/arch/powerpc/platforms/cell/spu_base.c
===================================================================
--- linux-2.6.orig/arch/powerpc/platforms/cell/spu_base.c	2007-02-08 22:40:27.000000000 +0100
+++ linux-2.6/arch/powerpc/platforms/cell/spu_base.c	2007-02-08 23:52:43.000000000 +0100
@@ -374,10 +374,11 @@
 		spu = list_entry(spu_list[node].next, struct spu, list);
 		list_del_init(&spu->list);
 		pr_debug("Got SPU %d %d\n", spu->number, spu->node);
-		spu_init_channels(spu);
 	}
 	mutex_unlock(&spu_mutex);
 
+	if (spu)
+		spu_init_channels(spu);
 	return spu;
 }
 EXPORT_SYMBOL_GPL(spu_alloc_node);



More information about the cbe-oss-dev mailing list