]> git.baikalelectronics.ru Git - kernel.git/commit
drm/i915: Restore user forcewake domains across suspend
authorChris Wilson <chris@chris-wilson.co.uk>
Wed, 8 Aug 2018 21:08:42 +0000 (22:08 +0100)
committerChris Wilson <chris@chris-wilson.co.uk>
Thu, 9 Aug 2018 13:25:46 +0000 (14:25 +0100)
commitcbf424c417dad07c0e18725413536887e4862a3a
treeb4b25eaadd87767fd13de8bcd70fa70e7b0d26c1
parentd8ff10447f85789b4a80491551797ea33d9b9c87
drm/i915: Restore user forcewake domains across suspend

On suspend, we cancel the automatic forcewake and clear all other sources
of forcewake so the machine can sleep before we do suspend. However, we
expose the forcewake to userspace (only via debugfs, but nevertheless we
do) and want to restore that upon resume or else our accounting will be
off and we may not acquire the forcewake before we use it. So record
which domains we cleared on suspend and reacquire them early on resume.

v2: Hold the spinlock to appease our sanitychecks
v3: s/fw_domains_user/fw_domains_saved/ to convey intent more clearly

Reported-by: Imre Deak <imre.deak@linux.intel.com>
Fixes: daed23e56291 ("drm/i915: Fix forcewake active domain tracking")
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Cc: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
Cc: Mika Kuoppala <mika.kuoppala@intel.com>
Cc: Imre Deak <imre.deak@linux.intel.com>
Reviewed-by: Imre Deak <imre.deak@intel.com>
Reviewed-by: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20180808210842.3555-1-chris@chris-wilson.co.uk
drivers/gpu/drm/i915/intel_uncore.c
drivers/gpu/drm/i915/intel_uncore.h
drivers/gpu/drm/i915/selftests/intel_uncore.c