drm/i915: Acquire uncore.lock over intel_uncore_wait_for_register()
authorChris Wilson <chris@chris-wilson.co.uk>
Tue, 11 Apr 2017 10:13:38 +0000 (11:13 +0100)
committerChris Wilson <chris@chris-wilson.co.uk>
Tue, 11 Apr 2017 11:44:34 +0000 (12:44 +0100)
commit0564654340e2776843ade007c1aaa8e8f30dd147
treef9483b848ad9f12dc6ee4b8f9033fe909c3fa9ae
parent02b312d05d1b51008e37f72f5a30c88e11c51ea5
drm/i915: Acquire uncore.lock over intel_uncore_wait_for_register()

We acquire the forcewake and use I915_READ_FW instead for the atomic
wait within intel_uncore_wait_for_register. However, this still leaves
us vulnerable to concurrent mmio access to the register, which can cause
system hangs on gen7. The protection is to acquire uncore.lock around
each register, so lets add it back.

v2: Wrap __intel_wait_for_register_fw() to re-use its atomic wait_for
loop and spare adding another for ourselves.
v3: Add might_sleep() annotation

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Cc: Michal Wajdeczko <michal.wajdeczko@intel.com>
Cc: Joonas Lahtinen <joonas.lahtinen@linux.intel.com>
Link: http://patchwork.freedesktop.org/patch/msgid/20170411101340.31994-3-chris@chris-wilson.co.uk
Reviewed-by: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
drivers/gpu/drm/i915/intel_uncore.c