Skip to content

Commit

Permalink
[POWERPC] spufs: turn run_sema into run_mutex
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Christoph Hellwig authored and Arnd Bergmann committed Apr 23, 2007
1 parent c8a1e93 commit e45d48a
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion arch/powerpc/platforms/cell/spufs/context.c
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ struct spu_context *alloc_spu_context(struct spu_gang *gang)
spin_lock_init(&ctx->mapping_lock);
kref_init(&ctx->kref);
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->wbox_wq);
init_waitqueue_head(&ctx->stop_wq);
Expand Down
4 changes: 2 additions & 2 deletions arch/powerpc/platforms/cell/spufs/run.c
Original file line number Diff line number Diff line change
Expand Up @@ -288,7 +288,7 @@ long spufs_run_spu(struct file *file, struct spu_context *ctx,
int ret;
u32 status;

if (down_interruptible(&ctx->run_sema))
if (mutex_lock_interruptible(&ctx->run_mutex))
return -ERESTARTSYS;

ctx->ops->master_start(ctx);
Expand Down Expand Up @@ -345,6 +345,6 @@ long spufs_run_spu(struct file *file, struct spu_context *ctx,

out:
*event = ctx->event_return;
up(&ctx->run_sema);
mutex_unlock(&ctx->run_mutex);
return ret;
}
2 changes: 1 addition & 1 deletion arch/powerpc/platforms/cell/spufs/spufs.h
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ struct spu_context {

enum { SPU_STATE_RUNNABLE, SPU_STATE_SAVED } state;
struct mutex state_mutex;
struct semaphore run_sema;
struct mutex run_mutex;

struct mm_struct *owner;

Expand Down

0 comments on commit e45d48a

Please sign in to comment.