Intel-XE Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Daniele Ceraolo Spurio <daniele.ceraolospurio@intel.com>
To: Tejas Upadhyay <tejas.upadhyay@intel.com>,
	<intel-xe@lists.freedesktop.org>
Subject: Re: [PATCH] drm/xe/gsc: Check for possible err in forcewake GT
Date: Tue, 12 Mar 2024 09:04:05 -0700	[thread overview]
Message-ID: <4d8399f6-5155-4340-98f3-fe9d4f6019e9@intel.com> (raw)
In-Reply-To: <20240312142424.3152951-1-tejas.upadhyay@intel.com>



On 3/12/2024 7:24 AM, Tejas Upadhyay wrote:
> GT Forcewake can fail, check for success before
> moving forward
>
> Signed-off-by: Tejas Upadhyay <tejas.upadhyay@intel.com>
> ---
>   drivers/gpu/drm/xe/xe_gsc.c | 6 +++++-
>   1 file changed, 5 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/gpu/drm/xe/xe_gsc.c b/drivers/gpu/drm/xe/xe_gsc.c
> index d9aa815a5bc2..a5ee1b39f4a7 100644
> --- a/drivers/gpu/drm/xe/xe_gsc.c
> +++ b/drivers/gpu/drm/xe/xe_gsc.c
> @@ -287,7 +287,11 @@ static void gsc_work(struct work_struct *work)
>   	spin_unlock_irq(&gsc->lock);
>   
>   	xe_pm_runtime_get(xe);
> -	xe_force_wake_get(gt_to_fw(gt), XE_FW_GSC);
> +	ret = xe_force_wake_get(gt_to_fw(gt), XE_FW_GSC);
> +	if (ret) {
> +		xe_pm_runtime_put(xe);
> +		return;

It's not safe to just abort here, it'll leave the SW in an unknown 
state. I have a patch semi-ready (will complete it and send it later 
today) to print an error an keep going. If the GT happens to actually be 
awake then the next steps will work, if it's not then they'll fail and 
we'll move the SW state to the expected values.

Daniele


> +	}
>   
>   	if (actions & GSC_ACTION_FW_LOAD) {
>   		ret = gsc_upload_and_init(gsc);


      parent reply	other threads:[~2024-03-12 16:05 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-03-12 14:24 [PATCH] drm/xe/gsc: Check for possible err in forcewake GT Tejas Upadhyay
2024-03-12 15:01 ` ✓ CI.Patch_applied: success for " Patchwork
2024-03-12 15:01 ` ✓ CI.checkpatch: " Patchwork
2024-03-12 15:02 ` ✓ CI.KUnit: " Patchwork
2024-03-12 15:12 ` ✓ CI.Build: " Patchwork
2024-03-12 15:15 ` ✓ CI.Hooks: " Patchwork
2024-03-12 15:16 ` ✓ CI.checksparse: " Patchwork
2024-03-12 15:36 ` ✓ CI.BAT: " Patchwork
2024-03-12 16:04 ` Daniele Ceraolo Spurio [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=4d8399f6-5155-4340-98f3-fe9d4f6019e9@intel.com \
    --to=daniele.ceraolospurio@intel.com \
    --cc=intel-xe@lists.freedesktop.org \
    --cc=tejas.upadhyay@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