From: "Ville Syrjälä" <ville.syrjala@linux.intel.com>
To: Chris Wilson <chris@chris-wilson.co.uk>
Cc: intel-gfx@lists.freedesktop.org
Subject: Re: [PATCH v2] drm/i915: Apply missed interrupt after reset w/a to all ringbuffer gen
Date: Thu, 13 Dec 2018 13:59:28 +0200 [thread overview]
Message-ID: <20181213115928.GI9144@intel.com> (raw)
In-Reply-To: <20181213110105.19076-1-chris@chris-wilson.co.uk>
On Thu, Dec 13, 2018 at 11:01:05AM +0000, Chris Wilson wrote:
> Having completed a test run of gem_eio across all machines in CI we also
> observe the phenomenon (of lost interrupts after resetting the GPU) on
> gen3 machines as well as the previously sighted gen6/gen7. Let's apply
> the same HWSTAM workaround that was effective for gen6+ for all, as
> although we haven't seen the same failure on gen4/5 it seems prudent to
> keep the code the same.
>
> As a consequence we can remove the extra setting of HWSTAM and apply the
> register from a single site.
>
> v2: Delazy and move the HWSTAM into its own function
>
> References: https://bugs.freedesktop.org/show_bug.cgi?id=108735
> Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
> Cc: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
> ---
> drivers/gpu/drm/i915/i915_irq.c | 9 ------
> drivers/gpu/drm/i915/intel_ringbuffer.c | 41 ++++++++++++++++---------
> 2 files changed, 27 insertions(+), 23 deletions(-)
>
> diff --git a/drivers/gpu/drm/i915/i915_irq.c b/drivers/gpu/drm/i915/i915_irq.c
> index e2dac9b5f4ce..0c7fc9890891 100644
> --- a/drivers/gpu/drm/i915/i915_irq.c
> +++ b/drivers/gpu/drm/i915/i915_irq.c
> @@ -3586,9 +3586,6 @@ static void ironlake_irq_reset(struct drm_device *dev)
> {
> struct drm_i915_private *dev_priv = to_i915(dev);
>
> - if (IS_GEN(dev_priv, 5))
> - I915_WRITE(HWSTAM, 0xffffffff);
> -
> GEN3_IRQ_RESET(DE);
> if (IS_GEN(dev_priv, 7))
> I915_WRITE(GEN7_ERR_INT, 0xffffffff);
> @@ -4368,8 +4365,6 @@ static void i8xx_irq_reset(struct drm_device *dev)
>
> i9xx_pipestat_irq_reset(dev_priv);
>
> - I915_WRITE16(HWSTAM, 0xffff);
> -
> GEN2_IRQ_RESET();
> }
>
> @@ -4537,8 +4532,6 @@ static void i915_irq_reset(struct drm_device *dev)
>
> i9xx_pipestat_irq_reset(dev_priv);
>
> - I915_WRITE(HWSTAM, 0xffffffff);
> -
> GEN3_IRQ_RESET();
> }
>
> @@ -4648,8 +4641,6 @@ static void i965_irq_reset(struct drm_device *dev)
>
> i9xx_pipestat_irq_reset(dev_priv);
>
> - I915_WRITE(HWSTAM, 0xffffffff);
> -
> GEN3_IRQ_RESET();
> }
So we're not worried about enabling interrupts and having
something unmasked in HWSTAM by accident before we have the
status page set up?
>
> diff --git a/drivers/gpu/drm/i915/intel_ringbuffer.c b/drivers/gpu/drm/i915/intel_ringbuffer.c
> index fdeca2b877c9..10e7b7a6ba88 100644
> --- a/drivers/gpu/drm/i915/intel_ringbuffer.c
> +++ b/drivers/gpu/drm/i915/intel_ringbuffer.c
> @@ -393,12 +393,38 @@ static void ring_setup_phys_status_page(struct intel_engine_cs *engine)
> I915_WRITE(HWS_PGA, addr);
> }
>
> +static void set_hwstam_mask(struct intel_engine_cs *engine)
> +{
> + struct drm_i915_private *dev_priv = engine->i915;
> + i915_reg_t hwstam = RING_HWSTAM(engine->mmio_base);
> + u32 mask = ~0u;
> +
> + /*
> + * Keep the render interrupt unmasked as this papers over
> + * lost interrupts following a reset.
> + */
> + if (engine->id == RCS) {
> + if (INTEL_GEN(dev_priv) >= 6)
> + mask &= ~BIT(0);
> + else
> + mask &= ~I915_USER_INTERRUPT;
> + }
> +
> + if (INTEL_GEN(dev_priv) >= 3)
> + I915_WRITE(hwstam, mask);
> + else
> + I915_WRITE16(hwstam, mask);
> +}
> +
> static void intel_ring_setup_status_page(struct intel_engine_cs *engine)
> {
> struct drm_i915_private *dev_priv = engine->i915;
> i915_reg_t mmio;
>
> - /* The ring status page addresses are no longer next to the rest of
> + set_hwstam_mask(engine);
> +
> + /*
> + * The ring status page addresses are no longer next to the rest of
> * the ring registers as of gen7.
> */
> if (IS_GEN(dev_priv, 7)) {
> @@ -428,19 +454,6 @@ static void intel_ring_setup_status_page(struct intel_engine_cs *engine)
> mmio = RING_HWS_PGA(engine->mmio_base);
> }
>
> - if (INTEL_GEN(dev_priv) >= 6) {
> - u32 mask = ~0u;
> -
> - /*
> - * Keep the render interrupt unmasked as this papers over
> - * lost interrupts following a reset.
> - */
> - if (engine->id == RCS)
> - mask &= ~BIT(0);
> -
> - I915_WRITE(RING_HWSTAM(engine->mmio_base), mask);
> - }
> -
> I915_WRITE(mmio, engine->status_page.ggtt_offset);
> POSTING_READ(mmio);
>
> --
> 2.20.0
>
> _______________________________________________
> Intel-gfx mailing list
> Intel-gfx@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/intel-gfx
--
Ville Syrjälä
Intel
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
next prev parent reply other threads:[~2018-12-13 11:59 UTC|newest]
Thread overview: 30+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-12-13 8:53 [PATCH] drm/i915: Apply missed interrupt after reset w/a to all ringbuffer gen Chris Wilson
2018-12-13 9:26 ` ✓ Fi.CI.BAT: success for " Patchwork
2018-12-13 9:27 ` [PATCH] " Tvrtko Ursulin
2018-12-13 11:01 ` [PATCH v2] " Chris Wilson
2018-12-13 11:59 ` Ville Syrjälä [this message]
2018-12-13 12:07 ` Chris Wilson
2018-12-13 12:17 ` Chris Wilson
2018-12-13 12:29 ` Ville Syrjälä
2018-12-13 12:34 ` Chris Wilson
2018-12-13 12:45 ` Ville Syrjälä
2018-12-13 15:06 ` Chris Wilson
2018-12-13 11:17 ` ✓ Fi.CI.IGT: success for " Patchwork
2018-12-13 11:43 ` ✗ Fi.CI.BAT: failure for drm/i915: Apply missed interrupt after reset w/a to all ringbuffer gen (rev2) Patchwork
2018-12-13 12:20 ` [PATCH v3] drm/i915: Apply missed interrupt after reset w/a to all ringbuffer gen Chris Wilson
2018-12-13 12:39 ` [PATCH v4] " Chris Wilson
2018-12-13 13:05 ` [PATCH v5] " Chris Wilson
2018-12-13 13:26 ` ✓ Fi.CI.BAT: success for drm/i915: Apply missed interrupt after reset w/a to all ringbuffer gen (rev5) Patchwork
2018-12-13 14:21 ` ✓ Fi.CI.BAT: success for drm/i915: Apply missed interrupt after reset w/a to all ringbuffer gen (rev6) Patchwork
2018-12-13 18:24 ` ✓ Fi.CI.IGT: " Patchwork
2018-12-17 15:20 ` [PATCH v6] drm/i915: Apply missed interrupt after reset w/a to all ringbuffer gen Chris Wilson
2018-12-17 18:02 ` Ville Syrjälä
2018-12-17 18:07 ` Chris Wilson
2018-12-17 18:13 ` Ville Syrjälä
2018-12-17 15:43 ` ✓ Fi.CI.BAT: success for drm/i915: Apply missed interrupt after reset w/a to all ringbuffer gen (rev7) Patchwork
2018-12-17 18:31 ` ✓ Fi.CI.IGT: " Patchwork
2018-12-18 10:27 ` [PATCH v7] drm/i915: Apply missed interrupt after reset w/a to all ringbuffer gen Chris Wilson
2018-12-18 14:15 ` Ville Syrjälä
2018-12-18 14:24 ` Chris Wilson
2018-12-18 10:54 ` ✓ Fi.CI.BAT: success for drm/i915: Apply missed interrupt after reset w/a to all ringbuffer gen (rev8) Patchwork
2018-12-18 12:40 ` ✓ Fi.CI.IGT: " Patchwork
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=20181213115928.GI9144@intel.com \
--to=ville.syrjala@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox