Skip to content

Commit 7738be9

Browse files
ashutoshxrodrigovivi
authored andcommitted
drm/i915/gt: Perf_limit_reasons are only available for Gen11+
Register GT0_PERF_LIMIT_REASONS (0x1381a8) is available only for Gen11+. Therefore ensure perf_limit_reasons sysfs files are created only for Gen11+. Otherwise on Gen < 5 accessing these files results in the following oops: <1> [88.829420] BUG: unable to handle page fault for address: ffffc90000bb81a8 <1> [88.829438] #PF: supervisor read access in kernel mode <1> [88.829447] #PF: error_code(0x0000) - not-present page This patch is a backport of the drm-tip commit 0d2d201 ("drm/i915: Perf_limit_reasons are only available for Gen11+") to drm-intel-fixes. The backport is not identical to the original, it only includes the sysfs portions of if. The debugfs portion is not available in drm-intel-fixes so has not been backported. Bspec: 20008 Bug: https://gitlab.freedesktop.org/drm/intel/-/issues/6863 Fixes: fa68bff ("drm/i915/gt: Add sysfs throttle frequency interfaces") Signed-off-by: Ashutosh Dixit <[email protected]> Reviewed-by: Rodrigo Vivi <[email protected]> Signed-off-by: Rodrigo Vivi <[email protected]> Link: https://patchwork.freedesktop.org/patch/msgid/[email protected] (backported from commit 0d2d201)
1 parent 6ef7d36 commit 7738be9

File tree

1 file changed

+11
-4
lines changed

1 file changed

+11
-4
lines changed

drivers/gpu/drm/i915/gt/intel_gt_sysfs_pm.c

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -545,8 +545,7 @@ static INTEL_GT_RPS_BOOL_ATTR_RO(throttle_reason_ratl, RATL_MASK);
545545
static INTEL_GT_RPS_BOOL_ATTR_RO(throttle_reason_vr_thermalert, VR_THERMALERT_MASK);
546546
static INTEL_GT_RPS_BOOL_ATTR_RO(throttle_reason_vr_tdc, VR_TDC_MASK);
547547

548-
static const struct attribute *freq_attrs[] = {
549-
&dev_attr_punit_req_freq_mhz.attr,
548+
static const struct attribute *throttle_reason_attrs[] = {
550549
&attr_throttle_reason_status.attr,
551550
&attr_throttle_reason_pl1.attr,
552551
&attr_throttle_reason_pl2.attr,
@@ -763,12 +762,20 @@ void intel_gt_sysfs_pm_init(struct intel_gt *gt, struct kobject *kobj)
763762
if (!is_object_gt(kobj))
764763
return;
765764

766-
ret = sysfs_create_files(kobj, freq_attrs);
765+
ret = sysfs_create_file(kobj, &dev_attr_punit_req_freq_mhz.attr);
767766
if (ret)
768767
drm_warn(&gt->i915->drm,
769-
"failed to create gt%u throttle sysfs files (%pe)",
768+
"failed to create gt%u punit_req_freq_mhz sysfs (%pe)",
770769
gt->info.id, ERR_PTR(ret));
771770

771+
if (GRAPHICS_VER(gt->i915) >= 11) {
772+
ret = sysfs_create_files(kobj, throttle_reason_attrs);
773+
if (ret)
774+
drm_warn(&gt->i915->drm,
775+
"failed to create gt%u throttle sysfs files (%pe)",
776+
gt->info.id, ERR_PTR(ret));
777+
}
778+
772779
if (HAS_MEDIA_RATIO_MODE(gt->i915) && intel_uc_uses_guc_slpc(&gt->uc)) {
773780
ret = sysfs_create_files(kobj, media_perf_power_attrs);
774781
if (ret)

0 commit comments

Comments
 (0)