]> git.baikalelectronics.ru Git - kernel.git/commit
drm/i915: forcewake fix after reset
authorBen Widawsky <ben@bwidawsk.net>
Fri, 24 Jun 2011 21:31:47 +0000 (14:31 -0700)
committerKeith Packard <keithp@keithp.com>
Tue, 28 Jun 2011 16:44:55 +0000 (09:44 -0700)
commit7636daf9c54eb844c7d161b0f614fbe0820fad63
treee265e7fe4cb531722b2bfe8ddb17e521f6e460b8
parenta21f3abc4ca70c485dd938a75d9fd4b64bc7c0fb
drm/i915: forcewake fix after reset

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@chris-wilson.co.uk>
Signed-off-by: Ben Widawsky <ben@bwidawsk.net>
Signed-off-by: Keith Packard <keithp@keithp.com>
drivers/gpu/drm/i915/i915_drv.c