[PATCH] drm/xe/pt: Warn on 0 level before going to next lower level

Rodrigo Vivi rodrigo.vivi at intel.com
Mon Mar 18 20:41:37 UTC 2024


On Mon, Mar 18, 2024 at 06:37:44PM +0100, Nirmoy Das wrote:
> This should happen so add a warn_on to be more paranoid.

should or should not?

> 
> Cc: Matthew Auld <matthew.auld at intel.com>
> Signed-off-by: Nirmoy Das <nirmoy.das at intel.com>
> ---
>  drivers/gpu/drm/xe/xe_pt.c | 2 ++
>  1 file changed, 2 insertions(+)
> 
> diff --git a/drivers/gpu/drm/xe/xe_pt.c b/drivers/gpu/drm/xe/xe_pt.c
> index 7f54bc3e389d..d6794f65d6c1 100644
> --- a/drivers/gpu/drm/xe/xe_pt.c
> +++ b/drivers/gpu/drm/xe/xe_pt.c
> @@ -731,6 +731,7 @@ static int xe_pt_zap_ptes_entry(struct xe_ptw *parent, pgoff_t offset,
>  	pgoff_t end_offset;
>  
>  	XE_WARN_ON(!*child);
> +	XE_WARN_ON(!level);
>  	XE_WARN_ON(!level && xe_child->is_compact);
>  
>  	/*
> @@ -1396,6 +1397,7 @@ static int xe_pt_stage_unbind_entry(struct xe_ptw *parent, pgoff_t offset,
>  	struct xe_pt *xe_child = container_of(*child, typeof(*xe_child), base);
>  
>  	XE_WARN_ON(!*child);
> +	XE_WARN_ON(!level);
>  	XE_WARN_ON(!level && xe_child->is_compact);
>  
>  	xe_pt_check_kill(addr, next, level - 1, xe_child, action, walk);
> -- 
> 2.42.0
> 


More information about the Intel-xe mailing list