[Cbe-oss-dev] PATCH [2/7] class 0 and 1 rework [Updated]
Jeremy Kerr
jk at ozlabs.org
Wed Nov 7 14:17:37 EST 2007
Luke,
> @@ -15,7 +15,28 @@ void spufs_stop_callback(struct spu *spu
> {
> struct spu_context *ctx = spu->ctx;
>
> - wake_up_all(&ctx->stop_wq);
> + /*
> + * It should be impossible to preempt a context while an exception
> + * is being processed, since the context switch code is specially
> + * coded to deal with interrupts ... But, just in case, sanity check
> + * the context pointer. It is OK to return doing nothing since
> + * the exception will be regenerated when the context is resumed
> + */
> + if (ctx) {
> + /* Copy exception arguments into module specific structure */
> + ctx->csa.class_0_pending = spu->class_0_pending;
> + ctx->csa.dsisr = spu->dsisr;
> + ctx->csa.dar = spu->dar;
> +
> + mb();
OK with a smp_wmb() here instead?
> +
> + wake_up_all(&ctx->stop_wq);
> + }
> +
> + /* Clear callback arguments from spu structure */
> + spu->class_0_pending = 0;
> + spu->dsisr = 0;
> + spu->dar = 0;
> }
Cheers,
Jeremy
More information about the cbe-oss-dev
mailing list