diff options
author | Arnd Bergmann <arnd@arndb.de> | 2006-11-20 12:45:08 -0500 |
---|---|---|
committer | Paul Mackerras <paulus@samba.org> | 2006-12-04 04:40:02 -0500 |
commit | ee2d7340cbf3b123e1c3b7454f3e2b7e65d33bb2 (patch) | |
tree | 2953689e0efdb35195e46c75148bfb91030f71fa /arch/powerpc/platforms/cell/spufs/run.c | |
parent | 3692dc66149dc17cd82ec785a06478322c0eddff (diff) |
[POWERPC] spufs: Use SPU master control to prevent wild SPU execution
When the user changes the runcontrol register, an SPU might be
running without a process being attached to it and waiting for
events. In order to prevent this, make sure we always disable
the priv1 master control when we're not inside of spu_run.
Signed-off-by: Arnd Bergmann <arnd.bergmann@de.ibm.com>
Signed-off-by: Paul Mackerras <paulus@samba.org>
Diffstat (limited to 'arch/powerpc/platforms/cell/spufs/run.c')
-rw-r--r-- | arch/powerpc/platforms/cell/spufs/run.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/arch/powerpc/platforms/cell/spufs/run.c b/arch/powerpc/platforms/cell/spufs/run.c index c88fd7f9ea74..212b9c2f04ab 100644 --- a/arch/powerpc/platforms/cell/spufs/run.c +++ b/arch/powerpc/platforms/cell/spufs/run.c | |||
@@ -207,6 +207,7 @@ long spufs_run_spu(struct file *file, struct spu_context *ctx, | |||
207 | if (down_interruptible(&ctx->run_sema)) | 207 | if (down_interruptible(&ctx->run_sema)) |
208 | return -ERESTARTSYS; | 208 | return -ERESTARTSYS; |
209 | 209 | ||
210 | ctx->ops->master_start(ctx); | ||
210 | ctx->event_return = 0; | 211 | ctx->event_return = 0; |
211 | ret = spu_run_init(ctx, npc); | 212 | ret = spu_run_init(ctx, npc); |
212 | if (ret) | 213 | if (ret) |
@@ -234,7 +235,7 @@ long spufs_run_spu(struct file *file, struct spu_context *ctx, | |||
234 | } while (!ret && !(status & (SPU_STATUS_STOPPED_BY_STOP | | 235 | } while (!ret && !(status & (SPU_STATUS_STOPPED_BY_STOP | |
235 | SPU_STATUS_STOPPED_BY_HALT))); | 236 | SPU_STATUS_STOPPED_BY_HALT))); |
236 | 237 | ||
237 | ctx->ops->runcntl_stop(ctx); | 238 | ctx->ops->master_stop(ctx); |
238 | ret = spu_run_fini(ctx, npc, &status); | 239 | ret = spu_run_fini(ctx, npc, &status); |
239 | spu_yield(ctx); | 240 | spu_yield(ctx); |
240 | 241 | ||