All of lore.kernel.org
 help / color / mirror / Atom feed
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 2/2] drm/i915: Wait for gen3 reset status to be asserted
Date: Wed, 7 Feb 2018 16:44:39 +0200	[thread overview]
Message-ID: <20180207144439.GX5453@intel.com> (raw)
In-Reply-To: <20180207144143.GW5453@intel.com>

On Wed, Feb 07, 2018 at 04:41:43PM +0200, Ville Syrjälä wrote:
> On Wed, Feb 07, 2018 at 10:08:45AM +0000, Chris Wilson wrote:
> > After we assert the reset request (and wait for 20us), when the device
> > has been fully reset it asserts the reset-status bit. Before we stop
> > requesting the reset and allow the device to return to normal, we should
> > wait for the reset to be completed. (Similar to how we wait for the
> > device to return to normal after deasserting the reset request.)
> > 
> > Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
> > Cc: Ville Syrjälä <ville.syrjala@linux.intel.com>
> > ---
> >  drivers/gpu/drm/i915/intel_uncore.c | 12 ++++++++++--
> >  1 file changed, 10 insertions(+), 2 deletions(-)
> > 
> > diff --git a/drivers/gpu/drm/i915/intel_uncore.c b/drivers/gpu/drm/i915/intel_uncore.c
> > index 612aad205b59..dd86428774da 100644
> > --- a/drivers/gpu/drm/i915/intel_uncore.c
> > +++ b/drivers/gpu/drm/i915/intel_uncore.c
> > @@ -1555,19 +1555,27 @@ static bool i915_reset_complete(struct pci_dev *pdev)
> >  	u8 gdrst;
> >  
> >  	pci_read_config_byte(pdev, I915_GDRST, &gdrst);
> > -	return (gdrst & GRDOM_RESET_STATUS) == 0;
> > +	return gdrst & GRDOM_RESET_STATUS;

Doh. Failed to notice this change. The function name is perhaps a bit
confusing now since it doesn't match the meaning of the g4x version.
Maybe rename this guy? i915_gpu_in_reset() or something?

> >  }
> >  
> >  static int i915_do_reset(struct drm_i915_private *dev_priv, unsigned engine_mask)
> >  {
> >  	struct pci_dev *pdev = dev_priv->drm.pdev;
> > +	int err;
> >  
> >  	/* assert reset for at least 20 usec */
> >  	pci_write_config_byte(pdev, I915_GDRST, GRDOM_RESET_ENABLE);
> >  	usleep_range(50, 200);
> > +
> > +	err = wait_for(i915_reset_complete(pdev), 500);
> 
> The hardware should indicate that it's in reset as long as we keep the
> reset asserted. So this looks like an obfuscated usleep(500) to me.
> Did you mean !reset_complete?
> 
> > +
> >  	pci_write_config_byte(pdev, I915_GDRST, 0);
> > +	usleep_range(50, 200);
> > +
> > +	if (!err)
> > +		err = wait_for(!i915_reset_complete(pdev), 500);
> >  
> > -	return wait_for(i915_reset_complete(pdev), 500);
> > +	return err;
> >  }
> >  
> >  static bool g4x_reset_complete(struct pci_dev *pdev)
> > -- 
> > 2.16.1
> 
> -- 
> Ville Syrjälä
> Intel OTC

-- 
Ville Syrjälä
Intel OTC
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

  reply	other threads:[~2018-02-07 14:44 UTC|newest]

Thread overview: 24+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-02-07 10:08 gen3 reset paranoia Chris Wilson
2018-02-07 10:08 ` [PATCH 1/2] drm/i915: Be paranoid and post the writes to stop the rings Chris Wilson
2018-02-07 14:27   ` Mika Kuoppala
2018-02-08  7:28     ` [PATCH v2] " Chris Wilson
2018-02-08 11:39       ` Mika Kuoppala
2018-02-07 10:08 ` [PATCH 2/2] drm/i915: Wait for gen3 reset status to be asserted Chris Wilson
2018-02-07 14:41   ` Ville Syrjälä
2018-02-07 14:44     ` Ville Syrjälä [this message]
2018-02-07 21:12       ` Chris Wilson
2018-02-07 22:27       ` Chris Wilson
2018-02-07 21:11   ` [PATCH] " Chris Wilson
2018-02-07 22:28   ` [PATCH v2] " Chris Wilson
2018-02-08 11:43     ` Mika Kuoppala
2018-02-08 11:55       ` Chris Wilson
2018-02-08 12:34         ` Mika Kuoppala
2018-02-08 13:45           ` Chris Wilson
2018-02-08 13:46       ` Chris Wilson
2018-02-07 10:38 ` ✓ Fi.CI.BAT: success for series starting with [1/2] drm/i915: Be paranoid and post the writes to stop the rings Patchwork
2018-02-07 12:50 ` ✗ Fi.CI.IGT: failure " Patchwork
2018-02-07 22:24 ` ✗ Fi.CI.BAT: failure for series starting with [1/2] drm/i915: Be paranoid and post the writes to stop the rings (rev2) Patchwork
2018-02-07 23:46 ` ✓ Fi.CI.BAT: success for series starting with [1/2] drm/i915: Be paranoid and post the writes to stop the rings (rev3) Patchwork
2018-02-08  6:30 ` ✓ Fi.CI.IGT: " Patchwork
2018-02-08  7:46 ` ✓ Fi.CI.BAT: success for series starting with [v2] drm/i915: Be paranoid and post the writes to stop the rings (rev4) Patchwork
2018-02-08 10:55 ` ✗ Fi.CI.IGT: failure " 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=20180207144439.GX5453@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.