Skip to contentSkip to conversation

drm/i915/guc/slpc: Provide sysfs for efficient freq

PATCH Superseded Vinay Belgaumkar 3 participants 6 messages Apr 14, 2023 – Apr 17, 2023

Subsystems (2)

v3 of 6 Superseded Latest is v6 →

lore
Share & tools
lore
#0 lore raw

PATCH v3 1/1 drm/i915/guc/slpc: Provide sysfs for efficient freq

SLPC enables use of efficient freq at init by default. It is possible for GuC to request frequencies that are higher than the 'software' max if user has set it lower than the efficient level.

Scenarios/tests that require strict fixing of freq below the efficient level will need to disable it through this interface.

v2: Keep just one interface to toggle sysfs. With this, user will be completely responsible for toggling efficient frequency if need be. There will be no implicit disabling when user sets min < RP1 (Ashutosh)

v3: Fix compile error

Fixes 95ccf312a1e4 ("drm/i915/guc/slpc: Allow SLPC to use efficient frequency")
---
 drivers/gpu/drm/i915/gt/intel_gt_sysfs_pm.c   | 35 +++++++++++++++
 drivers/gpu/drm/i915/gt/uc/intel_guc_slpc.c   | 43 ++++++++++++++-----
 drivers/gpu/drm/i915/gt/uc/intel_guc_slpc.h   |  1 +
 .../gpu/drm/i915/gt/uc/intel_guc_slpc_types.h |  1 +
 4 files changed, 69 insertions(+), 11 deletions(-)
drivers/gpu/drm/i915/gt/intel_gt_sysfs_pm.c +35 -0
index 28f27091cd3b..7496de5be580 100644
@@ -451,6 +451,33 @@ static ssize_t punit_req_freq_mhz_show(struct kobject *kobj,
 	return sysfs_emit(buff, "%u\n", preq);
 }
 
