[POWERPC] spufs: turn run_sema into run_mutex
There is no reason for run_sema to be a struct semaphore. Changing it to a mutex and rename it accordingly. Signed-off-by: Christoph Hellwig <hch@lst.de> Signed-off-by: Arnd Bergmann <arnd.bergmann@de.ibm.com>
This commit is contained in:
committed by
Arnd Bergmann
parent
c8a1e9393a
commit
e45d48a34d
@@ -44,7 +44,7 @@ struct spu_context *alloc_spu_context(struct spu_gang *gang)
|
|||||||
spin_lock_init(&ctx->mapping_lock);
|
spin_lock_init(&ctx->mapping_lock);
|
||||||
kref_init(&ctx->kref);
|
kref_init(&ctx->kref);
|
||||||
mutex_init(&ctx->state_mutex);
|
mutex_init(&ctx->state_mutex);
|
||||||
init_MUTEX(&ctx->run_sema);
|
mutex_init(&ctx->run_mutex);
|
||||||
init_waitqueue_head(&ctx->ibox_wq);
|
init_waitqueue_head(&ctx->ibox_wq);
|
||||||
init_waitqueue_head(&ctx->wbox_wq);
|
init_waitqueue_head(&ctx->wbox_wq);
|
||||||
init_waitqueue_head(&ctx->stop_wq);
|
init_waitqueue_head(&ctx->stop_wq);
|
||||||
|
@@ -288,7 +288,7 @@ long spufs_run_spu(struct file *file, struct spu_context *ctx,
|
|||||||
int ret;
|
int ret;
|
||||||
u32 status;
|
u32 status;
|
||||||
|
|
||||||
if (down_interruptible(&ctx->run_sema))
|
if (mutex_lock_interruptible(&ctx->run_mutex))
|
||||||
return -ERESTARTSYS;
|
return -ERESTARTSYS;
|
||||||
|
|
||||||
ctx->ops->master_start(ctx);
|
ctx->ops->master_start(ctx);
|
||||||
@@ -345,6 +345,6 @@ out2:
|
|||||||
|
|
||||||
out:
|
out:
|
||||||
*event = ctx->event_return;
|
*event = ctx->event_return;
|
||||||
up(&ctx->run_sema);
|
mutex_unlock(&ctx->run_mutex);
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
@@ -60,7 +60,7 @@ struct spu_context {
|
|||||||
|
|
||||||
enum { SPU_STATE_RUNNABLE, SPU_STATE_SAVED } state;
|
enum { SPU_STATE_RUNNABLE, SPU_STATE_SAVED } state;
|
||||||
struct mutex state_mutex;
|
struct mutex state_mutex;
|
||||||
struct semaphore run_sema;
|
struct mutex run_mutex;
|
||||||
|
|
||||||
struct mm_struct *owner;
|
struct mm_struct *owner;
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user