All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Ville Syrjälä" <ville.syrjala@linux.intel.com>
To: Mika Kuoppala <mika.kuoppala@linux.intel.com>
Cc: intel-gfx@lists.freedesktop.org
Subject: Re: [PATCH] drm/i915: dont call irq_put when irq test is on
Date: Thu, 12 Dec 2013 14:56:41 +0200	[thread overview]
Message-ID: <20131212125640.GZ10036@intel.com> (raw)
In-Reply-To: <1386614842-27821-1-git-send-email-mika.kuoppala@intel.com>

On Mon, Dec 09, 2013 at 08:47:22PM +0200, Mika Kuoppala wrote:
> If test is running, irq_get was not called so we should
> gain balance by not doing irq_put
> 
> v2: use local variable so it can't change during test (Chris)
> 
> Signed-off-by: Mika Kuoppala <mika.kuoppala@intel.com>
> ---
>  drivers/gpu/drm/i915/i915_gem.c |    7 ++++---
>  1 file changed, 4 insertions(+), 3 deletions(-)
> 
> diff --git a/drivers/gpu/drm/i915/i915_gem.c b/drivers/gpu/drm/i915/i915_gem.c
> index 92149bc..ab8fd3d 100644
> --- a/drivers/gpu/drm/i915/i915_gem.c
> +++ b/drivers/gpu/drm/i915/i915_gem.c
> @@ -1015,6 +1015,7 @@ static int __wait_seqno(struct intel_ring_buffer *ring, u32 seqno,
>  			struct drm_i915_file_private *file_priv)
>  {
>  	drm_i915_private_t *dev_priv = ring->dev->dev_private;
> +	const bool irq_test_in_progress = dev_priv->gpu_error.test_irq_rings & intel_ring_flag(ring);

Should this use ACCESS_ONCE() to make sure the value doesn't get
reloaded from the source later?

>  	struct timespec before, now;
>  	DEFINE_WAIT(wait);
>  	long timeout_jiffies;
> @@ -1035,8 +1036,7 @@ static int __wait_seqno(struct intel_ring_buffer *ring, u32 seqno,
>  					 msecs_to_jiffies(100));
>  	}
>  
> -	if (!(dev_priv->gpu_error.test_irq_rings & intel_ring_flag(ring)) &&
> -	    WARN_ON(!ring->irq_get(ring)))
> +	if (!irq_test_in_progress && WARN_ON(!ring->irq_get(ring)))
>  		return -ENODEV;
>  
>  	/* Record current time in case interrupted by signal, or wedged */
> @@ -1095,7 +1095,8 @@ static int __wait_seqno(struct intel_ring_buffer *ring, u32 seqno,
>  	getrawmonotonic(&now);
>  	trace_i915_gem_request_wait_end(ring, seqno);
>  
> -	ring->irq_put(ring);
> +	if (!irq_test_in_progress)
> +		ring->irq_put(ring);
>  
>  	finish_wait(&ring->irq_queue, &wait);
>  
> -- 
> 1.7.9.5
> 
> _______________________________________________
> Intel-gfx mailing list
> Intel-gfx@lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/intel-gfx

-- 
Ville Syrjälä
Intel OTC

  reply	other threads:[~2013-12-12 12:56 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-12-09 18:47 [PATCH] drm/i915: dont call irq_put when irq test is on Mika Kuoppala
2013-12-12 12:56 ` Ville Syrjälä [this message]
2013-12-12 15:54   ` Mika Kuoppala
2013-12-12 16:06     ` Ville Syrjälä
2013-12-12 16:46       ` Daniel Vetter

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=20131212125640.GZ10036@intel.com \
    --to=ville.syrjala@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.