From mboxrd@z Thu Jan 1 00:00:00 1970 From: Ville =?iso-8859-1?Q?Syrj=E4l=E4?= Subject: Re: [PATCH] drm/i915: dont call irq_put when irq test is on Date: Thu, 12 Dec 2013 18:06:16 +0200 Message-ID: <20131212160616.GC10036@intel.com> References: <20131212125640.GZ10036@intel.com> <1386863682-5889-1-git-send-email-mika.kuoppala@intel.com> Mime-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Return-path: Received: from mga09.intel.com (mga09.intel.com [134.134.136.24]) by gabe.freedesktop.org (Postfix) with ESMTP id 74086FA670 for ; Thu, 12 Dec 2013 08:06:20 -0800 (PST) Content-Disposition: inline In-Reply-To: <1386863682-5889-1-git-send-email-mika.kuoppala@intel.com> List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: intel-gfx-bounces+gcfxdi-intel-gfx=m.gmane.org@lists.freedesktop.org Errors-To: intel-gfx-bounces+gcfxdi-intel-gfx=m.gmane.org@lists.freedesktop.org To: Mika Kuoppala Cc: intel-gfx@lists.freedesktop.org List-Id: intel-gfx@lists.freedesktop.org On Thu, Dec 12, 2013 at 05:54:42PM +0200, Mika Kuoppala wrote: > If test is running, irq_get was not called so we should gain > balance by not doing irq_put > = > "So the rule is: if you access unlocked values, you use ACCESS_ONCE(). > You don't say "but it can't matter". Because you simply don't know." > -- Linus > = > v2: use local variable so it can't change during test (Chris) > = > v3: update commit msg and use ACCESS_ONCE (Ville) > = > Signed-off-by: Mika Kuoppala Looks good. Reviewed-by: Ville Syrj=E4l=E4 > --- > drivers/gpu/drm/i915/i915_gem.c | 8 +++++--- > 1 file changed, 5 insertions(+), 3 deletions(-) > = > diff --git a/drivers/gpu/drm/i915/i915_gem.c b/drivers/gpu/drm/i915/i915_= gem.c > index 279387a..e34b48e 100644 > --- a/drivers/gpu/drm/i915/i915_gem.c > +++ b/drivers/gpu/drm/i915/i915_gem.c > @@ -1015,6 +1015,8 @@ static int __wait_seqno(struct intel_ring_buffer *r= ing, u32 seqno, > struct drm_i915_file_private *file_priv) > { > drm_i915_private_t *dev_priv =3D ring->dev->dev_private; > + const bool irq_test_in_progress =3D > + ACCESS_ONCE(dev_priv->gpu_error.test_irq_rings) & intel_ring_flag(ring= ); > struct timespec before, now; > DEFINE_WAIT(wait); > unsigned long timeout_expire; > @@ -1035,8 +1037,7 @@ static int __wait_seqno(struct intel_ring_buffer *r= ing, 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 */ > @@ -1093,7 +1094,8 @@ static int __wait_seqno(struct intel_ring_buffer *r= ing, 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=E4l=E4 Intel OTC