All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Michal Wajdeczko" <michal.wajdeczko@intel.com>
To: Daniele Ceraolo Spurio <daniele.ceraolospurio@intel.com>,
	Janusz Krzysztofik <janusz.krzysztofik@linux.intel.com>
Cc: intel-gfx@lists.freedesktop.org
Subject: Re: [PATCH] drm/i915/guc: Fix detection of GuC submission in use
Date: Thu, 05 Sep 2019 14:08:12 +0200	[thread overview]
Message-ID: <op.z7m7zyblxaggs7@mwajdecz-mobl1.ger.corp.intel.com> (raw)
In-Reply-To: <20190905111631.23441-1-janusz.krzysztofik@linux.intel.com>

On Thu, 05 Sep 2019 13:16:31 +0200, Janusz Krzysztofik  
<janusz.krzysztofik@linux.intel.com> wrote:

> The driver always assumes active GuC submission mode if it is
> supported.  That's not true if GuC initialization fails for some
> reason.  That may lead to kernel panics, caused e.g. by execlists
> fallback submission mode incorrectly detecting GuC submission in use.
>
> Fix it by also checking for GuC enabled status.
>
> Fixes: 356c484822e6 ("drm/i915/uc: Add explicit DISABLED state for  
> firmware")
> Signed-off-by: Janusz Krzysztofik <janusz.krzysztofik@linux.intel.com>
> ---
>  drivers/gpu/drm/i915/gt/uc/intel_uc.h | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/gpu/drm/i915/gt/uc/intel_uc.h  
> b/drivers/gpu/drm/i915/gt/uc/intel_uc.h
> index 527995c21196..b28bab64a280 100644
> --- a/drivers/gpu/drm/i915/gt/uc/intel_uc.h
> +++ b/drivers/gpu/drm/i915/gt/uc/intel_uc.h
> @@ -51,7 +51,8 @@ static inline bool  
> intel_uc_supports_guc_submission(struct intel_uc *uc)
> static inline bool intel_uc_uses_guc_submission(struct intel_uc *uc)
>  {
> -	return intel_guc_is_submission_supported(&uc->guc);
> +	return intel_guc_is_enabled(&uc->guc) &&
> +	       intel_guc_is_submission_supported(&uc->guc);

This wont fix your original problem (that btw is not possible to
repro on drm-tip) as after any GuC initialization failure we still
treat GuC as "enabled":

intel_guc_is_supported => H/W support (static)
intel_guc_is_enabled => aka not disabled by the user (config)
intel_guc_is_running => no major fw failure (runtime)

Note that we even s/intel_guc_is_enabled/intel_guc_is_running
won't help as GuC may be running but we may fail to correctly
initialize GuC submission.

Correct fix to original problem must be aligned with new GuC
submission model (coming soon) and it may look as this:

+static inline bool intel_guc_is_submission_active(struct intel_guc *guc)
+{
+	GEM_BUG_ON(guc->submission_active && !intel_guc_is_running(guc));
+	return guc->submission_active;
+}

and then

  static inline bool intel_uc_uses_guc_submission(struct intel_uc *uc)
  {
-	return intel_guc_is_submission_supported(&uc->guc);
+	return intel_guc_is_submission_active(&uc->guc);
  }

We may need to revisit all uses/supports/ macros to better
reflect configuration vs runtime differences.

Thanks,
Michal
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

  reply	other threads:[~2019-09-05 12:08 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-09-05 11:16 [PATCH] drm/i915/guc: Fix detection of GuC submission in use Janusz Krzysztofik
2019-09-05 12:08 ` Michal Wajdeczko [this message]
2019-09-05 12:34   ` Janusz Krzysztofik
2019-09-05 13:19 ` ✓ Fi.CI.BAT: success for " Patchwork
2019-09-05 16:14 ` ✓ Fi.CI.IGT: " 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=op.z7m7zyblxaggs7@mwajdecz-mobl1.ger.corp.intel.com \
    --to=michal.wajdeczko@intel.com \
    --cc=daniele.ceraolospurio@intel.com \
    --cc=intel-gfx@lists.freedesktop.org \
    --cc=janusz.krzysztofik@linux.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.