]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
drm/xe/pf: Relax report helper to accept PF in bulk configs
authorMichal Wajdeczko <michal.wajdeczko@intel.com>
Thu, 30 Oct 2025 22:23:37 +0000 (23:23 +0100)
committerMichal Wajdeczko <michal.wajdeczko@intel.com>
Fri, 31 Oct 2025 19:01:38 +0000 (20:01 +0100)
Our current bulk configuration requests are only about VFs, but
we want to add new functions that will also include PF configs.
Update our bulk report helper to accept also PFID as first VFID.

Signed-off-by: Michal Wajdeczko <michal.wajdeczko@intel.com>
Reviewed-by: Lucas De Marchi <lucas.demarchi@intel.com>
Link: https://patch.msgid.link/20251030222348.186658-7-michal.wajdeczko@intel.com
drivers/gpu/drm/xe/xe_gt_sriov_pf_config.c

index ce733bde43e3fffa3f20fea32eaf5e52b61dea6f..169f975ade5681187037eeb141076f54b6b3f93f 100644 (file)
@@ -924,7 +924,8 @@ static int pf_config_bulk_set_u32_done(struct xe_gt *gt, unsigned int first, uns
                                       const char *what, const char *(*unit)(u32),
                                       unsigned int last, int err)
 {
-       xe_gt_assert(gt, first);
+       char name[8];
+
        xe_gt_assert(gt, num_vfs);
        xe_gt_assert(gt, first <= last);
 
@@ -932,8 +933,9 @@ static int pf_config_bulk_set_u32_done(struct xe_gt *gt, unsigned int first, uns
                return pf_config_set_u32_done(gt, first, value, get(gt, first), what, unit, err);
 
        if (unlikely(err)) {
-               xe_gt_sriov_notice(gt, "Failed to bulk provision VF%u..VF%u with %s\n",
-                                  first, first + num_vfs - 1, what);
+               xe_gt_sriov_notice(gt, "Failed to bulk provision %s..VF%u with %s\n",
+                                  xe_sriov_function_name(first, name, sizeof(name)),
+                                  first + num_vfs - 1, what);
                if (last > first)
                        pf_config_bulk_set_u32_done(gt, first, last - first, value,
                                                    get, what, unit, last, 0);
@@ -942,8 +944,9 @@ static int pf_config_bulk_set_u32_done(struct xe_gt *gt, unsigned int first, uns
 
        /* pick actual value from first VF - bulk provisioning shall be equal across all VFs */
        value = get(gt, first);
-       xe_gt_sriov_info(gt, "VF%u..VF%u provisioned with %u%s %s\n",
-                        first, first + num_vfs - 1, value, unit(value), what);
+       xe_gt_sriov_info(gt, "%s..VF%u provisioned with %u%s %s\n",
+                        xe_sriov_function_name(first, name, sizeof(name)),
+                        first + num_vfs - 1, value, unit(value), what);
        return 0;
 }