[PATCH 2/2] drm/xe: Fix xe_force_wake_assert_held for enum XE_FORCEWAKE_ALL

Rodrigo Vivi rodrigo.vivi at intel.com
Fri May 31 13:19:18 UTC 2024


On Fri, May 31, 2024 at 12:18:45PM +0530, Himal Prasad Ghimiray wrote:
> Make sure that the assertion condition covers the wakefulness of all
> supported domains for XE_FORCEWAKE_ALL.

The most important part is missing here: why? what issue are we trying to solve?

> 
> Cc: Rodrigo Vivi <rodrigo.vivi at intel.com>
> Cc: Badal Nilawar <badal.nilawar at intel.com>
> Signed-off-by: Himal Prasad Ghimiray <himal.prasad.ghimiray at 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..4c986d72cba7 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->supported_domains : domain;
> +
> +	xe_gt_assert(fw->gt, (fw->awake_domains & is_awake) == is_awake);
>  }
>  
>  #endif
> -- 
> 2.25.1
> 


More information about the Intel-xe mailing list