From: Gwan-gyeong Mun <gwan-gyeong.mun@intel.com>
To: Andi Shyti <andi.shyti@linux.intel.com>
Cc: "intel-gfx@lists.freedesktop.org"
<intel-gfx@lists.freedesktop.org>,
"chris@chris-wilson.co.uk" <chris@chris-wilson.co.uk>,
"stable@vger.kernel.org" <stable@vger.kernel.org>,
"dri-devel@lists.freedesktop.org"
<dri-devel@lists.freedesktop.org>,
Rodrigo Vivi <rodrigo.vivi@intel.com>
Subject: Re: [Intel-gfx] [PATCH] drm/i915/gt: Reset twice
Date: Fri, 23 Dec 2022 08:24:56 +0200 [thread overview]
Message-ID: <a731f1af-1565-6fc3-41bc-3ded983e6127@intel.com> (raw)
In-Reply-To: <Y6Rf4LvHlbeFy/iF@ashyti-mobl2.lan>
On 12/22/22 3:47 PM, Andi Shyti wrote:
> Hi GG,
>
>>>>>>>> drivers/gpu/drm/i915/gt/intel_reset.c | 34
>>>>>>>> ++++++++++++++++++++++-----
>>>>>>>> 1 file changed, 28 insertions(+), 6 deletions(-)
>>>>>>>>
>>>>>>>> diff --git a/drivers/gpu/drm/i915/gt/intel_reset.c
>>>>>>>> b/drivers/gpu/drm/i915/gt/intel_reset.c
>>>>>>>> index ffde89c5835a4..88dfc0c5316ff 100644
>>>>>>>> --- a/drivers/gpu/drm/i915/gt/intel_reset.c
>>>>>>>> +++ b/drivers/gpu/drm/i915/gt/intel_reset.c
>>>>>>>> @@ -268,6 +268,7 @@ static int ilk_do_reset(struct intel_gt *gt,
>>>>>>>> intel_engine_mask_t engine_mask,
>>>>>>>> static int gen6_hw_domain_reset(struct intel_gt *gt, u32
>>>>>>>> hw_domain_mask)
>>>>>>>> {
>>>>>>>> struct intel_uncore *uncore = gt->uncore;
>>>>>>>> + int loops = 2;
>>>>>>>> int err;
>>>>>>>> /*
>>>>>>>> @@ -275,18 +276,39 @@ static int gen6_hw_domain_reset(struct
>>>>>>>> intel_gt *gt, u32 hw_domain_mask)
>>>>>>>> * for fifo space for the write or forcewake the chip for
>>>>>>>> * the read
>>>>>>>> */
>>>>>>>> - intel_uncore_write_fw(uncore, GEN6_GDRST,
>>>>>>>> hw_domain_mask);
>>>>>>>> + do {
>>>>>>>> + intel_uncore_write_fw(uncore, GEN6_GDRST,
>>>>>>>> hw_domain_mask);
>>>>>>>> - /* Wait for the device to ack the reset requests */
>>>>>>>> - err = __intel_wait_for_register_fw(uncore,
>>>>>>>> - GEN6_GDRST,
>>>>>>>> hw_domain_mask, 0,
>>>>>>>> - 500, 0,
>>>>>>>> - NULL);
>>>>>>>> + /*
>>>>>>>> + * Wait for the device to ack the reset requests.
>>>>>>>> + *
>>>>>>>> + * On some platforms, e.g. Jasperlake, we see see
>>>>>>>> that the
>>>>>>>> + * engine register state is not cleared until
>>>>>>>> shortly after
>>>>>>>> + * GDRST reports completion, causing a failure as
>>>>>>>> we try
>>>>>>>> + * to immediately resume while the internal state
>>>>>>>> is still
>>>>>>>> + * in flux. If we immediately repeat the reset,
>>>>>>>> the second
>>>>>>>> + * reset appears to serialise with the first, and
>>>>>>>> since
>>>>>>>> + * it is a no-op, the registers should retain
>>>>>>>> their reset
>>>>>>>> + * value. However, there is still a concern that
>>>>>>>> upon
>>>>>>>> + * leaving the second reset, the internal engine
>>>>>>>> state
>>>>>>>> + * is still in flux and not ready for resuming.
>>>>>>>> + */
>>>>>>>> + err = __intel_wait_for_register_fw(uncore,
>>>>>>>> GEN6_GDRST,
>>>>>>>> +
>>>>>>>> hw_domain_mask, 0,
>>>>>>>> + 2000, 0,
>>>>>>>> + NULL);
>
>> Andi, fast_timeout_us is increased from 500 to 2000, and if it fails, it
>> tries to reset it once more. How was this value of 2000 calculated?
>
> No real reason, it's just an empiric choice to make the call a
> bit more robust and suffer less from delayed feedback.
>
>>>>>>>> + } while (err == 0 && --loops);
>>>>>>>> if (err)
>>>>>>>> GT_TRACE(gt,
>>>>>>>> "Wait for 0x%08x engines reset
>>>>>>>> failed\n",
>>>>>>>> hw_domain_mask);
>
>> Did GT_TRACE report an error in a situation where the problem was reported?
>
> I guess so, in Jasperlake.
>
>>>>>>>> + /*
>>>>>>>> + * As we have observed that the engine state is still
>>>>>>>> volatile
>>>>>>>> + * after GDRST is acked, impose a small delay to let
>>>>>>>> everything settle.
>>>>>>>> + */
>>>>>>>> + udelay(50);
>
>> udelay(50) affects all platforms that can call gen6_hw_domain_reset(), is
>> that intended?
>
> Yes, that's intended as apparently we need to give it a bit more
> time for the engines to recover from the reset. We are here in
> atomic context and we need udelay to wait atomically, thus
> udelay().
>
Hi Andi,
In scenarios/platforms where GSC Firmware is not used, reset through FLR
is not possible and this reset function is used.
Therefore if this problem cannot be avoided by other WAs and this method
is the only one, we might have to apply this patch as a temporal fix.
But we also ask the person who is in charge of this HW Platform
(Jasperlake or all of GEN11?)to analyze the problem and you need to sure
get proper WA guidance as a next step.
Reviewed-by: Gwan-gyeong Mun <gwan-gyeong.mun@intel.com>
Br,
G.G.
> Thank you,
> Andi
next prev parent reply other threads:[~2022-12-23 6:26 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-12-12 16:13 [Intel-gfx] [PATCH] drm/i915/gt: Reset twice Andi Shyti
2022-12-12 16:55 ` Rodrigo Vivi
2022-12-12 23:08 ` Andi Shyti
2022-12-13 13:18 ` Vivi, Rodrigo
2022-12-14 22:37 ` Andi Shyti
2022-12-15 20:07 ` Rodrigo Vivi
2022-12-22 9:28 ` Gwan-gyeong Mun
2022-12-22 13:47 ` Andi Shyti
2022-12-23 6:24 ` Gwan-gyeong Mun [this message]
2022-12-12 18:34 ` [Intel-gfx] ✗ Fi.CI.CHECKPATCH: warning for " Patchwork
2022-12-12 18:46 ` [Intel-gfx] ✓ Fi.CI.BAT: success " Patchwork
2022-12-13 10:11 ` [Intel-gfx] ✗ 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=a731f1af-1565-6fc3-41bc-3ded983e6127@intel.com \
--to=gwan-gyeong.mun@intel.com \
--cc=andi.shyti@linux.intel.com \
--cc=chris@chris-wilson.co.uk \
--cc=dri-devel@lists.freedesktop.org \
--cc=intel-gfx@lists.freedesktop.org \
--cc=rodrigo.vivi@intel.com \
--cc=stable@vger.kernel.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