Skip to content

Commit

Permalink
[POWERPC] spufs: don't acquire state_mutex interruptible while perfor…
Browse files Browse the repository at this point in the history
…ming callback

There's currently no way to tell if spu_process_callback has
returned with the state mutex held, as -EINTR may be returned
by either the syscall or the spu_acquire fail case.

Instead, just do a non-interruptible mutex_lock here.

Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
  • Loading branch information
Jeremy Kerr committed May 5, 2008
1 parent c0bace5 commit d29694f
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions arch/powerpc/platforms/cell/spufs/run.c
Original file line number Diff line number Diff line change
Expand Up @@ -294,7 +294,7 @@ static int spu_process_callback(struct spu_context *ctx)
u32 ls_pointer, npc;
void __iomem *ls;
long spu_ret;
int ret, ret2;
int ret;

/* get syscall block from local store */
npc = ctx->ops->npc_read(ctx) & ~3;
Expand All @@ -316,11 +316,9 @@ static int spu_process_callback(struct spu_context *ctx)
if (spu_ret <= -ERESTARTSYS) {
ret = spu_handle_restartsys(ctx, &spu_ret, &npc);
}
ret2 = spu_acquire(ctx);
mutex_lock(&ctx->state_mutex);
if (ret == -ERESTARTSYS)
return ret;
if (ret2)
return -EINTR;
}

/* need to re-get the ls, as it may have changed when we released the
Expand Down

0 comments on commit d29694f

Please sign in to comment.