Skip to content

Commit 0c94777

Browse files
mlankhorstjnikula
authored andcommitted
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: Maarten Lankhorst <[email protected]> Fixes: cf41a8f ("drm/i915: Finally remove obj->mm.lock.") Cc: Thomas Hellström <[email protected]> Cc: Daniel Vetter <[email protected]> Cc: <[email protected]> # v5.13+ Reviewed-by: Thomas Hellström <[email protected]> Reviewed-by: Niranjana Vishwanathapura <[email protected]> Link: https://patchwork.freedesktop.org/patch/msgid/[email protected] (cherry picked from commit 239f3c2) Signed-off-by: Jani Nikula <[email protected]>
1 parent ffac30b commit 0c94777

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

drivers/gpu/drm/i915/gem/i915_gem_shrinker.c

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,7 @@ i915_gem_shrink(struct i915_gem_ww_ctx *ww,
118118
intel_wakeref_t wakeref = 0;
119119
unsigned long count = 0;
120120
unsigned long scanned = 0;
121-
int err;
121+
int err = 0;
122122

123123
/* CHV + VTD workaround use stop_machine(); need to trylock vm->mutex */
124124
bool trylock_vm = !ww && intel_vm_no_concurrent_access_wa(i915);
@@ -242,12 +242,15 @@ i915_gem_shrink(struct i915_gem_ww_ctx *ww,
242242
list_splice_tail(&still_in_list, phase->list);
243243
spin_unlock_irqrestore(&i915->mm.obj_lock, flags);
244244
if (err)
245-
return err;
245+
break;
246246
}
247247

248248
if (shrink & I915_SHRINK_BOUND)
249249
intel_runtime_pm_put(&i915->runtime_pm, wakeref);
250250

251+
if (err)
252+
return err;
253+
251254
if (nr_scanned)
252255
*nr_scanned += scanned;
253256
return count;

0 commit comments

Comments
 (0)