From: Tvrtko Ursulin <tvrtko.ursulin@linux.intel.com>
To: John Harrison <john.c.harrison@intel.com>,
Intel-GFX@Lists.FreeDesktop.Org
Cc: DRI-Devel@Lists.FreeDesktop.Org
Subject: Re: [Intel-gfx] [PATCH] drm/i915/guc: Check for wedged before doing stuff
Date: Fri, 17 Dec 2021 09:10:29 +0000 [thread overview]
Message-ID: <b340a472-e780-0519-615c-2396bb69c9db@linux.intel.com> (raw)
In-Reply-To: <7456242f-654a-1109-c91b-4ecb7a0f3a64@intel.com>
On 16/12/2021 20:30, John Harrison wrote:
> On 12/16/2021 00:47, Tvrtko Ursulin wrote:
>> On 15/12/2021 22:45, John.C.Harrison@Intel.com wrote:
>>> From: John Harrison <John.C.Harrison@Intel.com>
>>>
>>> A fault injection probe test hit a BUG_ON in a GuC error path. It
>>> showed that the GuC code could potentially attempt to do many things
>>> when the device is actually wedged. So, add a check in to prevent that.
>>>
>>> Signed-off-by: John Harrison <John.C.Harrison@Intel.com>
>>> ---
>>> drivers/gpu/drm/i915/gt/uc/intel_guc_submission.c | 3 ++-
>>> 1 file changed, 2 insertions(+), 1 deletion(-)
>>>
>>> diff --git a/drivers/gpu/drm/i915/gt/uc/intel_guc_submission.c
>>> b/drivers/gpu/drm/i915/gt/uc/intel_guc_submission.c
>>> index 97311119da6f..88f002c4d41b 100644
>>> --- a/drivers/gpu/drm/i915/gt/uc/intel_guc_submission.c
>>> +++ b/drivers/gpu/drm/i915/gt/uc/intel_guc_submission.c
>>> @@ -1350,7 +1350,8 @@ submission_disabled(struct intel_guc *guc)
>>> struct i915_sched_engine * const sched_engine = guc->sched_engine;
>>> return unlikely(!sched_engine ||
>>> - !__tasklet_is_enabled(&sched_engine->tasklet));
>>> + !__tasklet_is_enabled(&sched_engine->tasklet) ||
>>> + test_bit(I915_WEDGED, &guc_to_gt(guc)->reset.flags));
>>
>> Or intel_gt_is_wedged ?
> Hmm. I just copied the test from somewhere else. Is there any particular
> reason why other bits of code would be doing the explicit test_bit
Lets see:
$ grep intel_gt_is_wedged . -r | wc -l
55
$ grep test_bit.*I915_WEDGED, . -r
./gt/intel_gt.h: !test_bit(I915_WEDGED, >->reset.flags));
./gt/intel_gt.h: return unlikely(test_bit(I915_WEDGED, >->reset.flags));
./gt/intel_reset.c: if (test_bit(I915_WEDGED, >->reset.flags))
./gt/intel_reset.c: if (test_bit(I915_WEDGED, >->reset.flags))
./gt/intel_reset.c: if (!test_bit(I915_WEDGED, >->reset.flags))
./gt/intel_reset.c: if (!test_bit(I915_WEDGED, >->reset.flags))
./gt/uc/intel_guc_submission.c: test_bit(I915_WEDGED, &guc_to_gt(guc)->reset.flags))) {
So outside the components which own the flag only GuC goes direct therefore you might know better if there is a special reason for that.
The code there looks like this:
/* Reset called during driver load or during wedge? */
if (unlikely(!guc_submission_initialized(guc) ||
test_bit(I915_WEDGED, &guc_to_gt(guc)->reset.flags)))
return;
Perhaps that check and then one you are adding could even be partly the same?
> rather than calling the helper? I see the helper has a BUG_ON. Can that
> fire if called at the wrong time in the reset path?
The grep above suggests it should be safe. And looking at the assert it seems to check if someone set the fatal wedge bit without setting the "normal" wedge eg. setting it directly bypassing the helper. So should be fine.
Regards,
Tvrtko
prev parent reply other threads:[~2021-12-17 9:10 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-12-15 22:45 [Intel-gfx] [PATCH] drm/i915/guc: Check for wedged before doing stuff John.C.Harrison
2021-12-15 22:45 ` John.C.Harrison
2021-12-15 23:57 ` [Intel-gfx] ✓ Fi.CI.BAT: success for " Patchwork
2021-12-16 1:05 ` [Intel-gfx] [PATCH] " Matthew Brost
2021-12-16 1:38 ` [Intel-gfx] ✗ Fi.CI.IGT: failure for " Patchwork
2021-12-16 8:47 ` [Intel-gfx] [PATCH] " Tvrtko Ursulin
2021-12-16 20:30 ` John Harrison
2021-12-17 9:10 ` Tvrtko Ursulin [this message]
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=b340a472-e780-0519-615c-2396bb69c9db@linux.intel.com \
--to=tvrtko.ursulin@linux.intel.com \
--cc=DRI-Devel@Lists.FreeDesktop.Org \
--cc=Intel-GFX@Lists.FreeDesktop.Org \
--cc=john.c.harrison@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.