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] drm/i915: Remove spurious DRM_ERROR for cancelled interrupts
Date: Fri, 2 Feb 2018 18:03:36 +0200 [thread overview]
Message-ID: <20180202160336.GC5453@intel.com> (raw)
In-Reply-To: <20180202153448.23908-1-chris@chris-wilson.co.uk>
On Fri, Feb 02, 2018 at 03:34:48PM +0000, Chris Wilson wrote:
> As we ourselves cancel interrupts during reset by clearing the GTIIR, it
> is possible for the master IIR to indicate a pending IRQ for which we
> have already cleared from the GTIIR. In this case, the DRM_ERROR are
> intended and should not be flagged as an error.
I guess an alternative would be to not clear IIR and use
sychronize_irq() instead as needed. But I suppose that doesn't
really provide any real benefits.
One concern is that we will now claim that all interrupts are handled,
and thus couldn't detect spurious interrupts. But one might hope that
MSI and whanot has made those a thing of the past.
I never checked what the kernel's threshold was for disabling the
interrupt line on spurious interrupts. I have occasionally thought about
it though as I too have realized that the IIR clearing could result in
the interrupt handler having nothing to do.
So yeah, not quite sure which is best, always claiming IRQ_HANDLED or
only when we had some IIR bits to clear. Maybe just return IRQ_HANDLED
always for all MSI capable platforms?
Ramblings aside, I think this should be safe enough:
Reviewed-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
>
> Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
> Cc: Joonas Lahtinen <joonas.lahtinen@linux.intel.com>
> Cc: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
> Cc: Ville Syrjälä <ville.syrjala@linux.intel.com>
> Cc: Imre Deak <imre.deak@intel.com>
> ---
> drivers/gpu/drm/i915/i915_irq.c | 35 +++++++++--------------------------
> 1 file changed, 9 insertions(+), 26 deletions(-)
>
> diff --git a/drivers/gpu/drm/i915/i915_irq.c b/drivers/gpu/drm/i915/i915_irq.c
> index 252feff2892d..b886bd459acc 100644
> --- a/drivers/gpu/drm/i915/i915_irq.c
> +++ b/drivers/gpu/drm/i915/i915_irq.c
> @@ -1413,37 +1413,25 @@ gen8_cs_irq_handler(struct intel_engine_cs *engine, u32 iir, int test_shift)
> tasklet_hi_schedule(&execlists->tasklet);
> }
>
> -static irqreturn_t gen8_gt_irq_ack(struct drm_i915_private *dev_priv,
> - u32 master_ctl,
> - u32 gt_iir[4])
> +static void gen8_gt_irq_ack(struct drm_i915_private *dev_priv,
> + u32 master_ctl, u32 gt_iir[4])
> {
> - irqreturn_t ret = IRQ_NONE;
> -
> if (master_ctl & (GEN8_GT_RCS_IRQ | GEN8_GT_BCS_IRQ)) {
> gt_iir[0] = I915_READ_FW(GEN8_GT_IIR(0));
> - if (gt_iir[0]) {
> + if (gt_iir[0])
> I915_WRITE_FW(GEN8_GT_IIR(0), gt_iir[0]);
> - ret = IRQ_HANDLED;
> - } else
> - DRM_ERROR("The master control interrupt lied (GT0)!\n");
> }
>
> if (master_ctl & (GEN8_GT_VCS1_IRQ | GEN8_GT_VCS2_IRQ)) {
> gt_iir[1] = I915_READ_FW(GEN8_GT_IIR(1));
> - if (gt_iir[1]) {
> + if (gt_iir[1])
> I915_WRITE_FW(GEN8_GT_IIR(1), gt_iir[1]);
> - ret = IRQ_HANDLED;
> - } else
> - DRM_ERROR("The master control interrupt lied (GT1)!\n");
> }
>
> if (master_ctl & GEN8_GT_VECS_IRQ) {
> gt_iir[3] = I915_READ_FW(GEN8_GT_IIR(3));
> - if (gt_iir[3]) {
> + if (gt_iir[3])
> I915_WRITE_FW(GEN8_GT_IIR(3), gt_iir[3]);
> - ret = IRQ_HANDLED;
> - } else
> - DRM_ERROR("The master control interrupt lied (GT3)!\n");
> }
>
> if (master_ctl & (GEN8_GT_PM_IRQ | GEN8_GT_GUC_IRQ)) {
> @@ -1453,12 +1441,8 @@ static irqreturn_t gen8_gt_irq_ack(struct drm_i915_private *dev_priv,
> I915_WRITE_FW(GEN8_GT_IIR(2),
> gt_iir[2] & (dev_priv->pm_rps_events |
> dev_priv->pm_guc_events));
> - ret = IRQ_HANDLED;
> - } else
> - DRM_ERROR("The master control interrupt lied (PM)!\n");
> + }
> }
> -
> - return ret;
> }
>
> static void gen8_gt_irq_handler(struct drm_i915_private *dev_priv,
> @@ -2695,7 +2679,6 @@ static irqreturn_t gen8_irq_handler(int irq, void *arg)
> struct drm_i915_private *dev_priv = to_i915(dev);
> u32 master_ctl;
> u32 gt_iir[4] = {};
> - irqreturn_t ret;
>
> if (!intel_irqs_enabled(dev_priv))
> return IRQ_NONE;
> @@ -2711,16 +2694,16 @@ static irqreturn_t gen8_irq_handler(int irq, void *arg)
> disable_rpm_wakeref_asserts(dev_priv);
>
> /* Find, clear, then process each source of interrupt */
> - ret = gen8_gt_irq_ack(dev_priv, master_ctl, gt_iir);
> + gen8_gt_irq_ack(dev_priv, master_ctl, gt_iir);
> gen8_gt_irq_handler(dev_priv, gt_iir);
> - ret |= gen8_de_irq_handler(dev_priv, master_ctl);
> + gen8_de_irq_handler(dev_priv, master_ctl);
>
> I915_WRITE_FW(GEN8_MASTER_IRQ, GEN8_MASTER_IRQ_CONTROL);
> POSTING_READ_FW(GEN8_MASTER_IRQ);
>
> enable_rpm_wakeref_asserts(dev_priv);
>
> - return ret;
> + return IRQ_HANDLED;
> }
>
> struct wedge_me {
> --
> 2.15.1
--
Ville Syrjälä
Intel OTC
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
next prev parent reply other threads:[~2018-02-02 16:03 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-02-02 15:34 [PATCH] drm/i915: Remove spurious DRM_ERROR for cancelled interrupts Chris Wilson
2018-02-02 16:03 ` Ville Syrjälä [this message]
2018-02-02 17:31 ` Chris Wilson
2018-02-02 17:44 ` Ville Syrjälä
2018-02-02 20:34 ` Chris Wilson
2018-02-02 16:52 ` ✓ Fi.CI.BAT: success for " Patchwork
2018-02-02 20:28 ` ✗ Fi.CI.IGT: warning " 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=20180202160336.GC5453@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 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.