Intel-XE Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: "Nilawar, Badal" <badal.nilawar@intel.com>
To: Himal Prasad Ghimiray <himal.prasad.ghimiray@intel.com>,
	<intel-xe@lists.freedesktop.org>
Cc: Rodrigo Vivi <rodrigo.vivi@intel.com>
Subject: Re: [PATCH v2 3/3] drm/xe: Fix xe_force_wake_assert_held for enum XE_FORCEWAKE_ALL
Date: Mon, 3 Jun 2024 20:06:15 +0530	[thread overview]
Message-ID: <fa3468f4-691e-403d-a2a5-f2bb4d02312e@intel.com> (raw)
In-Reply-To: <20240603090147.1098639-3-himal.prasad.ghimiray@intel.com>



On 03-06-2024 14:31, Himal Prasad Ghimiray wrote:
> xe_force_wake_assert_held is designed to trigger an assertion if the
> provided domain is not awake, which works correctly for individual
> domains. However, the assertion condition becomes incorrect for
> XE_FORCEWAKE_ALL.
> 
> For instance, if we assume all domains are in sleep mode, invoking
> xe_force_wake_get(fw, XE_FORCEWAKE_GT) will only awaken the "gt" domain.
> Subsequently, another function needs that all domains are awake and
> utilizes xe_force_wake_assert_held(fw, XE_FORCEWAKE_ALL).
> In this scenario, the condition will inaccurately return success because
> fw->awake_domains (0x1) & XE_FORCEWAKE_ALL (0xFF) will still be 0x1 and
> Ideally it should have asserted.
> 
> Make sure that the assertion condition covers the wakefulness of all
> initialized domains for XE_FORCEWAKE_ALL.
> 
> v2:
> - %s/supported/initialized/
> - update commit message (Rodrigo)
> 
> Cc: Rodrigo Vivi <rodrigo.vivi@intel.com>
> Cc: Badal Nilawar <badal.nilawar@intel.com>
> Signed-off-by: Himal Prasad Ghimiray <himal.prasad.ghimiray@intel.com>
> ---
>   drivers/gpu/drm/xe/xe_force_wake.h | 7 ++++++-
>   1 file changed, 6 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/gpu/drm/xe/xe_force_wake.h b/drivers/gpu/drm/xe/xe_force_wake.h
> index 83cb157da7cc..a9b01d7ede44 100644
> --- a/drivers/gpu/drm/xe/xe_force_wake.h
> +++ b/drivers/gpu/drm/xe/xe_force_wake.h
> @@ -32,7 +32,12 @@ static inline void
>   xe_force_wake_assert_held(struct xe_force_wake *fw,
>   			  enum xe_force_wake_domains domain)
>   {
> -	xe_gt_assert(fw->gt, fw->awake_domains & domain);
> +	enum xe_force_wake_domains is_awake;
> +
> +	is_awake = (domain == XE_FORCEWAKE_ALL) ?
> +		    fw->initialized_domains : domain;
> +
> +	xe_gt_assert(fw->gt, (fw->awake_domains & is_awake) == is_awake);
Reviewed-by: Badal Nilawar <badal.nilawar@intel.com>

Regards,
Badal
>   }
>   
>   #endif

  reply	other threads:[~2024-06-03 14:36 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-06-03  9:01 [PATCH v2 1/3] drm/xe: Cleanup force wake registers bit definitions Himal Prasad Ghimiray
2024-06-03  9:01 ` [PATCH v2 2/3] drm/xe: Add member initialized_domains to xe_force_wake Himal Prasad Ghimiray
2024-06-03 14:33   ` Nilawar, Badal
2024-06-03  9:01 ` [PATCH v2 3/3] drm/xe: Fix xe_force_wake_assert_held for enum XE_FORCEWAKE_ALL Himal Prasad Ghimiray
2024-06-03 14:36   ` Nilawar, Badal [this message]
2024-06-03 10:55 ` [PATCH v2 1/3] drm/xe: Cleanup force wake registers bit definitions Nilawar, Badal
2024-06-04 14:45 ` ✓ CI.Patch_applied: success for series starting with [v2,1/3] " Patchwork
2024-06-04 14:46 ` ✓ CI.checkpatch: " Patchwork
2024-06-04 14:46 ` ✓ CI.KUnit: " Patchwork
2024-06-04 14:58 ` ✓ CI.Build: " Patchwork
2024-06-04 14:58 ` ✗ CI.Hooks: failure " Patchwork
2024-06-04 15:00 ` ✓ CI.checksparse: success " Patchwork
2024-06-04 16:59 ` ✗ CI.FULL: failure " Patchwork
2024-06-04 18:48 ` [PATCH v2 1/3] " Rodrigo Vivi
2024-06-05  3:03   ` Ghimiray, Himal Prasad

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=fa3468f4-691e-403d-a2a5-f2bb4d02312e@intel.com \
    --to=badal.nilawar@intel.com \
    --cc=himal.prasad.ghimiray@intel.com \
    --cc=intel-xe@lists.freedesktop.org \
    --cc=rodrigo.vivi@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