From: Joonas Lahtinen <joonas.lahtinen@linux.intel.com>
To: Mika Kuoppala <mika.kuoppala@linux.intel.com>,
intel-gfx@lists.freedesktop.org
Subject: Re: [PATCH] drm/i915: Get runtime pm ref on i915_drop_caches_set
Date: Tue, 15 Dec 2015 13:46:11 +0200 [thread overview]
Message-ID: <1450179971.9206.3.camel@linux.intel.com> (raw)
In-Reply-To: <1450179356-22702-1-git-send-email-mika.kuoppala@intel.com>
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@chris-wilson.co.uk>
> Cc: Joonas Lahtinen <joonas.lahtinen@linux.intel.com>
Reviewed-by: Joonas Lahtinen <joonas.lahtinen@linux.intel.com>
> Signed-off-by: Mika Kuoppala <mika.kuoppala@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
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/intel-gfx
prev parent reply other threads:[~2015-12-15 11:46 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-12-14 17:14 [PATCH 1/6] drm/i915: Get runtime pm ref on i915_drop_caches_set Mika Kuoppala
2015-12-14 17:14 ` [PATCH 2/6] drm/i915: Get runtime pm ref when setting min/max freqs Mika Kuoppala
2015-12-14 17:14 ` [PATCH 3/6] drm/i915: Get runtime pm ref on i915_fbc_fc_set Mika Kuoppala
2015-12-14 17:14 ` [PATCH 4/6] drm/i915: Get runtime pm ref on i915_emon_status Mika Kuoppala
2015-12-14 17:14 ` [PATCH 5/6] drm/i915: Get runtime pm ref on i915_guc_load_status_info Mika Kuoppala
2015-12-14 17:14 ` [PATCH 6/6] drm/i915: Get runtime pm ref on i915_sseu_status Mika Kuoppala
2015-12-14 21:46 ` [PATCH 1/6] drm/i915: Get runtime pm ref on i915_drop_caches_set Chris Wilson
2015-12-15 11:36 ` Mika Kuoppala
2015-12-16 10:42 ` Daniel Vetter
2015-12-16 11:03 ` Imre Deak
2015-12-15 11:35 ` [PATCH] " Mika Kuoppala
2015-12-15 11:46 ` Joonas Lahtinen [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1450179971.9206.3.camel@linux.intel.com \
--to=joonas.lahtinen@linux.intel.com \
--cc=intel-gfx@lists.freedesktop.org \
--cc=mika.kuoppala@linux.intel.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.