Skip to content

Commit

Permalink
[POWERPC] spufs: add memory barriers after set_bit
Browse files Browse the repository at this point in the history
set_bit does not guarantee ordering on powerpc, so using it
for communication between threads requires explicit
mb() calls.

Signed-off-by: Arnd Bergmann <arnd.bergmann@de.ibm.com>
  • Loading branch information
Arnd Bergmann authored and Arnd Bergmann committed Apr 23, 2007
1 parent e097b51 commit 390c534
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions arch/powerpc/platforms/cell/spufs/sched.c
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,7 @@ void spu_start_tick(struct spu_context *ctx)
* Make sure the exiting bit is cleared.
*/
clear_bit(SPU_SCHED_EXITING, &ctx->sched_flags);
mb();
queue_delayed_work(spu_sched_wq, &ctx->sched_work, SPU_TIMESLICE);
}
}
Expand All @@ -88,6 +89,7 @@ void spu_stop_tick(struct spu_context *ctx)
* makes sure it does not rearm itself anymore.
*/
set_bit(SPU_SCHED_EXITING, &ctx->sched_flags);
mb();
cancel_delayed_work(&ctx->sched_work);
}
}
Expand Down Expand Up @@ -239,6 +241,7 @@ static void spu_add_to_rq(struct spu_context *ctx)
spin_lock(&spu_prio->runq_lock);
list_add_tail(&ctx->rq, &spu_prio->runq[ctx->prio]);
set_bit(ctx->prio, spu_prio->bitmap);
mb();
spin_unlock(&spu_prio->runq_lock);
}

Expand Down

0 comments on commit 390c534

Please sign in to comment.