]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
drm/xe/uc: Disable GuC communication on hardware initialization error
authorZhanjun Dong <zhanjun.dong@intel.com>
Mon, 7 Jul 2025 23:11:08 +0000 (19:11 -0400)
committerMatthew Brost <matthew.brost@intel.com>
Tue, 8 Jul 2025 21:56:49 +0000 (14:56 -0700)
Disable GuC communication on Xe micro controller hardware initialization
error.

Closes: https://gitlab.freedesktop.org/drm/xe/kernel/-/issues/4917
Reviewed-by: Jonathan Cavitt <jonathan.cavitt@intel.com>
Reviewed-by: Matthew Brost <matthew.brost@intel.com>
Signed-off-by: Zhanjun Dong <zhanjun.dong@intel.com>
Signed-off-by: Matthew Brost <matthew.brost@intel.com>
Link: https://lore.kernel.org/r/20250707231108.3217573-1-zhanjun.dong@intel.com
drivers/gpu/drm/xe/xe_guc.c
drivers/gpu/drm/xe/xe_uc.c

index 8573957facaeeac180e0a2bec758baf4bd061156..b1d1d6da37581ea1468bfa953455b6b27b9beef0 100644 (file)
@@ -1219,13 +1219,17 @@ static int vf_guc_min_load_for_hwconfig(struct xe_guc *guc)
 
        ret = xe_gt_sriov_vf_connect(gt);
        if (ret)
-               return ret;
+               goto err_out;
 
        ret = xe_gt_sriov_vf_query_runtime(gt);
        if (ret)
-               return ret;
+               goto err_out;
 
        return 0;
+
+err_out:
+       xe_guc_sanitize(guc);
+       return ret;
 }
 
 /**
index 6431ba3a2c53797e4121d6473915178a80a1b479..3e0c3af235f276f345237cd09b50b5fc2387edbe 100644 (file)
@@ -158,7 +158,7 @@ static int vf_uc_load_hw(struct xe_uc *uc)
 
        err = xe_gt_sriov_vf_connect(uc_to_gt(uc));
        if (err)
-               return err;
+               goto err_out;
 
        uc->guc.submission_state.enabled = true;
 
@@ -168,9 +168,13 @@ static int vf_uc_load_hw(struct xe_uc *uc)
 
        err = xe_gt_record_default_lrcs(uc_to_gt(uc));
        if (err)
-               return err;
+               goto err_out;
 
        return 0;
+
+err_out:
+       xe_guc_sanitize(&uc->guc);
+       return err;
 }
 
 /*
@@ -202,15 +206,15 @@ int xe_uc_load_hw(struct xe_uc *uc)
 
        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);
 
@@ -222,6 +226,10 @@ int xe_uc_load_hw(struct xe_uc *uc)
        xe_gsc_load_start(&uc->gsc);
 
        return 0;
+
+err_out:
+       xe_guc_sanitize(&uc->guc);
+       return ret;
 }
 
 int xe_uc_reset_prepare(struct xe_uc *uc)