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: Always check force_wake_get return code
Date: Mon, 3 Jun 2024 11:56:46 -0700	[thread overview]
Message-ID: <92e54e93-dbb8-4dd8-8257-58dd8c87ff7c@intel.com> (raw)
In-Reply-To: <20240603113005.710746-1-tejas.upadhyay@intel.com>

The commit title seems a bit too generic, given that you're only fixing 
a single occurrence. maybe switch to something like "check 
force_wake_get return code in show_run_ticks" ?

On 6/3/2024 4:30 AM, Tejas Upadhyay wrote:
> A force_wake_get failure means that the HW might not be awake for the
> access we're doing; this can lead to an immediate error or it can be a
> more subtle problem.
>
> In this case, user has asked information and in case of forcewake
> failure, it might lead to wrong information, so return in case of
> error.
>
> Signed-off-by: Tejas Upadhyay <tejas.upadhyay@intel.com>
> ---
>   drivers/gpu/drm/xe/xe_drm_client.c | 3 ++-
>   1 file changed, 2 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/gpu/drm/xe/xe_drm_client.c b/drivers/gpu/drm/xe/xe_drm_client.c
> index 4a19b771e3a0..e050fc6d8dd7 100644
> --- a/drivers/gpu/drm/xe/xe_drm_client.c
> +++ b/drivers/gpu/drm/xe/xe_drm_client.c
> @@ -264,7 +264,8 @@ 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))
> +			return;

Since we're not returning any error code, there doesn't seem to be a 
direct way to know that a forcewake error happened; we can probably 
infer it by the lack of messages being printed, but there is another 
(unlikely) exit point that causes no prints to occur. Should we print an 
error to dmesg, just to be safe?

Daniele

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


  reply	other threads:[~2024-06-03 18:56 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-06-03 11:30 [PATCH] drm/xe: Always check force_wake_get return code Tejas Upadhyay
2024-06-03 18:56 ` Daniele Ceraolo Spurio [this message]
2024-06-03 19:39   ` Lucas De Marchi
2024-06-04 18:31     ` Rodrigo Vivi
2024-06-04 16:46 ` ✓ CI.Patch_applied: success for drm/xe: Always check force_wake_get return code (rev3) Patchwork
2024-06-04 16:46 ` ✓ CI.checkpatch: " Patchwork
2024-06-04 16:47 ` ✓ CI.KUnit: " Patchwork
2024-06-04 16:58 ` ✓ CI.Build: " Patchwork
2024-06-04 16:59 ` ✗ CI.Hooks: failure " Patchwork
2024-06-04 17:00 ` ✓ CI.checksparse: success " Patchwork
2024-06-04 17:24 ` ✓ CI.BAT: " Patchwork
2024-06-04 21:01 ` ✗ CI.FULL: failure " Patchwork
  -- strict thread matches above, loose matches on Subject: below --
2024-03-12 19:42 [PATCH] drm/xe: Always check force_wake_get return code Daniele Ceraolo Spurio
2024-03-12 23:07 ` Matt Roper
2024-03-13  8:31 ` Jani Nikula
2024-03-13 14:24   ` Daniele Ceraolo Spurio
2024-03-13 14:56     ` Jani Nikula
2024-03-13 17:35       ` Daniele Ceraolo Spurio
2024-03-14 10:58 ` Upadhyay, Tejas
2024-03-14 13:53   ` Daniele Ceraolo Spurio
2024-03-14 14:12     ` Upadhyay, Tejas

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=92e54e93-dbb8-4dd8-8257-58dd8c87ff7c@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