[PATCH] drm/xe: skip register UC debugfs if UC disabled

Matthew Brost matthew.brost at intel.com
Thu Jan 4 18:45:55 UTC 2024


On Thu, Jan 04, 2024 at 12:05:57PM +0200, Ohad Sharabi wrote:
> When working with execlist we should not register the UC debugfs entries.
> 
> Accessing those entries when UC is disabled can lead to a kernel crush
> (NULL pointer dereference).
> 
> Signed-off-by: Ohad Sharabi <osharabi at habana.ai>

Reviewed-by: Matthew Brost <matthew.brost at intel.com>

> ---
>  drivers/gpu/drm/xe/xe_gt_debugfs.c | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/gpu/drm/xe/xe_gt_debugfs.c b/drivers/gpu/drm/xe/xe_gt_debugfs.c
> index c4b67cf09f8f..bafd55a7fb16 100644
> --- a/drivers/gpu/drm/xe/xe_gt_debugfs.c
> +++ b/drivers/gpu/drm/xe/xe_gt_debugfs.c
> @@ -245,5 +245,6 @@ void xe_gt_debugfs_register(struct xe_gt *gt)
>  				 ARRAY_SIZE(debugfs_list),
>  				 root, minor);
>  
> -	xe_uc_debugfs_register(&gt->uc, root);
> +	if (xe_device_uc_enabled(xe))
> +		xe_uc_debugfs_register(&gt->uc, root);
>  }
> -- 
> 2.34.1
> 


More information about the Intel-xe mailing list