[Intel-gfx] [PATCH 05/16] drm/i915/ctx: Return earlier on failure

Chris Wilson chris at chris-wilson.co.uk
Fri Jul 4 10:14:49 CEST 2014


On Tue, Jul 01, 2014 at 11:17:40AM -0700, Ben Widawsky wrote:
> As what was correctly debugged here:
> commit acc240d41ea1ab9c488a79219fb313b5b46265ae
> Author: Daniel Vetter <daniel.vetter at ffwll.ch>
> Date:   Thu Dec 5 15:42:34 2013 +0100
> 
>     drm/i915: Fix use-after-free in do_switch
> 
> It then becomes apparent that the default context cannot be the context
> being switched to for context switch because it is always bound. It
> follows that if the ring->last_context (from) has changed after the
> bind_to_gtt, it will always be the default context - this is commented
> in the code block.
> 
> This assertion will help catch issues without our logic sooner than
> letting the system move long (which is possible for some time).
> 
> I really want this to be a BUG(), but I also want the patch to get
> merged. I think the fact that none of the ERRNOs make any sense at all
> is just more evidence that this shouldn't be a WARN.

Hmm, we could adopt EREMOTEIO or for driver bugs.
-Chris

-- 
Chris Wilson, Intel Open Source Technology Centre



More information about the Intel-gfx mailing list