]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
drm/xe/pf: Reprovision policy settings after GT reset
authorMichal Wajdeczko <michal.wajdeczko@intel.com>
Thu, 2 Apr 2026 19:17:18 +0000 (21:17 +0200)
committerMichal Wajdeczko <michal.wajdeczko@intel.com>
Sun, 12 Apr 2026 08:32:48 +0000 (10:32 +0200)
In addition to the reprovisioning of individual VFs configurations,
we should also reprovision GuC global policy settings. Note that we
already had a draft function for that but we missed to call it once
we started handling GT reset. Reuse it now but don't take extra RPM
as this is now a caller responsibility and drop unused parameter.

Signed-off-by: Michal Wajdeczko <michal.wajdeczko@intel.com>
Reviewed-by: Piotr Piórkowski <piotr.piorkowski@intel.com>
Link: https://patch.msgid.link/20260402191726.4932-6-michal.wajdeczko@intel.com
drivers/gpu/drm/xe/xe_gt_sriov_pf.c
drivers/gpu/drm/xe/xe_gt_sriov_pf_policy.c
drivers/gpu/drm/xe/xe_gt_sriov_pf_policy.h

index fb5c9101e2756a2957dd5d5a236450542034f489..7868056841b3c8842462f8cd8fda35a914942751 100644 (file)
@@ -219,6 +219,7 @@ static void pf_restart(struct xe_gt *gt)
 
        xe_gt_assert(gt, !xe_pm_runtime_suspended(xe));
 
+       xe_gt_sriov_pf_policy_restart(gt);
        xe_gt_sriov_pf_config_restart(gt);
        xe_gt_sriov_pf_control_restart(gt);
 
index c88c4e6a9b61a091686eca3ecb64f6077c1e9531..aa80b4abd42fdadcf1bc24b6c041f84fbef89324 100644 (file)
@@ -17,7 +17,6 @@
 #include "xe_guc_ct.h"
 #include "xe_guc_klv_helpers.h"
 #include "xe_guc_submit.h"
-#include "xe_pm.h"
 
 /*
  * Return: number of KLVs that were successfully parsed and saved,
@@ -692,30 +691,23 @@ void xe_gt_sriov_pf_policy_sanitize(struct xe_gt *gt)
 }
 
 /**
- * xe_gt_sriov_pf_policy_reprovision - Reprovision (and optionally reset) policy settings.
+ * xe_gt_sriov_pf_policy_restart() - Reprovision policy settings.
  * @gt: the &xe_gt
- * @reset: if true will reprovision using default values instead of latest
  *
  * This function can only be called on PF.
  *
  * Return: 0 on success or a negative error code on failure.
  */
-int xe_gt_sriov_pf_policy_reprovision(struct xe_gt *gt, bool reset)
+int xe_gt_sriov_pf_policy_restart(struct xe_gt *gt)
 {
        int err = 0;
 
-       xe_pm_runtime_get_noresume(gt_to_xe(gt));
+       guard(mutex)(xe_gt_sriov_pf_master_mutex(gt));
 
-       mutex_lock(xe_gt_sriov_pf_master_mutex(gt));
-       if (reset)
-               pf_sanitize_guc_policies(gt);
        err |= pf_reprovision_sched_if_idle(gt);
        err |= pf_reprovision_reset_engine(gt);
        err |= pf_reprovision_sample_period(gt);
        err |= pf_reprovision_sched_groups(gt);
-       mutex_unlock(xe_gt_sriov_pf_master_mutex(gt));
-
-       xe_pm_runtime_put(gt_to_xe(gt));
 
        return err ? -ENXIO : 0;
 }
index bd73aa58f9ca7f2869870c8404c0347c218fe14a..c9d4c4aaaf5da53fcc707f501c9c09a97be2d4a0 100644 (file)
@@ -29,7 +29,7 @@ bool xe_gt_sriov_pf_policy_sched_groups_enabled(struct xe_gt *gt);
 
 void xe_gt_sriov_pf_policy_init(struct xe_gt *gt);
 void xe_gt_sriov_pf_policy_sanitize(struct xe_gt *gt);
-int xe_gt_sriov_pf_policy_reprovision(struct xe_gt *gt, bool reset);
+int xe_gt_sriov_pf_policy_restart(struct xe_gt *gt);
 int xe_gt_sriov_pf_policy_print(struct xe_gt *gt, struct drm_printer *p);
 
 #endif