浏览代码

[POWERPC] spu_base: move spu_init_channels out of spu_mutex

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@lst.de>
Signed-off-by: Arnd Bergmann <arnd.bergmann@de.ibm.com>
Christoph Hellwig 18 年之前
父节点
当前提交
62c05d583e
共有 1 个文件被更改,包括 2 次插入1 次删除
  1. 2 1
      arch/powerpc/platforms/cell/spu_base.c

+ 2 - 1
arch/powerpc/platforms/cell/spu_base.c

@@ -431,10 +431,11 @@ struct spu *spu_alloc_node(int node)
 		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);