@@ -187,7 +187,7 @@ struct spu {
};
struct cbe_spu_info {
- struct mutex list_mutex;
+ spinlock_t list_lock;
struct list_head spus;
int n_spus;
int nr_active;
b/arch/powerpc/platforms/cell/spu_base.c
@@ -650,10 +650,10 @@ static int __init create_spu(void *data)
if (ret)
goto out_free_irqs;
- mutex_lock(&cbe_spu_info[spu->node].list_mutex);
+ spin_lock(&cbe_spu_info[spu->node].list_lock);
list_add(&spu->cbe_list, &cbe_spu_info[spu->node].spus);
cbe_spu_info[spu->node].n_spus++;
- mutex_unlock(&cbe_spu_info[spu->node].list_mutex);
+ spin_unlock(&cbe_spu_info[spu->node].list_lock);
mutex_lock(&spu_full_list_mutex);
spin_lock_irqsave(&spu_full_list_lock, flags);
@@ -732,7 +732,7 @@ static int __init init_spu_base(void)
int i, ret = 0;
for (i = 0; i < MAX_NUMNODES; i++) {
- mutex_init(&cbe_spu_info[i].list_mutex);
+ spin_lock_init(&cbe_spu_info[i].list_lock);
INIT_LIST_HEAD(&cbe_spu_info[i].spus);
}
b/arch/powerpc/platforms/cell/spufs/sched.c
@@ -153,11 +153,11 @@ void spu_update_sched_info(struct spu_context *ctx)
node = ctx->spu->node;
/*
- * Take list_mutex to sync with find_victim().
+ * Take list_lock to sync with find_victim().
*/
- mutex_lock(&cbe_spu_info[node].list_mutex);
+ spin_lock(&cbe_spu_info[node].list_lock);
__spu_update_sched_info(ctx);
- mutex_unlock(&cbe_spu_info[node].list_mutex);
+ spin_unlock(&cbe_spu_info[node].list_lock);
} else {
__spu_update_sched_info(ctx);
}
@@ -179,9 +179,9 @@ static int node_allowed(struct spu_context *ctx, int node)
{
int rval;
- spin_lock(&spu_prio->runq_lock);
+ spin_lock(&cbe_spu_info[node].list_lock);
rval = __node_allowed(ctx, node);
- spin_unlock(&spu_prio->runq_lock);
+ spin_unlock(&cbe_spu_info[node].list_lock);
return rval;
}
@@ -199,7 +199,7 @@ void do_notify_spus_active(void)
for_each_online_node(node) {
struct spu *spu;
- mutex_lock(&cbe_spu_info[node].list_mutex);
+ spin_lock(&cbe_spu_info[node].list_lock);
list_for_each_entry(spu, &cbe_spu_info[node].spus, cbe_list) {
if (spu->alloc_state != SPU_FREE) {
struct spu_context *ctx = spu->ctx;
@@ -209,7 +209,7 @@ void do_notify_spus_active(void)
wake_up_all(&ctx->stop_wq);
}
}
- mutex_unlock(&cbe_spu_info[node].list_mutex);
+ spin_unlock(&cbe_spu_info[node].list_lock);
}
}
@@ -233,7 +233,6 @@ static void spu_bind_context(struct spu *spu, struct
spu_context *ctx)
spu_associate_mm(spu, ctx->owner);
spin_lock_irq(&spu->register_lock);
- spu->ctx = ctx;
spu->flags = 0;
ctx->spu = spu;