Unverified Commit 20baedb8 authored by Michal Wajdeczko's avatar Michal Wajdeczko Committed by Rodrigo Vivi
Browse files

drm/xe/vf: Skip attempt to start GuC PC if VF



We have already marked the GuC PC feature as not applicable for
VF devices, but we missed the fact that there may be still some
privileged activities performed by this component, who does much
more than its name suggests.

Explicitly skip xe_guc_pc_start() if running as a VF driver and
use a GT oriented message to report any error.

v2: also skip xe_guc_pc_stop (Vinay)

Signed-off-by: default avatarMichal Wajdeczko <michal.wajdeczko@intel.com>
Cc: Vinay Belgaumkar <vinay.belgaumkar@intel.com>
Cc: Matthew Brost <matthew.brost@intel.com>
Reviewed-by: default avatarVinay Belgaumkar <vinay.belgaumkar@intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20240622094253.1081-1-michal.wajdeczko@intel.com


Signed-off-by: default avatarRodrigo Vivi <rodrigo.vivi@intel.com>
parent 7e5161da
Loading
Loading
Loading
Loading
+13 −4
Original line number Diff line number Diff line
@@ -1113,7 +1113,13 @@ void xe_guc_reset_wait(struct xe_guc *guc)

void xe_guc_stop_prepare(struct xe_guc *guc)
{
	XE_WARN_ON(xe_guc_pc_stop(&guc->pc));
	if (!IS_SRIOV_VF(guc_to_xe(guc))) {
		int err;

		err = xe_guc_pc_stop(&guc->pc);
		xe_gt_WARN(guc_to_gt(guc), err, "Failed to stop GuC PC: %pe\n",
			   ERR_PTR(err));
	}
}

void xe_guc_stop(struct xe_guc *guc)
@@ -1125,10 +1131,13 @@ void xe_guc_stop(struct xe_guc *guc)

int xe_guc_start(struct xe_guc *guc)
{
	int ret;
	if (!IS_SRIOV_VF(guc_to_xe(guc))) {
		int err;

	ret = xe_guc_pc_start(&guc->pc);
	XE_WARN_ON(ret);
		err = xe_guc_pc_start(&guc->pc);
		xe_gt_WARN(guc_to_gt(guc), err, "Failed to start GuC PC: %pe\n",
			   ERR_PTR(err));
	}

	return xe_guc_submit_start(guc);
}