[PATCH 2/2] drm/xe: Check pat.ops before dumping PAT settings

Piotr Piórkowski piotr.piorkowski at intel.com
Tue Apr 9 13:09:51 UTC 2024


Michal Wajdeczko <michal.wajdeczko at intel.com> wrote on wto [2024-kwi-09 12:51:06 +0200]:
> We may leave pat.ops unset when running on brand new platform or
> when running as a VF.  While the former is unlikely, the latter
> is valid (future) use case and will cause NPD when someone will
> try to dump PAT settings by debugfs.
> 
> It's better to check pointer to pat.ops instead of specific .dump
> hook, as we have this hook always defined for every .ops variant.
> 
> Signed-off-by: Michal Wajdeczko <michal.wajdeczko at intel.com>
> ---
>  drivers/gpu/drm/xe/xe_pat.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/gpu/drm/xe/xe_pat.c b/drivers/gpu/drm/xe/xe_pat.c
> index 026e4a9fe124..4118c3084398 100644
> --- a/drivers/gpu/drm/xe/xe_pat.c
> +++ b/drivers/gpu/drm/xe/xe_pat.c
> @@ -451,7 +451,7 @@ void xe_pat_dump(struct xe_gt *gt, struct drm_printer *p)
>  {
>  	struct xe_device *xe = gt_to_xe(gt);
>  
> -	if (!xe->pat.ops->dump)
> +	if (!xe->pat.ops)
>  		return;

Reviewed-by: Piotr Piórkowski <piotr.piorkowski at intel.com>
>  
>  	xe->pat.ops->dump(gt, p);
> -- 
> 2.43.0
> 

-- 


More information about the Intel-xe mailing list