[Intel-gfx] [PATCH] drm/i915: Get runtime pm ref on i915_drop_caches_set
Joonas Lahtinen
joonas.lahtinen at linux.intel.com
Tue Dec 15 03:46:11 PST 2015
On ti, 2015-12-15 at 13:35 +0200, Mika Kuoppala wrote:
> Some igt tests wants to drop caches by writing to this debugfs
> entry. The call to shrinker may ensure and it wants to update
> the fence registers, so hardware access happens. This access
> can happen in a spot where the block containing these registers
> might bepowered down.
>
> To avoid getting unclaimed register access trace noise due
> to this, take a runtime pm reference during i915_drop_caches set.
>
> v2: pm_ref and mutex lock ordering (Chris)
>
> Cc: Chris Wilson <chris at chris-wilson.co.uk>
> Cc: Joonas Lahtinen <joonas.lahtinen at linux.intel.com>
Reviewed-by: Joonas Lahtinen <joonas.lahtinen at linux.intel.com>
> Signed-off-by: Mika Kuoppala <mika.kuoppala at intel.com>
> ---
> drivers/gpu/drm/i915/i915_debugfs.c | 8 ++++++--
> 1 file changed, 6 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/gpu/drm/i915/i915_debugfs.c
> b/drivers/gpu/drm/i915/i915_debugfs.c
> index 24318b7..d96709a 100644
> --- a/drivers/gpu/drm/i915/i915_debugfs.c
> +++ b/drivers/gpu/drm/i915/i915_debugfs.c
> @@ -4833,11 +4833,13 @@ i915_drop_caches_set(void *data, u64 val)
>
> DRM_DEBUG("Dropping caches: 0x%08llx\n", val);
>
> + intel_runtime_pm_get(dev_priv);
> +
> /* No need to check and wait for gpu resets, only libdrm
> auto-restarts
> * on ioctls on -EAGAIN. */
> ret = mutex_lock_interruptible(&dev->struct_mutex);
> if (ret)
> - return ret;
> + goto pm_put;
>
> if (val & DROP_ACTIVE) {
> ret = i915_gpu_idle(dev);
> @@ -4856,7 +4858,9 @@ i915_drop_caches_set(void *data, u64 val)
>
> unlock:
> mutex_unlock(&dev->struct_mutex);
> -
> +pm_put:
> + intel_runtime_pm_put(dev_priv);
> +
> return ret;
> }
>
--
Joonas Lahtinen
Open Source Technology Center
Intel Corporation
More information about the Intel-gfx
mailing list