From: Mika Kuoppala <mika.kuoppala@linux.intel.com>
To: Chris Wilson <chris@chris-wilson.co.uk>, intel-gfx@lists.freedesktop.org
Subject: Re: [PATCH v2] drm/i915: Wait for gen3 reset status to be asserted
Date: Thu, 08 Feb 2018 13:43:50 +0200 [thread overview]
Message-ID: <87eflvu2o9.fsf@gaia.fi.intel.com> (raw)
In-Reply-To: <20180207222824.29864-1-chris@chris-wilson.co.uk>
Chris Wilson <chris@chris-wilson.co.uk> writes:
> 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.)
>
> v2: Rename i915_reset_completed() probe to not cause as much confusion.
>
> 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 | 15 +++++++++++----
> 1 file changed, 11 insertions(+), 4 deletions(-)
>
> diff --git a/drivers/gpu/drm/i915/intel_uncore.c b/drivers/gpu/drm/i915/intel_uncore.c
> index 0fd59dd6bbb5..e09981a3113c 100644
> --- a/drivers/gpu/drm/i915/intel_uncore.c
> +++ b/drivers/gpu/drm/i915/intel_uncore.c
> @@ -1550,24 +1550,31 @@ static void i915_stop_engines(struct drm_i915_private *dev_priv,
> gen3_stop_engine(engine);
> }
>
> -static bool i915_reset_complete(struct pci_dev *pdev)
> +static bool i915_in_reset(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;
> }
>
> 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 */
> + /* Assert reset for at least 20 usec, and wait for acknowledgement. */
> pci_write_config_byte(pdev, I915_GDRST, GRDOM_RESET_ENABLE);
> usleep_range(50, 200);
> + err = wait_for(i915_in_reset(pdev), 500);
> +
> + /* Clear the reset request. */
> pci_write_config_byte(pdev, I915_GDRST, 0);
> + usleep_range(50, 200);
> + if (!err)
> + err = wait_for(!i915_in_reset(pdev), 500);
>
Regardless of if this helps or not with pnv, it makes the
both phases clear.
Any thoughts of starting to log the reset attempts
with timeout, even if the subsequent reset succeeds?
Patch is,
Reviewed-by: Mika Kuoppala <mika.kuoppala@linux.intel.com>
> - return wait_for(i915_reset_complete(pdev), 500);
> + return err;
> }
>
> static bool g4x_reset_complete(struct pci_dev *pdev)
> --
> 2.16.1
>
> _______________________________________________
> Intel-gfx mailing list
> Intel-gfx@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/intel-gfx
_______________________________________________
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-08 11:45 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ä
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 [this message]
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=87eflvu2o9.fsf@gaia.fi.intel.com \
--to=mika.kuoppala@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.