[Cbe-oss-dev] PATCH [2/7] class 0 and 1 rework [Updated]

Jeremy Kerr jk at ozlabs.org
Wed Nov 7 15:59:42 EST 2007


Hi Arnd/Luke,

> +static inline int spu_handle_class0_events(struct spu_context *ctx)
>  {
> -	struct spu *spu = ctx->spu;
>  	int ret = 0;
> +	u64 stat = ctx->csa.class_0_pending;
>
> -	if (spu->class_0_pending)
> -		ret = spu_irq_class_0_bottom(spu);
> +	if (stat) {
> +		if (ctx->flags & SPU_CREATE_EVENTS_ENABLED) {
> +			if (stat & 1) 		/* invalid DMA alignment */
> +				ctx->event_return |= SPE_EVENT_DMA_ALIGNMENT;
> +
> +			if (stat & 2) 		/* invalid MFC DMA */
> +				ctx->event_return |= SPE_EVENT_INVALID_DMA;
> +
> +			if (stat & 4) 		/* error on SPU */
> +				ctx->event_return |= SPE_EVENT_SPE_ERROR;
> +
> +			wake_up_all(&ctx->stop_wq);

Also, what do we expect to have on the stop_wq at this point? To get to 
this code, we have already hit the spufs_stop_callback, which has just 
done a wake_up_all(&ctx->stop_wq). In fact, that's what woke this 
thread up.

Or is this intended to catch anything that's added to the stop_wq 
between these events? If so, I'll add a comment here.

Cheers,


Jeremy



More information about the cbe-oss-dev mailing list