[Intel-gfx] [PATCH] drm/i915: forcewake fix after reset

Chris Wilson chris at chris-wilson.co.uk
Sat Jun 25 11:12:13 CEST 2011


On Fri, 24 Jun 2011 14:31:47 -0700, Ben Widawsky <ben at bwidawsk.net> wrote:
> The failure is as follows:
> 
> 1. Userspace gets forcewake lock, lock count >=1
> 2. GPU hang/reset occurs (forcewake bit is reset)
> 3. count is now incorrect
> 
> The failure can only occur when using the forcewake userspace lock.
> 
> This has the unfortunate consequence of messing up the driver as well as
> userspace, unless userspace closes the debugfs file, the kernel will
> never end up waking the GT since the refcount will be > 1.
> 
> The solution is to try to recover the correct forcewake state based on
> the refcount. There is a period of time where userspace reads/writes may
> occur after the reset, before the GT has been forcewaked. The interface
> was never designed to be a perfect solution for userspace reads/writes,
> and the kernel portion is fixed by this patch.
> 
> Suggested-by: Chris Wilson <chris at chris-wilson.co.uk>
> Signed-off-by: Ben Widawsky <ben at bwidawsk.net>

Excellent change log.

My only quibble is that we should do this as gen6_post_reset(), but that
can be done when we more tasks to perform after reseting the GPU on
different generations.

Reviewed-by: Chris Wilson <chris at chris-wilson.co.uk>
-Chris

-- 
Chris Wilson, Intel Open Source Technology Centre



More information about the Intel-gfx mailing list