From: Tvrtko Ursulin Date: Fri, 29 Apr 2022 14:07:57 +0000 (+0100) Subject: drm/i915: Fix assert in i915_ggtt_pin X-Git-Tag: v6.1-rc5~176^2~23^2~185 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=0de2cc0e2b5faff50d36552ba174d525ca1e8fb3;p=platform%2Fkernel%2Flinux-starfive.git drm/i915: Fix assert in i915_ggtt_pin Use lockdep_assert_not_held to simplify and correct the code. Otherwise false positive are hit if lock state is uknown like after a previous taint. Signed-off-by: Tvrtko Ursulin Reported-by: Ville Syrjälä Reviewed-by: Ville Syrjälä Link: https://patchwork.freedesktop.org/patch/msgid/20220429140757.651406-1-tvrtko.ursulin@linux.intel.com --- diff --git a/drivers/gpu/drm/i915/i915_vma.c b/drivers/gpu/drm/i915/i915_vma.c index 033ef69..cb3c943 100644 --- a/drivers/gpu/drm/i915/i915_vma.c +++ b/drivers/gpu/drm/i915/i915_vma.c @@ -1562,9 +1562,7 @@ int i915_ggtt_pin(struct i915_vma *vma, struct i915_gem_ww_ctx *ww, if (ww) return __i915_ggtt_pin(vma, ww, align, flags); -#ifdef CONFIG_LOCKDEP - WARN_ON(dma_resv_held(vma->obj->base.resv)); -#endif + lockdep_assert_not_held(&vma->obj->base.resv->lock.base); for_i915_gem_ww(&_ww, err, true) { err = i915_gem_object_lock(vma->obj, &_ww);