Skip to content

Commit b2c4ac2

Browse files
zhanjunmbrost05
authored andcommitted
drm/xe/uc: Disable GuC communication on hardware initialization error
Disable GuC communication on Xe micro controller hardware initialization error. Closes: https://gitlab.freedesktop.org/drm/xe/kernel/-/issues/4917 Reviewed-by: Jonathan Cavitt <[email protected]> Reviewed-by: Matthew Brost <[email protected]> Signed-off-by: Zhanjun Dong <[email protected]> Signed-off-by: Matthew Brost <[email protected]> Link: https://lore.kernel.org/r/[email protected]
1 parent 83dcee1 commit b2c4ac2

File tree

2 files changed

+19
-7
lines changed

2 files changed

+19
-7
lines changed

drivers/gpu/drm/xe/xe_guc.c

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1219,13 +1219,17 @@ static int vf_guc_min_load_for_hwconfig(struct xe_guc *guc)
12191219

12201220
ret = xe_gt_sriov_vf_connect(gt);
12211221
if (ret)
1222-
return ret;
1222+
goto err_out;
12231223

12241224
ret = xe_gt_sriov_vf_query_runtime(gt);
12251225
if (ret)
1226-
return ret;
1226+
goto err_out;
12271227

12281228
return 0;
1229+
1230+
err_out:
1231+
xe_guc_sanitize(guc);
1232+
return ret;
12291233
}
12301234

12311235
/**

drivers/gpu/drm/xe/xe_uc.c

Lines changed: 13 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -158,7 +158,7 @@ static int vf_uc_load_hw(struct xe_uc *uc)
158158

159159
err = xe_gt_sriov_vf_connect(uc_to_gt(uc));
160160
if (err)
161-
return err;
161+
goto err_out;
162162

163163
uc->guc.submission_state.enabled = true;
164164

@@ -168,9 +168,13 @@ static int vf_uc_load_hw(struct xe_uc *uc)
168168

169169
err = xe_gt_record_default_lrcs(uc_to_gt(uc));
170170
if (err)
171-
return err;
171+
goto err_out;
172172

173173
return 0;
174+
175+
err_out:
176+
xe_guc_sanitize(&uc->guc);
177+
return err;
174178
}
175179

176180
/*
@@ -202,15 +206,15 @@ int xe_uc_load_hw(struct xe_uc *uc)
202206

203207
ret = xe_gt_record_default_lrcs(uc_to_gt(uc));
204208
if (ret)
205-
return ret;
209+
goto err_out;
206210

207211
ret = xe_guc_post_load_init(&uc->guc);
208212
if (ret)
209-
return ret;
213+
goto err_out;
210214

211215
ret = xe_guc_pc_start(&uc->guc.pc);
212216
if (ret)
213-
return ret;
217+
goto err_out;
214218

215219
xe_guc_engine_activity_enable_stats(&uc->guc);
216220

@@ -222,6 +226,10 @@ int xe_uc_load_hw(struct xe_uc *uc)
222226
xe_gsc_load_start(&uc->gsc);
223227

224228
return 0;
229+
230+
err_out:
231+
xe_guc_sanitize(&uc->guc);
232+
return ret;
225233
}
226234

227235
int xe_uc_reset_prepare(struct xe_uc *uc)

0 commit comments

Comments
 (0)