Skip to content

Commit 4fa752a

Browse files
mwajdeczlucasdemarchi
authored andcommitted
drm/xe/vf: Don't check CTC_MODE[0] if VF
Starting from commit 18778b5 ("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 fce3fb7) Signed-off-by: Lucas De Marchi <lucas.demarchi@intel.com>
1 parent 488975c commit 4fa752a

File tree

1 file changed

+11
-4
lines changed

1 file changed

+11
-4
lines changed

drivers/gpu/drm/xe/xe_gt_clock.c

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -40,11 +40,8 @@ static u32 get_crystal_clock_freq(u32 rpm_config_reg)
4040
}
4141
}
4242

43-
int xe_gt_clock_init(struct xe_gt *gt)
43+
static void check_ctc_mode(struct xe_gt *gt)
4444
{
45-
u32 c0 = xe_mmio_read32(&gt->mmio, RPM_CONFIG0);
46-
u32 freq = 0;
47-
4845
/*
4946
* CTC_MODE[0] = 1 is definitely not supported for Xe2 and later
5047
* 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)
5754
*/
5855
if (xe_mmio_read32(&gt->mmio, CTC_MODE) & CTC_SOURCE_DIVIDE_LOGIC)
5956
xe_gt_warn(gt, "CTC_MODE[0] is set; this is unexpected and undocumented\n");
57+
}
58+
59+
int xe_gt_clock_init(struct xe_gt *gt)
60+
{
61+
u32 freq;
62+
u32 c0;
63+
64+
if (!IS_SRIOV_VF(gt_to_xe(gt)))
65+
check_ctc_mode(gt);
6066

67+
c0 = xe_mmio_read32(&gt->mmio, RPM_CONFIG0);
6168
freq = get_crystal_clock_freq(c0);
6269

6370
/*

0 commit comments

Comments
 (0)