]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
drm/xe/pf: Resend PF provisioning after GT reset
authorMichal Wajdeczko <michal.wajdeczko@intel.com>
Fri, 11 Jul 2025 19:33:12 +0000 (21:33 +0200)
committerMichal Wajdeczko <michal.wajdeczko@intel.com>
Tue, 15 Jul 2025 11:05:17 +0000 (13:05 +0200)
If we reload the GuC due to suspend/resume or GT reset then we
have to resend not only any VFs provisioning data, but also PF
configuration, like scheduling parameters (EQ, PT), as otherwise
GuC will continue to use default values.

Fixes: 411220808cee ("drm/xe/pf: Restart VFs provisioning after GT reset")
Signed-off-by: Michal Wajdeczko <michal.wajdeczko@intel.com>
Reviewed-by: Piotr Piórkowski <piotr.piorkowski@intel.com>
Link: https://lore.kernel.org/r/20250711193316.1920-3-michal.wajdeczko@intel.com
drivers/gpu/drm/xe/xe_gt_sriov_pf_config.c

index 9ba9dc7c4ee939e3591dcb45d9bfa89f7f7ff626..79b364fbe06d9ccdb5c0b9ba1e7c0b18abb03d39 100644 (file)
@@ -2366,6 +2366,21 @@ int xe_gt_sriov_pf_config_restore(struct xe_gt *gt, unsigned int vfid,
        return err;
 }
 
+static int pf_push_self_config(struct xe_gt *gt)
+{
+       int err;
+
+       err = pf_push_full_vf_config(gt, PFID);
+       if (err) {
+               xe_gt_sriov_err(gt, "Failed to push self configuration (%pe)\n",
+                               ERR_PTR(err));
+               return err;
+       }
+
+       xe_gt_sriov_dbg_verbose(gt, "self configuration completed\n");
+       return 0;
+}
+
 static void fini_config(void *arg)
 {
        struct xe_gt *gt = arg;
@@ -2389,9 +2404,17 @@ static void fini_config(void *arg)
 int xe_gt_sriov_pf_config_init(struct xe_gt *gt)
 {
        struct xe_device *xe = gt_to_xe(gt);
+       int err;
 
        xe_gt_assert(gt, IS_SRIOV_PF(xe));
 
+       mutex_lock(xe_gt_sriov_pf_master_mutex(gt));
+       err = pf_push_self_config(gt);
+       mutex_unlock(xe_gt_sriov_pf_master_mutex(gt));
+
+       if (err)
+               return err;
+
        return devm_add_action_or_reset(xe->drm.dev, fini_config, gt);
 }
 
@@ -2409,6 +2432,10 @@ void xe_gt_sriov_pf_config_restart(struct xe_gt *gt)
        unsigned int n, total_vfs = xe_sriov_pf_get_totalvfs(gt_to_xe(gt));
        unsigned int fail = 0, skip = 0;
 
+       mutex_lock(xe_gt_sriov_pf_master_mutex(gt));
+       pf_push_self_config(gt);
+       mutex_unlock(xe_gt_sriov_pf_master_mutex(gt));
+
        for (n = 1; n <= total_vfs; n++) {
                if (xe_gt_sriov_pf_config_is_empty(gt, n))
                        skip++;