]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
drm/xe/vf: Don't check CTC_MODE[0] if VF
authorMichal Wajdeczko <michal.wajdeczko@intel.com>
Tue, 11 Mar 2025 11:40:41 +0000 (12:40 +0100)
committerLucas De Marchi <lucas.demarchi@intel.com>
Wed, 26 Mar 2025 03:51:09 +0000 (20:51 -0700)
Starting from commit 18778b5fdd01 ("drm/xe: Eliminate usage of
TIMESTAMP_OVERRIDE") we access the CTC_MODE register only to warn
if it has undocumented value.  There is no point in doing that on
the VF driver.  While here, move this check to a helper function.

Signed-off-by: Michal Wajdeczko <michal.wajdeczko@intel.com>
Cc: Matt Roper <matthew.d.roper@intel.com>
Reviewed-by: Matt Roper <matthew.d.roper@intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20250311114042.1954-2-michal.wajdeczko@intel.com
(cherry picked from commit fce3fb7b914bcd19341de8d8eff8bef371c2cddf)
Signed-off-by: Lucas De Marchi <lucas.demarchi@intel.com>
drivers/gpu/drm/xe/xe_gt_clock.c

index 2a958c92d8ea9306217b3bde4971bb558fe512d3..fca38738e610c0a4e4627c8faaafb48fb51b7e96 100644 (file)
@@ -40,11 +40,8 @@ static u32 get_crystal_clock_freq(u32 rpm_config_reg)
        }
 }
 
-int xe_gt_clock_init(struct xe_gt *gt)
+static void check_ctc_mode(struct xe_gt *gt)
 {
-       u32 c0 = xe_mmio_read32(&gt->mmio, RPM_CONFIG0);
-       u32 freq = 0;
-
        /*
         * CTC_MODE[0] = 1 is definitely not supported for Xe2 and later
         * platforms.  In theory it could be a valid setting for pre-Xe2
@@ -57,7 +54,17 @@ int xe_gt_clock_init(struct xe_gt *gt)
         */
        if (xe_mmio_read32(&gt->mmio, CTC_MODE) & CTC_SOURCE_DIVIDE_LOGIC)
                xe_gt_warn(gt, "CTC_MODE[0] is set; this is unexpected and undocumented\n");
+}
+
+int xe_gt_clock_init(struct xe_gt *gt)
+{
+       u32 freq;
+       u32 c0;
+
+       if (!IS_SRIOV_VF(gt_to_xe(gt)))
+               check_ctc_mode(gt);
 
+       c0 = xe_mmio_read32(&gt->mmio, RPM_CONFIG0);
        freq = get_crystal_clock_freq(c0);
 
        /*