All of lore.kernel.org
 help / color / mirror / Atom feed
From: Mika Kuoppala <mika.kuoppala@linux.intel.com>
To: Chris Wilson <chris@chris-wilson.co.uk>, intel-gfx@lists.freedesktop.org
Subject: Re: [PATCH 1/2] Revert "drm/i915: Avoid waking the engines just to check if they are idle"
Date: Thu, 28 Feb 2019 11:01:52 +0200	[thread overview]
Message-ID: <87mumguvzz.fsf@gaia.fi.intel.com> (raw)
In-Reply-To: <20190227204654.14907-1-chris@chris-wilson.co.uk>

Chris Wilson <chris@chris-wilson.co.uk> writes:

> This reverts commit 0b702dca26580e3bbfbbaf22dfc29280b6263414.
>
> CI reports that this is not as reliable as it first appears, with
> failures starting to sporadically occur in selftests.
>
> Fixes: 0b702dca2658 ("drm/i915: Avoid waking the engines just to check if they are idle")
> Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
> Cc: Mika Kuoppala <mika.kuoppala@intel.com>
> Cc: Jani Nikula <jani.nikula@linux.intel.com>
> Cc: Joonas Lahtinen <joonas.lahtinen@linux.intel.com>

Reviewed-by: Mika Kuoppala <mika.kuoppala@linux.intel.com>

> ---
>  drivers/gpu/drm/i915/intel_engine_cs.c | 17 ++++++-----------
>  1 file changed, 6 insertions(+), 11 deletions(-)
>
> diff --git a/drivers/gpu/drm/i915/intel_engine_cs.c b/drivers/gpu/drm/i915/intel_engine_cs.c
> index 4f244019560d..b7b626195eda 100644
> --- a/drivers/gpu/drm/i915/intel_engine_cs.c
> +++ b/drivers/gpu/drm/i915/intel_engine_cs.c
> @@ -968,7 +968,6 @@ static bool ring_is_idle(struct intel_engine_cs *engine)
>  {
>  	struct drm_i915_private *dev_priv = engine->i915;
>  	intel_wakeref_t wakeref;
> -	unsigned long flags;
>  	bool idle = true;
>  
>  	if (I915_SELFTEST_ONLY(!engine->mmio_base))
> @@ -979,19 +978,15 @@ static bool ring_is_idle(struct intel_engine_cs *engine)
>  	if (!wakeref)
>  		return true;
>  
> -	spin_lock_irqsave(&dev_priv->uncore.lock, flags);
> +	/* First check that no commands are left in the ring */
> +	if ((I915_READ_HEAD(engine) & HEAD_ADDR) !=
> +	    (I915_READ_TAIL(engine) & TAIL_ADDR))
> +		idle = false;
>  
> -	/*
> -	 * Check that no commands are left in the ring.
> -	 *
> -	 * If the engine is not awake, both reads return 0 as we do so without
> -	 * forcewake.
> -	 */
> -	if ((I915_READ_FW(RING_HEAD(engine->mmio_base)) & HEAD_ADDR) !=
> -	    (I915_READ_FW(RING_TAIL(engine->mmio_base)) & TAIL_ADDR))
> +	/* No bit for gen2, so assume the CS parser is idle */
> +	if (INTEL_GEN(dev_priv) > 2 && !(I915_READ_MODE(engine) & MODE_IDLE))
>  		idle = false;
>  
> -	spin_unlock_irqrestore(&dev_priv->uncore.lock, flags);
>  	intel_runtime_pm_put(dev_priv, wakeref);
>  
>  	return idle;
> -- 
> 2.20.1
>
> _______________________________________________
> Intel-gfx mailing list
> Intel-gfx@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/intel-gfx
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

      parent reply	other threads:[~2019-02-28  9:02 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-02-27 20:46 [PATCH 1/2] Revert "drm/i915: Avoid waking the engines just to check if they are idle" Chris Wilson
2019-02-27 20:46 ` [PATCH 2/2] drm/i915: Report engines are idle if already parked Chris Wilson
2019-02-27 21:41   ` [PATCH] " Chris Wilson
2019-02-28  9:08     ` Mika Kuoppala
2019-02-28  9:17       ` Chris Wilson
2019-02-27 21:21 ` ✗ Fi.CI.CHECKPATCH: warning for series starting with [1/2] Revert "drm/i915: Avoid waking the engines just to check if they are idle" Patchwork
2019-02-27 21:49 ` ✓ Fi.CI.BAT: success " Patchwork
2019-02-27 21:52 ` ✗ Fi.CI.CHECKPATCH: warning for series starting with [1/2] Revert "drm/i915: Avoid waking the engines just to check if they are idle" (rev2) Patchwork
2019-02-27 22:21 ` ✓ Fi.CI.BAT: success " Patchwork
2019-02-27 23:38 ` ✓ Fi.CI.IGT: " Patchwork
2019-02-28  9:01 ` Mika Kuoppala [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=87mumguvzz.fsf@gaia.fi.intel.com \
    --to=mika.kuoppala@linux.intel.com \
    --cc=chris@chris-wilson.co.uk \
    --cc=intel-gfx@lists.freedesktop.org \
    /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.