diff options
Diffstat (limited to 'arch')
-rw-r--r-- | arch/powerpc/platforms/cell/spufs/run.c | 18 |
1 files changed, 13 insertions, 5 deletions
diff --git a/arch/powerpc/platforms/cell/spufs/run.c b/arch/powerpc/platforms/cell/spufs/run.c index b7493b865812..0046bcfe495a 100644 --- a/arch/powerpc/platforms/cell/spufs/run.c +++ b/arch/powerpc/platforms/cell/spufs/run.c | |||
@@ -51,14 +51,22 @@ int spu_stopped(struct spu_context *ctx, u32 *stat) | |||
51 | u64 dsisr; | 51 | u64 dsisr; |
52 | u32 stopped; | 52 | u32 stopped; |
53 | 53 | ||
54 | *stat = ctx->ops->status_read(ctx); | 54 | stopped = SPU_STATUS_INVALID_INSTR | SPU_STATUS_SINGLE_STEP | |
55 | SPU_STATUS_STOPPED_BY_HALT | SPU_STATUS_STOPPED_BY_STOP; | ||
55 | 56 | ||
56 | if (test_bit(SPU_SCHED_NOTIFY_ACTIVE, &ctx->sched_flags)) | 57 | top: |
58 | *stat = ctx->ops->status_read(ctx); | ||
59 | if (*stat & stopped) { | ||
60 | /* | ||
61 | * If the spu hasn't finished stopping, we need to | ||
62 | * re-read the register to get the stopped value. | ||
63 | */ | ||
64 | if (*stat & SPU_STATUS_RUNNING) | ||
65 | goto top; | ||
57 | return 1; | 66 | return 1; |
67 | } | ||
58 | 68 | ||
59 | stopped = SPU_STATUS_INVALID_INSTR | SPU_STATUS_SINGLE_STEP | | 69 | if (test_bit(SPU_SCHED_NOTIFY_ACTIVE, &ctx->sched_flags)) |
60 | SPU_STATUS_STOPPED_BY_HALT | SPU_STATUS_STOPPED_BY_STOP; | ||
61 | if (!(*stat & SPU_STATUS_RUNNING) && (*stat & stopped)) | ||
62 | return 1; | 70 | return 1; |
63 | 71 | ||
64 | dsisr = ctx->csa.class_0_dsisr; | 72 | dsisr = ctx->csa.class_0_dsisr; |