Skip to content

Commit

Permalink
drm/i915: Hold rpm wakeref for debugfs/i915_drop_caches_set
Browse files Browse the repository at this point in the history
Since we peek into HW state and poke around, it behoves us to acquire a
runtime pm wakeref beforehand.

References: https://bugs.freedesktop.org/show_bug.cgi?id=108343
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=108364
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Reviewed-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20181015115856.18590-1-chris@chris-wilson.co.uk
  • Loading branch information
Chris Wilson committed Oct 15, 2018
1 parent 668b6c1 commit 9d3eb2c
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions drivers/gpu/drm/i915/i915_debugfs.c
Original file line number Diff line number Diff line change
Expand Up @@ -4187,6 +4187,7 @@ i915_drop_caches_set(void *data, u64 val)

DRM_DEBUG("Dropping caches: 0x%08llx [0x%08llx]\n",
val, val & DROP_ALL);
intel_runtime_pm_get(i915);

if (val & DROP_RESET_ACTIVE && !intel_engines_are_idle(i915))
i915_gem_set_wedged(i915);
Expand All @@ -4204,11 +4205,8 @@ i915_drop_caches_set(void *data, u64 val)
I915_WAIT_LOCKED,
MAX_SCHEDULE_TIMEOUT);

if (ret == 0 && val & DROP_RESET_SEQNO) {
intel_runtime_pm_get(i915);
if (ret == 0 && val & DROP_RESET_SEQNO)
ret = i915_gem_set_global_seqno(&i915->drm, 1);
intel_runtime_pm_put(i915);
}

if (val & DROP_RETIRE)
i915_retire_requests(i915);
Expand Down Expand Up @@ -4246,6 +4244,8 @@ i915_drop_caches_set(void *data, u64 val)
if (val & DROP_FREED)
i915_gem_drain_freed_objects(i915);

intel_runtime_pm_put(i915);

return ret;
}

Expand Down

0 comments on commit 9d3eb2c

Please sign in to comment.