[PATCH v2] drm/xe/guc: Set wedged on Xe micro hardware initialization error

Summers, Stuart stuart.summers at intel.com
Wed Jun 11 17:24:42 UTC 2025


On Wed, 2025-06-04 at 19:45 -0400, Zhanjun Dong wrote:
> Declare wedged on Xe micro controller hardware initialization
> failed.
> 
> Signed-off-by: Zhanjun Dong <zhanjun.dong at intel.com>
> Closes: https://gitlab.freedesktop.org/drm/xe/kernel/-/issues/4917
> 
> ---
> Cc: Michal Wajdeczko <michal.wajdeczko at intel.com>
> 
> Change list:
> v2: Remove unnecessary jump to err-out
>     Drop disable ct, swtich to set wedge
> ---
>  drivers/gpu/drm/xe/xe_uc.c | 21 ++++++++++++++-------
>  1 file changed, 14 insertions(+), 7 deletions(-)
> 
> diff --git a/drivers/gpu/drm/xe/xe_uc.c b/drivers/gpu/drm/xe/xe_uc.c
> index 3a8751a8b92d..bd1d4e8fab7e 100644
> --- a/drivers/gpu/drm/xe/xe_uc.c
> +++ b/drivers/gpu/drm/xe/xe_uc.c
> @@ -13,6 +13,7 @@
>  #include "xe_gt_printk.h"
>  #include "xe_gt_sriov_vf.h"
>  #include "xe_guc.h"
> +#include "xe_guc_ct.h"
>  #include "xe_guc_pc.h"
>  #include "xe_guc_engine_activity.h"
>  #include "xe_huc.h"
> @@ -157,19 +158,22 @@ static int vf_uc_init_hw(struct xe_uc *uc)
>  
>         err = xe_guc_enable_communication(&uc->guc);
>         if (err)
> -               return err;
> +               goto err_out;
>  
>         err = xe_gt_sriov_vf_connect(uc_to_gt(uc));
>         if (err)
> -               return err;
> +               goto err_out;
>  
>         uc->guc.submission_state.enabled = true;
>  
>         err = xe_gt_record_default_lrcs(uc_to_gt(uc));
>         if (err)
> -               return err;
> +               goto err_out;
>  
>         return 0;
> +err_out:
> +       xe_device_declare_wedged(uc_to_xe(uc));

On the VF side should we be reducing the scope for this? Is there a way
to mark the VF as wedged?

Thanks,
Stuart

> +       return err;
>  }
>  
>  /*
> @@ -197,19 +201,19 @@ int xe_uc_init_hw(struct xe_uc *uc)
>  
>         ret = xe_guc_enable_communication(&uc->guc);
>         if (ret)
> -               return ret;
> +               goto err_out;
>  
>         ret = xe_gt_record_default_lrcs(uc_to_gt(uc));
>         if (ret)
> -               return ret;
> +               goto err_out;
>  
>         ret = xe_guc_post_load_init(&uc->guc);
>         if (ret)
> -               return ret;
> +               goto err_out;
>  
>         ret = xe_guc_pc_start(&uc->guc.pc);
>         if (ret)
> -               return ret;
> +               goto err_out;
>  
>         xe_guc_engine_activity_enable_stats(&uc->guc);
>  
> @@ -221,6 +225,9 @@ int xe_uc_init_hw(struct xe_uc *uc)
>         xe_gsc_load_start(&uc->gsc);
>  
>         return 0;
> +err_out:
> +       xe_device_declare_wedged(uc_to_xe(uc));
> +       return ret;
>  }
>  
>  int xe_uc_fini_hw(struct xe_uc *uc)



More information about the Intel-xe mailing list