+static ssize_t slpc_ignore_eff_freq_show(struct kobject *kobj,
+				     struct kobj_attribute *attr,
+				     char *buff)
+{
+	struct intel_gt *gt = intel_gt_sysfs_get_drvdata(kobj, attr->attr.name);
+	struct intel_guc_slpc *slpc = &gt->uc.guc.slpc;
+
+	return sysfs_emit(buff, "%u\n", slpc->ignore_eff_freq);
+}
+
+static ssize_t slpc_ignore_eff_freq_store(struct kobject *kobj,
+					  struct kobj_attribute *attr,
+					  const char *buff, size_t count)
+{
+	struct intel_gt *gt = intel_gt_sysfs_get_drvdata(kobj, attr->attr.name);
+	struct intel_guc_slpc *slpc = &gt->uc.guc.slpc;
+	int err;
+	uint32_t val;
+
+	err = kstrtou32(buff, 0, &val);
+	if (err)
+		return err;
+
+	err = intel_guc_slpc_set_ignore_eff_freq(slpc, val);
+	return err ?: count;
+}
+
 struct intel_gt_bool_throttle_attr {
 	struct attribute attr;
 	ssize_t (*show)(struct kobject *kobj, struct kobj_attribute *attr,
@@ -663,6 +690,8 @@ static struct kobj_attribute attr_media_freq_factor_scale =
 INTEL_GT_ATTR_RO(media_RP0_freq_mhz);
 INTEL_GT_ATTR_RO(media_RPn_freq_mhz);
 
+INTEL_GT_ATTR_RW(slpc_ignore_eff_freq);
+
 static const struct attribute *media_perf_power_attrs[] = {
 	&attr_media_freq_factor.attr,
 	&attr_media_freq_factor_scale.attr,
@@ -744,6 +773,12 @@ void intel_gt_sysfs_pm_init(struct intel_gt *gt, struct kobject *kobj)
 	if (ret)
 		gt_warn(gt, "failed to create punit_req_freq_mhz sysfs (%pe)", ERR_PTR(ret));
 
+	if (intel_uc_uses_guc_slpc(&gt->uc)) {
+		ret = sysfs_create_file(kobj, &attr_slpc_ignore_eff_freq.attr);
+		if (ret)
+			gt_warn(gt, "failed to create ignore_eff_freq sysfs (%pe)", ERR_PTR(ret));
+	}
+
 	if (i915_mmio_reg_valid(intel_gt_perf_limit_reasons_reg(gt))) {
 		ret = sysfs_create_files(kobj, throttle_reason_attrs);
 		if (ret)
drivers/gpu/drm/i915/gt/uc/intel_guc_slpc.c +32 -11

73 lines not on this page · raw message

drivers/gpu/drm/i915/gt/uc/intel_guc_slpc.h +1 -0
index 17ed515f6a85..597eb5413ddf 100644
@@ -46,5 +46,6 @@ void intel_guc_slpc_boost(struct intel_guc_slpc *slpc);
 void intel_guc_slpc_dec_waiters(struct intel_guc_slpc *slpc);
 int intel_guc_slpc_unset_gucrc_mode(struct intel_guc_slpc *slpc);
 int intel_guc_slpc_override_gucrc_mode(struct intel_guc_slpc *slpc, u32 mode);
+int intel_guc_slpc_set_ignore_eff_freq(struct intel_guc_slpc *slpc, bool val);
 
 #endif
drivers/gpu/drm/i915/gt/uc/intel_guc_slpc_types.h +1 -0
index a6ef53b04e04..a88651331497 100644
@@ -31,6 +31,7 @@ struct intel_guc_slpc {
 	/* frequency softlimits */
 	u32 min_freq_softlimit;
 	u32 max_freq_softlimit;
+	bool ignore_eff_freq;
 
 	/* cached media ratio mode */
 	u32 media_ratio_mode;
Signature · 1 line
2.38.1
#1 lore raw

[Intel-gfx] ✗ Fi.CI.CHECKPATCH: warning for drm/i915/guc/slpc: Provide sysfs for efficient freq (rev2)

== Series Details ==

== Series Details ==

Series: drm/i915/guc/slpc: Provide sysfs for efficient freq (rev2)
URL : https://patchwork.freedesktop.org/series/116510/
State : warning

== Summary ==

Error: dim checkpatch failed
86d4ab64d0b0 drm/i915/guc/slpc: Provide sysfs for efficient freq -:33: CHECK:PARENTHESIS_ALIGNMENT: Alignment should match open parenthesis #33: FILE: drivers/gpu/drm/i915/gt/intel_gt_sysfs_pm.c:455:
+static ssize_t slpc_ignore_eff_freq_show(struct kobject *kobj,
+ struct kobj_attribute *attr,

-:49: CHECK:PREFER_KERNEL_TYPES: Prefer kernel type 'u32' over 'uint32_t' #49: FILE: drivers/gpu/drm/i915/gt/intel_gt_sysfs_pm.c:471:
+ uint32_t val;

total: 0 errors, 0 warnings, 2 checks, 139 lines checked

#3 lore raw

[Intel-gfx] ✗ Fi.CI.BAT: failure for drm/i915/guc/slpc: Provide sysfs for efficient freq (rev2)

In reply to Vinay Belgaumkar
== Series Details ==

== Series Details ==

Series: drm/i915/guc/slpc: Provide sysfs for efficient freq (rev2)
URL : https://patchwork.freedesktop.org/series/116510/
State : failure

== Summary ==

CI Bug Log - changes from CI_DRM_13009 -> Patchwork_116510v2
====================================================

Summary
-------

**FAILURE**

Serious unknown changes coming with Patchwork_116510v2 absolutely need to be verified manually.

If you think the reported changes have nothing to do with the changes introduced in Patchwork_116510v2, please notify your bug team to allow them to document this new failure mode, which will reduce false positives in CI.

External URL: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_116510v2/index.html

Participating hosts (37 -> 37)
------------------------------

Additional (1): fi-kbl-soraka
Missing (1): fi-snb-2520m

Possible new issues
-------------------

Here are the unknown changes that may have been introduced in Patchwork_116510v2:

### IGT changes ###

#### Possible regressions ####

* igt@i915_pm_rps@basic-api:
- bat-adlp-9: [PASS][1] -> [FAIL][2]
[1]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_13009/bat-adlp-9/igt@[email protected]
[2]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_116510v2/bat-adlp-9/igt@[email protected]
- bat-adlp-6: [PASS][3] -> [FAIL][4]
[3]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_13009/bat-adlp-6/igt@[email protected]
[4]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_116510v2/bat-adlp-6/igt@[email protected]
- bat-atsm-1: [PASS][5] -> [FAIL][6]
[5]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_13009/bat-atsm-1/igt@[email protected]
[6]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_116510v2/bat-atsm-1/igt@[email protected]

* igt@i915_selftest@live@slpc:
- bat-rpls-1: NOTRUN -> [DMESG-FAIL][7]
[7]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_116510v2/bat-rpls-1/igt@i915_selftest@[email protected]
- bat-dg1-5: [PASS][8] -> [DMESG-FAIL][9]
[8]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_13009/bat-dg1-5/igt@i915_selftest@[email protected]
[9]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_116510v2/bat-dg1-5/igt@i915_selftest@[email protected]
- bat-dg1-7: [PASS][10] -> [DMESG-FAIL][11]
[10]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_13009/bat-dg1-7/igt@i915_selftest@[email protected]
[11]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_116510v2/bat-dg1-7/igt@i915_selftest@[email protected]

#### Warnings ####

* igt@i915_selftest@live@slpc:
- bat-adln-1: [DMESG-FAIL][12] ([i915#6997]) -> [DMESG-FAIL][13]
[12]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_13009/bat-adln-1/igt@i915_selftest@[email protected]
[13]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_116510v2/bat-adln-1/igt@i915_selftest@[email protected]

Known issues
------------

Here are the changes found in Patchwork_116510v2 that come from known issues:

### IGT changes ###

#### Issues hit ####

* igt@gem_exec_suspend@basic-s3@smem:
- bat-rpls-1: NOTRUN -> [ABORT][14] ([i915#6687] / [i915#7978])
[14]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_116510v2/bat-rpls-1/igt@gem_exec_suspend@[email protected]

* igt@gem_huc_copy@huc-copy:
- fi-kbl-soraka: NOTRUN -> [SKIP][15] ([fdo#109271] / [i915#2190])
[15]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_116510v2/fi-kbl-soraka/igt@[email protected]

* igt@gem_lmem_swapping@basic:
- fi-kbl-soraka: NOTRUN -> [SKIP][16] ([fdo#109271] / [i915#4613]) +3 similar issues
[16]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_116510v2/fi-kbl-soraka/igt@[email protected]

* igt@i915_pm_rps@basic-api:
- bat-dg1-7: [PASS][17] -> [FAIL][18] ([i915#8308])
[17]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_13009/bat-dg1-7/igt@[email protected]
[18]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_116510v2/bat-dg1-7/igt@[email protected]
- bat-rpls-2: [PASS][19] -> [FAIL][20] ([i915#8308])
[19]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_13009/bat-rpls-2/igt@[email protected]
[20]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_116510v2/bat-rpls-2/igt@[email protected]
- bat-rplp-1: [PASS][21] -> [FAIL][22] ([i915#8308])
[21]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_13009/bat-rplp-1/igt@[email protected]
[22]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_116510v2/bat-rplp-1/igt@[email protected]
- bat-dg1-5: [PASS][23] -> [FAIL][24] ([i915#8308])
[23]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_13009/bat-dg1-5/igt@[email protected]
[24]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_116510v2/bat-dg1-5/igt@[email protected]
- bat-dg2-9: [PASS][25] -> [FAIL][26] ([i915#8308])
[25]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_13009/bat-dg2-9/igt@[email protected]
[26]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_116510v2/bat-dg2-9/igt@[email protected]
- bat-adln-1: [PASS][27] -> [FAIL][28] ([i915#8308])
[27]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_13009/bat-adln-1/igt@[email protected]
[28]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_116510v2/bat-adln-1/igt@[email protected]
- bat-dg2-8: [PASS][29] -> [FAIL][30] ([i915#8308])
[29]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_13009/bat-dg2-8/igt@[email protected]
[30]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_116510v2/bat-dg2-8/igt@[email protected]
- bat-rpls-1: [PASS][31] -> [FAIL][32] ([i915#8308])
[31]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_13009/bat-rpls-1/igt@[email protected]
[32]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_116510v2/bat-rpls-1/igt@[email protected]

* igt@i915_selftest@live@gt_pm:
- fi-kbl-soraka: NOTRUN -> [DMESG-FAIL][33] ([i915#1886])
[33]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_116510v2/fi-kbl-soraka/igt@i915_selftest@live@gt_pm.html

* igt@i915_selftest@live@hangcheck:
- bat-dg2-11: [PASS][34] -> [ABORT][35] ([i915#7913] / [i915#7979])
[34]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_13009/bat-dg2-11/igt@i915_selftest@[email protected]
[35]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_116510v2/bat-dg2-11/igt@i915_selftest@[email protected]

* igt@i915_selftest@live@migrate:
- bat-dg2-11: [PASS][36] -> [DMESG-WARN][37] ([i915#7699])
[36]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_13009/bat-dg2-11/igt@i915_selftest@[email protected]
[37]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_116510v2/bat-dg2-11/igt@i915_selftest@[email protected]

* igt@i915_selftest@live@requests:
- bat-rpls-2: [PASS][38] -> [ABORT][39] ([i915#4983] / [i915#7913])
[38]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_13009/bat-rpls-2/igt@i915_selftest@[email protected]
[39]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_116510v2/bat-rpls-2/igt@i915_selftest@[email protected]

* igt@i915_selftest@live@slpc:
- bat-atsm-1: [PASS][40] -> [DMESG-FAIL][41] ([i915#7913])
[40]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_13009/bat-atsm-1/igt@i915_selftest@[email protected]
[41]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_116510v2/bat-atsm-1/igt@i915_selftest@[email protected]
- bat-adlp-6: [PASS][42] -> [DMESG-FAIL][43] ([i915#7913])
[42]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_13009/bat-adlp-6/igt@i915_selftest@[email protected]
[43]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_116510v2/bat-adlp-6/igt@i915_selftest@[email protected]
- bat-adlp-9: [PASS][44] -> [DMESG-FAIL][45] ([i915#7913])
[44]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_13009/bat-adlp-9/igt@i915_selftest@[email protected]
[45]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_116510v2/bat-adlp-9/igt@i915_selftest@[email protected]
- bat-rplp-1: [PASS][46] -> [DMESG-FAIL][47] ([i915#7913])
[46]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_13009/bat-rplp-1/igt@i915_selftest@[email protected]
[47]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_116510v2/bat-rplp-1/igt@i915_selftest@[email protected]

* igt@kms_chamelium_frames@hdmi-crc-fast:
- fi-kbl-soraka: NOTRUN -> [SKIP][48] ([fdo#109271]) +16 similar issues
[48]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_116510v2/fi-kbl-soraka/igt@[email protected]

* igt@kms_pipe_crc_basic@read-crc:
- bat-adlp-9: NOTRUN -> [SKIP][49] ([i915#3546]) +1 similar issue
[49]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_116510v2/bat-adlp-9/igt@[email protected]

#### Possible fixes ####

* igt@i915_selftest@live@migrate:
- bat-atsm-1: [DMESG-FAIL][50] ([i915#7699]) -> [PASS][51]
[50]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_13009/bat-atsm-1/igt@i915_selftest@[email protected]
[51]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_116510v2/bat-atsm-1/igt@i915_selftest@[email protected]

* igt@i915_selftest@live@mman:
- bat-rpls-1: [TIMEOUT][52] ([i915#6794]) -> [PASS][53]
[52]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_13009/bat-rpls-1/igt@i915_selftest@[email protected]
[53]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_116510v2/bat-rpls-1/igt@i915_selftest@[email protected]

* igt@i915_suspend@basic-s3-without-i915:
- bat-rpls-1: [ABORT][54] ([i915#6687] / [i915#7978]) -> [PASS][55]
[54]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_13009/bat-rpls-1/igt@[email protected]
[55]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_116510v2/bat-rpls-1/igt@[email protected]

* igt@kms_pipe_crc_basic@nonblocking-crc-frame-sequence@pipe-c-dp-1:
- bat-dg2-8: [FAIL][56] ([i915#7932]) -> [PASS][57] +1 similar issue
[56]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_13009/bat-dg2-8/igt@kms_pipe_crc_basic@[email protected]
[57]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_116510v2/bat-dg2-8/igt@kms_pipe_crc_basic@[email protected]

[fdo#109271]: https://bugs.freedesktop.org/show_bug.cgi?id=109271
[i915#1886]: https://gitlab.freedesktop.org/drm/intel/issues/1886
[i915#2190]: https://gitlab.freedesktop.org/drm/intel/issues/2190
[i915#3546]: https://gitlab.freedesktop.org/drm/intel/issues/3546
[i915#4613]: https://gitlab.freedesktop.org/drm/intel/issues/4613
[i915#4983]: https://gitlab.freedesktop.org/drm/intel/issues/4983
[i915#6687]: https://gitlab.freedesktop.org/drm/intel/issues/6687
[i915#6794]: https://gitlab.freedesktop.org/drm/intel/issues/6794
[i915#6997]: https://gitlab.freedesktop.org/drm/intel/issues/6997
[i915#7699]: https://gitlab.freedesktop.org/drm/intel/issues/7699
[i915#7913]: https://gitlab.freedesktop.org/drm/intel/issues/7913
[i915#7932]: https://gitlab.freedesktop.org/drm/intel/issues/7932
[i915#7978]: https://gitlab.freedesktop.org/drm/intel/issues/7978
[i915#7979]: https://gitlab.freedesktop.org/drm/intel/issues/7979
[i915#8308]: https://gitlab.freedesktop.org/drm/intel/issues/8308

Build changes
-------------

* Linux: CI_DRM_13009 -> Patchwork_116510v2

CI-20190529: 20190529
CI_DRM_13009: 766ccc538115e757a747d12d1bf7a714d1424ae5 @ git://anongit.freedesktop.org/gfx-ci/linux
IGT_7256: 066fa5410180730b85f61e4f3073da9a2055dc49 @ https://gitlab.freedesktop.org/drm/igt-gpu-tools.git
Patchwork_116510v2: 766ccc538115e757a747d12d1bf7a714d1424ae5 @ git://anongit.freedesktop.org/gfx-ci/linux

### Linux commits

485bb14437e4 drm/i915/guc/slpc: Provide sysfs for efficient freq

== Logs ==

For more details see: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_116510v2/index.html

Reviewed-by on v3 1/1
#4 lore raw
In reply to Vinay Belgaumkar

drivers/gpu/drm/i915/gt/uc/intel_guc_slpc.c int intel_guc_slpc_get_max_freq(struct intel_guc_slpc *slpc, u32 *val) · line 467

Quoted 12 lines · Vinay Belgaumkar
drivers/gpu/drm/i915/gt/uc/intel_guc_slpc.c +7 -0
@@ -457,6 +458,34 @@ int intel_guc_slpc_get_max_freq(struct intel_guc_slpc *slpc, u32 *val)
 	return ret;
 }
 
+int intel_guc_slpc_set_ignore_eff_freq(struct intel_guc_slpc *slpc, bool val)
+{
+	struct drm_i915_private *i915 = slpc_to_i915(slpc);
+	intel_wakeref_t wakeref;
+	int ret = 0;
+
+	/* Need a lock now since waitboost can be modifying min as well */

Delete comment.

drivers/gpu/drm/i915/gt/uc/intel_guc_slpc.c int intel_guc_slpc_get_max_freq(struct intel_guc_slpc *slpc, u32 *val) · line 468

Quoted 1 line
drivers/gpu/drm/i915/gt/uc/intel_guc_slpc.c +1 -0
+	mutex_lock(&slpc->lock);

Actually, don't need the lock itself now so delete the lock.

Or, maybe the lock prevents the race if userspace writes to the sysfs when GuC reset is going on so let's retain the lock. But the comment is wrong.

drivers/gpu/drm/i915/gt/uc/intel_guc_slpc.c int intel_guc_slpc_get_max_freq(struct intel_guc_slpc *slpc, u32 *val) · line 471

Quoted 3 lines
drivers/gpu/drm/i915/gt/uc/intel_guc_slpc.c +3 -0
+	wakeref = intel_runtime_pm_get(&i915->runtime_pm);
+
+	/* Ignore efficient freq if lower min freq is requested */

Delete comment, it's wrong.

drivers/gpu/drm/i915/gt/uc/intel_guc_slpc.c int intel_guc_slpc_get_max_freq(struct intel_guc_slpc *slpc, u32 *val) · line 482

Quoted 11 lines
drivers/gpu/drm/i915/gt/uc/intel_guc_slpc.c +11 -0
+	ret = slpc_set_param(slpc,
+			     SLPC_PARAM_IGNORE_EFFICIENT_FREQUENCY,
+			     val);
+	if (ret) {
+		guc_probe_error(slpc_to_guc(slpc), "Failed to set efficient freq(%d): %pe\n",
+				val, ERR_PTR(ret));
+		goto out;
+	}
+
+	slpc->ignore_eff_freq = val;
+

This extra line can also be deleted.

Quoted 13 lines
drivers/gpu/drm/i915/gt/uc/intel_guc_slpc.c +6 -0
+out:
+	intel_runtime_pm_put(&i915->runtime_pm, wakeref);
+	mutex_unlock(&slpc->lock);
+	return ret;
+}
+
 /**
  * intel_guc_slpc_set_min_freq() - Set min frequency limit for SLPC.
  * @slpc: pointer to intel_guc_slpc.
@@ -482,16 +511,6 @@ int intel_guc_slpc_set_min_freq(struct intel_guc_slpc *slpc, u32 val)
 	mutex_lock(&slpc->lock);
 	wakeref = intel_runtime_pm_get(&i915->runtime_pm);
 

drivers/gpu/drm/i915/gt/uc/intel_guc_slpc.c int intel_guc_slpc_set_min_freq(struct intel_guc_slpc *slpc, u32 val) · line 494

Quoted 10 lines
drivers/gpu/drm/i915/gt/uc/intel_guc_slpc.c +0 -10
-	/* Ignore efficient freq if lower min freq is requested */
-	ret = slpc_set_param(slpc,
-			     SLPC_PARAM_IGNORE_EFFICIENT_FREQUENCY,
-			     val < slpc->rp1_freq);
-	if (ret) {
-		guc_probe_error(slpc_to_guc(slpc), "Failed to toggle efficient freq: %pe\n",
-				ERR_PTR(ret));
-		goto out;
-	}
-

Great, thanks!

After taking care of the above, and seems there are also a couple of checkpatch errors, this is:

#5 lore raw
Quoted 5 lines · Ashutosh
Quoted 4 lines · Vinay Belgaumkar
drivers/gpu/drm/i915/gt/uc/intel_guc_slpc.c +0 -0
@@ -457,6 +458,34 @@ int intel_guc_slpc_get_max_freq(struct intel_guc_slpc *slpc, u32 *val)
 	return ret;
  }
 
Quoted 8 lines

drivers/gpu/drm/i915/gt/uc/intel_guc_slpc.c int intel_guc_slpc_get_max_freq(struct intel_guc_slpc *slpc, u32 *val) · line 467

Quoted 7 lines
drivers/gpu/drm/i915/gt/uc/intel_guc_slpc.c +7 -0
+int intel_guc_slpc_set_ignore_eff_freq(struct intel_guc_slpc *slpc, bool val)
+{
+	struct drm_i915_private *i915 = slpc_to_i915(slpc);
+	intel_wakeref_t wakeref;
+	int ret = 0;
+
+	/* Need a lock now since waitboost can be modifying min as well */

Delete comment.

ok.

Quoted 5 lines

drivers/gpu/drm/i915/gt/uc/intel_guc_slpc.c int intel_guc_slpc_get_max_freq(struct intel_guc_slpc *slpc, u32 *val) · line 468

Quoted 1 line
drivers/gpu/drm/i915/gt/uc/intel_guc_slpc.c +1 -0
+	mutex_lock(&slpc->lock);

Actually, don't need the lock itself now so delete the lock.

Or, maybe the lock prevents the race if userspace writes to the sysfs when GuC reset is going on so let's retain the lock. But the comment is wrong.

yup, ok.

Quoted 5 lines

drivers/gpu/drm/i915/gt/uc/intel_guc_slpc.c int intel_guc_slpc_get_max_freq(struct intel_guc_slpc *slpc, u32 *val) · line 471

Quoted 4 lines
drivers/gpu/drm/i915/gt/uc/intel_guc_slpc.c +3 -0
+	wakeref = intel_runtime_pm_get(&i915->runtime_pm);
+
+	/* Ignore efficient freq if lower min freq is requested */

Delete comment, it's wrong.

ok.

Quoted 13 lines

drivers/gpu/drm/i915/gt/uc/intel_guc_slpc.c int intel_guc_slpc_get_max_freq(struct intel_guc_slpc *slpc, u32 *val) · line 482

Quoted 12 lines
drivers/gpu/drm/i915/gt/uc/intel_guc_slpc.c +11 -0
+	ret = slpc_set_param(slpc,
+			     SLPC_PARAM_IGNORE_EFFICIENT_FREQUENCY,
+			     val);
+	if (ret) {
+		guc_probe_error(slpc_to_guc(slpc), "Failed to set efficient freq(%d): %pe\n",
+				val, ERR_PTR(ret));
+		goto out;
+	}
+
+	slpc->ignore_eff_freq = val;
+

This extra line can also be deleted.

ok.

Quoted 26 lines
Quoted 14 lines
drivers/gpu/drm/i915/gt/uc/intel_guc_slpc.c +6 -0
+out:
+	intel_runtime_pm_put(&i915->runtime_pm, wakeref);
+	mutex_unlock(&slpc->lock);
+	return ret;
+}
+
  /**
   * intel_guc_slpc_set_min_freq() - Set min frequency limit for SLPC.
   * @slpc: pointer to intel_guc_slpc.
@@ -482,16 +511,6 @@ int intel_guc_slpc_set_min_freq(struct intel_guc_slpc *slpc, u32 val)
 	mutex_lock(&slpc->lock);
 	wakeref = intel_runtime_pm_get(&i915->runtime_pm);
 

drivers/gpu/drm/i915/gt/uc/intel_guc_slpc.c int intel_guc_slpc_set_min_freq(struct intel_guc_slpc *slpc, u32 val) · line 494

Quoted 10 lines
drivers/gpu/drm/i915/gt/uc/intel_guc_slpc.c +0 -10
-	/* Ignore efficient freq if lower min freq is requested */
-	ret = slpc_set_param(slpc,
-			     SLPC_PARAM_IGNORE_EFFICIENT_FREQUENCY,
-			     val < slpc->rp1_freq);
-	if (ret) {
-		guc_probe_error(slpc_to_guc(slpc), "Failed to toggle efficient freq: %pe\n",
-				ERR_PTR(ret));
-		goto out;
-	}
-

Great, thanks!

Quoted 4 lines

After taking care of the above, and seems there are also a couple of checkpatch errors, this is:

Thanks,

Vinay.