Commit b2c4ac21 authored by Zhanjun Dong's avatar Zhanjun Dong Committed by Matthew Brost
Browse files

drm/xe/uc: Disable GuC communication on hardware initialization error

parent 83dcee17
Loading
Loading
Loading
Loading
+6 −2
Original line number Diff line number Diff line
@@ -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;
}

/**
+13 −5
Original line number Diff line number Diff line
@@ -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)