Commit fb781898 authored by Nirmoy Das's avatar Nirmoy Das Committed by Matthew Auld

drm/i915: Do not cleanup obj with NULL bo->resource

For delayed BO release i915_ttm_delete_mem_notify()
gets called twice, once with proper bo->resource and
another time with NULL. We shouldn't do anything for
the 2nd time as we already cleaned up the obj once.

References: https://gitlab.freedesktop.org/drm/intel/-/issues/6850
Fixes: ad74457a ("drm/i915/dgfx: Release mmap on rpm suspend")
Signed-off-by: default avatarNirmoy Das <nirmoy.das@intel.com>
Reviewed-by: default avatarMatthew Auld <matthew.auld@intel.com>
Signed-off-by: default avatarMatthew Auld <matthew.auld@intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20220920170628.3391-1-nirmoy.das@intel.com
parent 0d2d2010
...@@ -550,7 +550,7 @@ static void i915_ttm_delete_mem_notify(struct ttm_buffer_object *bo) ...@@ -550,7 +550,7 @@ static void i915_ttm_delete_mem_notify(struct ttm_buffer_object *bo)
struct drm_i915_gem_object *obj = i915_ttm_to_gem(bo); struct drm_i915_gem_object *obj = i915_ttm_to_gem(bo);
intel_wakeref_t wakeref = 0; intel_wakeref_t wakeref = 0;
if (likely(obj)) { if (bo->resource && likely(obj)) {
/* ttm_bo_release() already has dma_resv_lock */ /* ttm_bo_release() already has dma_resv_lock */
if (i915_ttm_cpu_maps_iomem(bo->resource)) if (i915_ttm_cpu_maps_iomem(bo->resource))
wakeref = intel_runtime_pm_get(&to_i915(obj->base.dev)->runtime_pm); wakeref = intel_runtime_pm_get(&to_i915(obj->base.dev)->runtime_pm);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment