Commit 239f3c2e authored by Maarten Lankhorst's avatar Maarten Lankhorst

drm/i915: Fix runtime pm handling in i915_gem_shrink

We forgot to call intel_runtime_pm_put on error, fix it!
Signed-off-by: default avatarMaarten Lankhorst <maarten.lankhorst@linux.intel.com>
Fixes: cf41a8f1 ("drm/i915: Finally remove obj->mm.lock.")
Cc: Thomas Hellström <thomas.hellstrom@linux.intel.com>
Cc: Daniel Vetter <daniel.vetter@ffwll.ch>
Cc: <stable@vger.kernel.org> # v5.13+
Reviewed-by: default avatarThomas Hellström <thomas.hellstrom@linux.intel.com>
Reviewed-by: default avatarNiranjana Vishwanathapura <niranjana.vishwanathapura@intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20210830121006.2978297-9-maarten.lankhorst@linux.intel.com
parent d576b31b
...@@ -118,7 +118,7 @@ i915_gem_shrink(struct i915_gem_ww_ctx *ww, ...@@ -118,7 +118,7 @@ i915_gem_shrink(struct i915_gem_ww_ctx *ww,
intel_wakeref_t wakeref = 0; intel_wakeref_t wakeref = 0;
unsigned long count = 0; unsigned long count = 0;
unsigned long scanned = 0; unsigned long scanned = 0;
int err; int err = 0;
/* CHV + VTD workaround use stop_machine(); need to trylock vm->mutex */ /* CHV + VTD workaround use stop_machine(); need to trylock vm->mutex */
bool trylock_vm = !ww && intel_vm_no_concurrent_access_wa(i915); bool trylock_vm = !ww && intel_vm_no_concurrent_access_wa(i915);
...@@ -242,12 +242,15 @@ i915_gem_shrink(struct i915_gem_ww_ctx *ww, ...@@ -242,12 +242,15 @@ i915_gem_shrink(struct i915_gem_ww_ctx *ww,
list_splice_tail(&still_in_list, phase->list); list_splice_tail(&still_in_list, phase->list);
spin_unlock_irqrestore(&i915->mm.obj_lock, flags); spin_unlock_irqrestore(&i915->mm.obj_lock, flags);
if (err) if (err)
return err; break;
} }
if (shrink & I915_SHRINK_BOUND) if (shrink & I915_SHRINK_BOUND)
intel_runtime_pm_put(&i915->runtime_pm, wakeref); intel_runtime_pm_put(&i915->runtime_pm, wakeref);
if (err)
return err;
if (nr_scanned) if (nr_scanned)
*nr_scanned += scanned; *nr_scanned += scanned;
return count; return count;
......
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