Intel-XE Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Rodrigo Vivi <rodrigo.vivi@intel.com>
To: Nirmoy Das <nirmoy.das@intel.com>
Cc: <intel-xe@lists.freedesktop.org>,
	Lucas De Marchi <lucas.demarchi@intel.com>
Subject: Re: [PATCH] drm/xe/client: Check return value of  xe_force_wake_get
Date: Tue, 28 May 2024 13:22:23 -0400	[thread overview]
Message-ID: <ZlYSzzsY5xepVreW@intel.com> (raw)
In-Reply-To: <20240528101132.14788-1-nirmoy.das@intel.com>

On Tue, May 28, 2024 at 12:11:32PM +0200, Nirmoy Das wrote:
> xe_force_wake_get() can return error so check it's return value
> before reading gpu_timestamp value.
> 
> Fixes: 188ced1e0ff8 ("drm/xe/client: Print runtime to fdinfo")
> Cc: Lucas De Marchi <lucas.demarchi@intel.com>
> Signed-off-by: Nirmoy Das <nirmoy.das@intel.com>
> ---
>  drivers/gpu/drm/xe/xe_drm_client.c | 6 ++++--
>  1 file changed, 4 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/gpu/drm/xe/xe_drm_client.c b/drivers/gpu/drm/xe/xe_drm_client.c
> index 4a19b771e3a0..0c13395ffd34 100644
> --- a/drivers/gpu/drm/xe/xe_drm_client.c
> +++ b/drivers/gpu/drm/xe/xe_drm_client.c
> @@ -245,7 +245,7 @@ static void show_run_ticks(struct drm_printer *p, struct drm_file *file)
>  	struct xe_gt *gt;
>  	struct xe_hw_engine *hwe;
>  	struct xe_exec_queue *q;
> -	u64 gpu_timestamp;
> +	u64 gpu_timestamp = 0;
>  
>  	xe_pm_runtime_get(xe);
>  
> @@ -264,7 +264,9 @@ static void show_run_ticks(struct drm_printer *p, struct drm_file *file)
>  		if (!hwe)
>  			continue;
>  
> -		xe_force_wake_get(gt_to_fw(gt), XE_FW_GT);
> +		if (xe_force_wake_get(gt_to_fw(gt), XE_FW_GT))
> +			break;

worth adding a debug/err msg?

but up to you:

Reviewed-by: Rodrigo Vivi <rodrigo.vivi@intel.com>

> +
>  		gpu_timestamp = xe_hw_engine_read_timestamp(hwe);
>  		xe_force_wake_put(gt_to_fw(gt), XE_FW_GT);
>  		break;
> -- 
> 2.42.0
> 

  parent reply	other threads:[~2024-05-28 17:22 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-05-28 10:11 [PATCH] drm/xe/client: Check return value of xe_force_wake_get Nirmoy Das
2024-05-28 10:32 ` ✓ CI.Patch_applied: success for " Patchwork
2024-05-28 10:32 ` ✓ CI.checkpatch: " Patchwork
2024-05-28 10:33 ` ✗ CI.KUnit: failure " Patchwork
2024-05-28 17:22 ` Rodrigo Vivi [this message]
2024-05-29  8:50   ` [PATCH] " Nirmoy Das
2024-05-29 13:37     ` Rodrigo Vivi
2024-05-29 16:24     ` Lucas De Marchi
2024-05-30 21:22       ` Nirmoy Das
2024-05-29  9:20 ` ✓ CI.Patch_applied: success for drm/xe/client: Check return value of xe_force_wake_get (rev2) Patchwork
2024-05-29  9:20 ` ✓ CI.checkpatch: " Patchwork
2024-05-29  9:21 ` ✗ CI.KUnit: failure " Patchwork
2024-05-29 10:29 ` ✓ CI.Patch_applied: success for drm/xe/client: Check return value of xe_force_wake_get (rev3) Patchwork
2024-05-29 10:29 ` ✓ CI.checkpatch: " Patchwork
2024-05-29 10:30 ` ✓ CI.KUnit: " Patchwork
2024-05-29 10:42 ` ✓ CI.Build: " Patchwork
2024-05-29 10:42 ` ✗ CI.Hooks: failure " Patchwork
2024-05-29 10:43 ` ✓ CI.checksparse: success " Patchwork
2024-05-29 11:08 ` ✓ CI.BAT: " Patchwork
2024-05-29 12:25 ` ✗ CI.FULL: failure " Patchwork
2024-05-30  8:47 ` [PATCH] drm/xe/client: Check return value of xe_force_wake_get Ghimiray, Himal Prasad
2024-05-30 21:30   ` Nirmoy Das

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=ZlYSzzsY5xepVreW@intel.com \
    --to=rodrigo.vivi@intel.com \
    --cc=intel-xe@lists.freedesktop.org \
    --cc=lucas.demarchi@intel.com \
    --cc=nirmoy.das@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