[Intel-gfx] [PATCH v2 2/2] drm/i915: add lockdep_assert_held in i915_ppat_{get, put}

Zhi Wang zhi.a.wang at intel.com
Thu Sep 14 17:51:13 UTC 2017


struct_mutext needs to be held before call these two APIs.

Cc: Chris Wilson <chris at chris-wilson.co.uk>
Cc: Ben Widawsky <benjamin.widawsky at intel.com>
Cc: Rodrigo Vivi <rodrigo.vivi at intel.com>
Cc: Joonas Lahtinen <joonas.lahtinen at linux.intel.com>
Signed-off-by: Zhi Wang <zhi.a.wang at intel.com>
---
 drivers/gpu/drm/i915/i915_gem_gtt.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/drivers/gpu/drm/i915/i915_gem_gtt.c b/drivers/gpu/drm/i915/i915_gem_gtt.c
index 37cd086..b43d3c9 100644
--- a/drivers/gpu/drm/i915/i915_gem_gtt.c
+++ b/drivers/gpu/drm/i915/i915_gem_gtt.c
@@ -2869,6 +2869,7 @@ intel_ppat_get(struct drm_i915_private *i915, u8 value)
 	unsigned int scanned, best_score;
 	int i;
 
+	lockdep_assert_held(&i915->drm.struct_mutex);
 	GEM_BUG_ON(!ppat->max_entries);
 
 	scanned = best_score = 0;
@@ -2924,6 +2925,7 @@ void intel_ppat_put(const struct intel_ppat_entry *entry)
 	struct intel_ppat *ppat = entry->ppat;
 	unsigned int index = entry - ppat->entries;
 
+	lockdep_assert_held(&ppat->i915->drm.struct_mutex);
 	GEM_BUG_ON(!ppat->max_entries);
 
 	kref_put(&ppat->entries[index].ref, release_ppat);
-- 
2.7.4



More information about the Intel-gfx mailing list