[PATCH v2 1/2] drm/xe: Ensure caller uses sole domain for xe_force_wake_assert_held

Michal Wajdeczko michal.wajdeczko at intel.com
Fri Jun 7 11:23:02 UTC 2024



On 07.06.2024 07:22, Himal Prasad Ghimiray wrote:
> xe_force_wake_assert_held() is designed to confirm a particular
> forcewake domain's wakefulness; it doesn't verify the wakefulness of
> multiple domains. Make sure the caller doesn't input multiple
> domains(XE_FORCEWAKE_ALL) as a parameter.

maybe we should also copy above commit message as description of the
below helper ? but still, assert provides some level of guideline, so

Reviewed-by: Michal Wajdeczko <michal.wajdeczko at intel.com>

> 
> v2
> - use domain != XE_FORCEWAKE_ALL (Michal)
> 
> Cc: Michal Wajdeczko <michal.wajdeczko at intel.com>
> Cc: Rodrigo Vivi <rodrigo.vivi at intel.com>
> Cc: Lucas De Marchi <lucas.demarchi 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 | 1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/drivers/gpu/drm/xe/xe_force_wake.h b/drivers/gpu/drm/xe/xe_force_wake.h
> index 83cb157da7cc..651ea1e62c63 100644
> --- a/drivers/gpu/drm/xe/xe_force_wake.h
> +++ b/drivers/gpu/drm/xe/xe_force_wake.h
> @@ -32,6 +32,7 @@ static inline void
>  xe_force_wake_assert_held(struct xe_force_wake *fw,
>  			  enum xe_force_wake_domains domain)
>  {
> +	xe_gt_assert(fw->gt, domain != XE_FORCEWAKE_ALL);
>  	xe_gt_assert(fw->gt, fw->awake_domains & domain);
>  }
>  


More information about the Intel-xe mailing list