All of lore.kernel.org
 help / color / mirror / Atom feed
From: Chris Wilson <chris@chris-wilson.co.uk>
To: Michal Wajdeczko <michal.wajdeczko@intel.com>,
	intel-gfx@lists.freedesktop.org
Subject: Re: [PATCH 2/3] drm/i915/uc: Don't always fail on unavailable GuC firmware
Date: Sun, 18 Aug 2019 10:58:48 +0100	[thread overview]
Message-ID: <156612232859.25088.15129287656574810290@skylake-alporthouse-com> (raw)
In-Reply-To: <20190818095204.31568-3-michal.wajdeczko@intel.com>

Quoting Michal Wajdeczko (2019-08-18 10:52:03)
> If we failed to fetch default GuC firmware and we didn't plan
> to use it for the submission and we never have used GuC before
> then we may continue normal driver load, no need to declare
> GPU wedged (we can use execlist for submission) and it is safe
> to run without the HuC (users will check HuC status anyway).
> 
> Signed-off-by: Michal Wajdeczko <michal.wajdeczko@intel.com>
> Cc: Daniele Ceraolo Spurio <daniele.ceraolospurio@intel.com>
> Cc: Chris Wilson <chris@chris-wilson.co.uk>
> ---
>  drivers/gpu/drm/i915/gt/uc/intel_uc.c | 27 +++++++++++++++++++++++++--
>  1 file changed, 25 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/gpu/drm/i915/gt/uc/intel_uc.c b/drivers/gpu/drm/i915/gt/uc/intel_uc.c
> index 6f0b9e05a5f6..10978e7ff06d 100644
> --- a/drivers/gpu/drm/i915/gt/uc/intel_uc.c
> +++ b/drivers/gpu/drm/i915/gt/uc/intel_uc.c
> @@ -400,6 +400,15 @@ static int uc_init_wopcm(struct intel_uc *uc)
>         return err;
>  }
>  
> +static bool uc_is_wopcm_locked(struct intel_uc *uc)
> +{
> +       struct intel_gt *gt = uc_to_gt(uc);
> +       struct intel_uncore *uncore = gt->uncore;
> +
> +       return (intel_uncore_read(uncore, GUC_WOPCM_SIZE) & GUC_WOPCM_SIZE_LOCKED) ||
> +              (intel_uncore_read(uncore, DMA_GUC_WOPCM_OFFSET) & GUC_WOPCM_OFFSET_VALID);
> +}
> +
>  int intel_uc_init_hw(struct intel_uc *uc)
>  {
>         struct drm_i915_private *i915 = uc_to_gt(uc)->i915;
> @@ -410,11 +419,19 @@ int intel_uc_init_hw(struct intel_uc *uc)
>         if (!intel_uc_supports_guc(uc))
>                 return 0;
>  
> -       if (!intel_uc_uses_guc(uc))
> +       /*
> +        * We can silently continue without GuC only if it was never enabled
> +        * before on this system after reboot, otherwise we risk GPU hangs.
> +        * To check if GuC was loaded before we look at WOPCM registers.
> +        */
> +       if (!intel_uc_uses_guc(uc) && !uc_is_wopcm_locked(uc))
>                 return 0;
>  
>         if (!intel_uc_fw_is_available(&guc->fw)) {
> -               ret = intel_uc_fw_status_to_error(guc->fw.status);
> +               ret = uc_is_wopcm_locked(uc) ||
> +                     intel_uc_fw_is_overridden(&guc->fw) ||
> +                     intel_uc_supports_guc_submission(uc) ?
> +                     intel_uc_fw_status_to_error(guc->fw.status) : 0;

I'm just going to leave it out here that this is a bit of a mouthful,
and would suggest a small function to clarify -- but naming is hard.

Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk>
-Chris
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

  reply	other threads:[~2019-08-18  9:59 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-08-18  9:52 [PATCH 0/3] Don't fail on GuC failure Michal Wajdeczko
2019-08-18  9:52 ` [PATCH 1/3] drm/i915/guc: Don't open log relay if GuC is not running Michal Wajdeczko
2019-08-18  9:56   ` Chris Wilson
2019-08-18  9:52 ` [PATCH 2/3] drm/i915/uc: Don't always fail on unavailable GuC firmware Michal Wajdeczko
2019-08-18  9:58   ` Chris Wilson [this message]
2019-08-18  9:52 ` [PATCH 3/3] drm/i915/uc: Never fail on HuC firmware errors Michal Wajdeczko
2019-08-18 10:00   ` Chris Wilson
2019-08-18 10:16     ` Michal Wajdeczko
2019-08-18 10:27       ` Chris Wilson
2019-08-18 10:57 ` ✓ Fi.CI.BAT: success for Don't fail on GuC failure Patchwork
2019-08-18 11:03   ` Chris Wilson
2019-08-18 15:57 ` ✓ 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=156612232859.25088.15129287656574810290@skylake-alporthouse-com \
    --to=chris@chris-wilson.co.uk \
    --cc=intel-gfx@lists.freedesktop.org \
    --cc=michal.wajdeczko@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.