Intel-GFX Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Jani Nikula <jani.nikula@linux.intel.com>
To: Zhanjun Dong <zhanjun.dong@intel.com>,
	intel-gfx@lists.freedesktop.org, dri-devel@lists.freedesktop.org
Subject: Re: [Intel-gfx] [PATCH] drm/i915: Set wedged if enable guc communication failed
Date: Mon, 27 Feb 2023 13:30:23 +0200	[thread overview]
Message-ID: <87y1oj1h2o.fsf@intel.com> (raw)
In-Reply-To: <20230224231724.769343-1-zhanjun.dong@intel.com>

On Fri, 24 Feb 2023, Zhanjun Dong <zhanjun.dong@intel.com> wrote:
> Add err code check for enable_communication on resume path, set wedged if failed.

I can see that this is *what* the code does, but the commit message
should answer the question *why*.

>
> Signed-off-by: Zhanjun Dong <zhanjun.dong@intel.com>
> ---
>  drivers/gpu/drm/i915/gt/intel_gt_pm.c | 5 ++++-
>  drivers/gpu/drm/i915/gt/uc/intel_uc.c | 9 +++++++--
>  2 files changed, 11 insertions(+), 3 deletions(-)
>
> diff --git a/drivers/gpu/drm/i915/gt/intel_gt_pm.c b/drivers/gpu/drm/i915/gt/intel_gt_pm.c
> index cef3d6f5c34e..f3bb7cbbd293 100644
> --- a/drivers/gpu/drm/i915/gt/intel_gt_pm.c
> +++ b/drivers/gpu/drm/i915/gt/intel_gt_pm.c
> @@ -401,8 +401,11 @@ int intel_gt_runtime_resume(struct intel_gt *gt)
>  	intel_ggtt_restore_fences(gt->ggtt);
>  
>  	ret = intel_uc_runtime_resume(&gt->uc);
> -	if (ret)
> +	if (ret) {
> +		/* Set wedge if uc resume failed */

This comment is just a reiteration of the C code in English, but doesn't
provide any useful additional information.

BR,
Jani.

> +		intel_gt_set_wedged(gt);
>  		return ret;
> +	}
>  
>  	return 0;
>  }
> diff --git a/drivers/gpu/drm/i915/gt/uc/intel_uc.c b/drivers/gpu/drm/i915/gt/uc/intel_uc.c
> index 6648691bd645..d4f428acf20a 100644
> --- a/drivers/gpu/drm/i915/gt/uc/intel_uc.c
> +++ b/drivers/gpu/drm/i915/gt/uc/intel_uc.c
> @@ -698,8 +698,13 @@ static int __uc_resume(struct intel_uc *uc, bool enable_communication)
>  	/* Make sure we enable communication if and only if it's disabled */
>  	GEM_BUG_ON(enable_communication == intel_guc_ct_enabled(&guc->ct));
>  
> -	if (enable_communication)
> -		guc_enable_communication(guc);
> +	if (enable_communication) {
> +		err = guc_enable_communication(guc);
> +		if (err) {
> +			guc_dbg(guc, "Failed to resume, %pe", ERR_PTR(err));
> +			return err;
> +		}
> +	}
>  
>  	/* If we are only resuming GuC communication but not reloading
>  	 * GuC, we need to ensure the ARAT timer interrupt is enabled

-- 
Jani Nikula, Intel Open Source Graphics Center

  parent reply	other threads:[~2023-02-27 11:30 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-02-24 23:17 [Intel-gfx] [PATCH] drm/i915: Set wedged if enable guc communication failed Zhanjun Dong
2023-02-25  0:12 ` [Intel-gfx] ✓ Fi.CI.BAT: success for " Patchwork
2023-02-25  6:41 ` [Intel-gfx] ✓ Fi.CI.IGT: " Patchwork
2023-02-27 11:30 ` Jani Nikula [this message]
2023-03-02 22:08   ` [Intel-gfx] [PATCH] " Dong, Zhanjun
  -- strict thread matches above, loose matches on Subject: below --
2023-03-02 21:50 Zhanjun Dong
2023-03-04  0:10 ` Ceraolo Spurio, Daniele

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=87y1oj1h2o.fsf@intel.com \
    --to=jani.nikula@linux.intel.com \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=intel-gfx@lists.freedesktop.org \
    --cc=zhanjun.dong@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox