From: Mika Kuoppala <mika.kuoppala@linux.intel.com>
To: Michel Thierry <michel.thierry@intel.com>,
Chris Wilson <chris@chris-wilson.co.uk>,
intel-gfx@lists.freedesktop.org
Subject: Re: [PATCH] drm/i915: Stop touching forcewake following a gen6+ engine reset
Date: Fri, 18 Aug 2017 11:56:23 +0300 [thread overview]
Message-ID: <87shgpqmo8.fsf@gaia.fi.intel.com> (raw)
In-Reply-To: <c2bc4334-2262-d015-367f-54d52c40f08e@intel.com>
Michel Thierry <michel.thierry@intel.com> writes:
> On 17/08/17 10:32, Chris Wilson wrote:
>> Forcewake is not affected by the engine reset on gen6+. Indeed the
>> reason why we added intel_uncore_forcewake_reset() to
>> gen6_reset_engines() was to keep the bookkeeping intact because the
>> reset did not touch the forcewake bit (yet we cancelled the forcewake
>> consumers)! This was done in commit 521198a2e7095:
>> Author: Mika Kuoppala <mika.kuoppala@linux.intel.com>
>> Date: Fri Aug 23 16:52:30 2013 +0300
>>
>> drm/i915: sanitize forcewake registers on reset
>>
>> In reset we try to restore the forcewake state to
>> pre reset state, using forcewake_count. The reset
>> doesn't seem to clear the forcewake bits so we
>> get warn on forcewake ack register not clearing.
>>
>> That futzing of the forcewake bookkeeping was dropped in commit
>> 0294ae7b44bb ("drm/i915: Consolidate forcewake resetting to a single
>> function"), but it did not make the realisation that the remaining
>> intel_uncore_forcewake_reset() was redundant.
>>
>> The new danger with using intel_uncore_forcewake_reset() with per-engine
>> resets is that the driver and hw are still in an active state as we
>> perform the reset. We may be using the forcewake to read protected
>> registers elsewhere and those results may be clobbered by the concurrent
>> dropping of forcewake.
>>
>> Reported-by: Michel Thierry <michel.thierry@intel.com>
>> Fixes: 142bc7d99bcf ("drm/i915: Modify error handler for per engine hang recovery")
>> Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
>> Cc: Mika Kuoppala <mika.kuoppala@linux.intel.com>
>> Cc: Michel Thierry <michel.thierry@intel.com>
>> ---
>> drivers/gpu/drm/i915/intel_uncore.c | 7 +------
>> 1 file changed, 1 insertion(+), 6 deletions(-)
>>
>> diff --git a/drivers/gpu/drm/i915/intel_uncore.c b/drivers/gpu/drm/i915/intel_uncore.c
>> index deb4430541cf..1d7b879cc68c 100644
>> --- a/drivers/gpu/drm/i915/intel_uncore.c
>> +++ b/drivers/gpu/drm/i915/intel_uncore.c
>> @@ -1497,7 +1497,6 @@ static int gen6_reset_engines(struct drm_i915_private *dev_priv,
>> [VECS] = GEN6_GRDOM_VECS,
>> };
>> u32 hw_mask;
>> - int ret;
>>
>> if (engine_mask == ALL_ENGINES) {
>> hw_mask = GEN6_GRDOM_FULL;
>> @@ -1509,11 +1508,7 @@ static int gen6_reset_engines(struct drm_i915_private *dev_priv,
>> hw_mask |= hw_engine_mask[engine->id];
>> }
>>
>> - ret = gen6_hw_domain_reset(dev_priv, hw_mask);
>> -
>> - intel_uncore_forcewake_reset(dev_priv, true);
>> -
>> - return ret;
>> + return gen6_hw_domain_reset(dev_priv, hw_mask);
>> }
>>
>> /**
>>
>
> Thanks for digging out the commit history.
>
> Reviewed-by Michel Thierry <michel.thierry@intel.com>
Nice find, possibly preventing quite amount of brain sprain.
Acked-by: Mika Kuoppala <mika.kuoppala@intel.com>
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
next prev parent reply other threads:[~2017-08-18 8:58 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-08-17 17:32 [PATCH] drm/i915: Stop touching forcewake following a gen6+ engine reset Chris Wilson
2017-08-17 17:41 ` Michel Thierry
2017-08-18 8:08 ` Chris Wilson
2017-08-18 8:56 ` Mika Kuoppala [this message]
2017-08-18 9:20 ` Chris Wilson
2017-08-17 17:49 ` ✓ Fi.CI.BAT: success for " Patchwork
2017-08-18 8:12 ` [PATCH] " Daniel Vetter
2017-08-18 8:24 ` Chris Wilson
2017-08-18 8:25 ` Chris Wilson
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=87shgpqmo8.fsf@gaia.fi.intel.com \
--to=mika.kuoppala@linux.intel.com \
--cc=chris@chris-wilson.co.uk \
--cc=intel-gfx@lists.freedesktop.org \
--cc=michel.thierry@intel.com \
/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.