[PATCH] drm/xe/mocs: Initialize MOCS index early

Vodapalli, Ravi Kumar ravi.kumar.vodapalli at intel.com
Mon May 26 09:59:13 UTC 2025



On 5/20/2025 7:54 PM, Balasubramani Vivekanandan wrote:
> MOCS uc_index is used even before it is initialized in the following
> callstack
>      guc_prepare_xfer()
>      __xe_guc_upload()
>      xe_guc_min_load_for_hwconfig()
>      xe_uc_init_hwconfig()
>      xe_gt_init_hwconfig()
>
> Do MOCS index initialization earlier in the device probe.
>
> Signed-off-by: Balasubramani Vivekanandan <balasubramani.vivekanandan at intel.com>
> ---
>   drivers/gpu/drm/xe/xe_gt.c | 4 ++--
>   1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/gpu/drm/xe/xe_gt.c b/drivers/gpu/drm/xe/xe_gt.c
> index 0e5d243c9451..858b5398c01b 100644
> --- a/drivers/gpu/drm/xe/xe_gt.c
> +++ b/drivers/gpu/drm/xe/xe_gt.c
> @@ -417,6 +417,8 @@ int xe_gt_init_early(struct xe_gt *gt)
>   	if (err)
>   		return err;
>   
> +	xe_mocs_init_early(gt);
> +
>   	return 0;
>   }
>   
> @@ -634,8 +636,6 @@ int xe_gt_init(struct xe_gt *gt)
>   	if (err)
>   		return err;
>   
> -	xe_mocs_init_early(gt);
> -
>   	err = xe_gt_sysfs_init(gt);
>   	if (err)
>   		return err;
Looks good

Reviewed-by: Ravi Kumar Vodapalli <ravi.kumar.vodapalli at intel.com>


Thanks & Regards,
Ravi Kumar V


More information about the Intel-xe mailing list