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

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



struct_mutext needs to be held before call these two APIs.

Cc: Chris Wilson <chris@xxxxxxxxxxxxxxxxxx>
Cc: Ben Widawsky <benjamin.widawsky@xxxxxxxxx>
Cc: Rodrigo Vivi <rodrigo.vivi@xxxxxxxxx>
Cc: Joonas Lahtinen <joonas.lahtinen@xxxxxxxxxxxxxxx>
Signed-off-by: Zhi Wang <zhi.a.wang@xxxxxxxxx>
---
 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

_______________________________________________
Intel-gfx mailing list
Intel-gfx@xxxxxxxxxxxxxxxxxxxxx
https://lists.freedesktop.org/mailman/listinfo/intel-gfx




[Index of Archives]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]
  Powered by Linux