summaryrefslogtreecommitdiff
path: root/drivers/gpu/drm/i915/intel_uncore.c
diff options
context:
space:
mode:
authorChris Wilson <chris@chris-wilson.co.uk>2019-07-07 16:11:35 +0100
committerChris Wilson <chris@chris-wilson.co.uk>2019-07-07 16:43:32 +0100
commit15e7facb7b428f5f0dac3ee85ecb519a46caaa34 (patch)
tree78731e25572f5ff272806a1738d2531d1b941520 /drivers/gpu/drm/i915/intel_uncore.c
parent50b38bc4d39aa6fa5639aabcccfb828c19b89278 (diff)
drm/i915: Pull assert_forcewake_active() underneath the lock
Make no assumption that something in the background is not acquiring the fw_domain -- but we still do not track owner so assume that any active domain is intended by the caller. Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk> Reviewed-by: Tvrtko Ursulin <tvrtko.ursulin@intel.com> Link: https://patchwork.freedesktop.org/patch/msgid/20190707151135.11700-1-chris@chris-wilson.co.uk
Diffstat (limited to 'drivers/gpu/drm/i915/intel_uncore.c')
-rw-r--r--drivers/gpu/drm/i915/intel_uncore.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/drivers/gpu/drm/i915/intel_uncore.c b/drivers/gpu/drm/i915/intel_uncore.c
index bb9e0da30e94..5f0367fd3200 100644
--- a/drivers/gpu/drm/i915/intel_uncore.c
+++ b/drivers/gpu/drm/i915/intel_uncore.c
@@ -747,6 +747,8 @@ void assert_forcewakes_active(struct intel_uncore *uncore,
if (!uncore->funcs.force_wake_get)
return;
+ spin_lock_irq(&uncore->lock);
+
assert_rpm_wakelock_held(uncore->rpm);
fw_domains &= uncore->fw_domains;
@@ -770,6 +772,8 @@ void assert_forcewakes_active(struct intel_uncore *uncore,
domain->id, actual))
break;
}
+
+ spin_unlock_irq(&uncore->lock);
}
/* We give fast paths for the really cool registers */