[PATCH] drm/xe/guc: Disable ct on xe micro hardware init error
Michal Wajdeczko
michal.wajdeczko at intel.com
Wed Jun 4 08:48:47 UTC 2025
On 04.06.2025 01:45, Zhanjun Dong wrote:
> Disable ct if xe micro controller hardware init failed.
s/ct/GuC communication
s/xe/Xe
s/init/initialization
>
> Signed-off-by: Zhanjun Dong <zhanjun.dong at intel.com>
> Closes: https://gitlab.freedesktop.org/drm/xe/kernel/-/issues/4917
> ---
> drivers/gpu/drm/xe/xe_uc.c | 16 ++++++++++------
> 1 file changed, 10 insertions(+), 6 deletions(-)
>
> diff --git a/drivers/gpu/drm/xe/xe_uc.c b/drivers/gpu/drm/xe/xe_uc.c
> index 3a8751a8b92d..ba72c1b30f2f 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"
> @@ -189,27 +190,27 @@ int xe_uc_init_hw(struct xe_uc *uc)
while possibly it's not a problem today, can you also update
vf_uc_init_hw() to have same logic in both variants?
>
> ret = xe_huc_upload(&uc->huc);
> if (ret)
> - return ret;
> + goto err;
>
> ret = xe_guc_upload(&uc->guc);
> if (ret)
> - return ret;
> + goto err;
before below line it doesn't make any sense to do cleanup and disable
communication as it was not enabled yet
>
> ret = xe_guc_enable_communication(&uc->guc);
> if (ret)
> - return ret;
> + goto err;
>
> ret = xe_gt_record_default_lrcs(uc_to_gt(uc));
> if (ret)
> - return ret;
> + goto err;
>
> ret = xe_guc_post_load_init(&uc->guc);
> if (ret)
> - return ret;
> + goto err;
>
> ret = xe_guc_pc_start(&uc->guc.pc);
> if (ret)
> - return ret;
> + goto err;
>
> xe_guc_engine_activity_enable_stats(&uc->guc);
>
> @@ -221,6 +222,9 @@ int xe_uc_init_hw(struct xe_uc *uc)
> xe_gsc_load_start(&uc->gsc);
>
> return 0;
> +err:
> + xe_guc_ct_disable(&uc->guc.ct);
it's little unclear and unbalanced since above we have potentially
larger scope xe_guc_enable_communication(), not just xe_guc_ct_enable()
can you add xe_guc_disable_communication() wrapper to have right pair of
enable/disable functions like we have elsewhere ?
> + return ret;
> }
>
> int xe_uc_fini_hw(struct xe_uc *uc)
More information about the Intel-xe
mailing list