Skip to contentSkip to conversation

drm/i915/hwmon: Use 0 to designate disabled PL1 power limit

PATCH Superseded Ashutosh Dixit 3 participants 7 messages Mar 28, 2023 – Mar 31, 2023

Subsystems (2)

v1 of 3 Superseded Latest is v3 →

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 drm/i915/hwmon: Use 0 to designate disabled PL1 power limit

On ATSM the PL1 limit is disabled at power up. The previous uapi assumed that the PL1 limit is always enabled and therefore did not have a notion of a disabled PL1 limit. This results in erroneous PL1 limit values when the PL1 limit is disabled. For example at power up, the disabled ATSM PL1 limit was previously shown as 0 which means a low PL1 limit whereas the limit being disabled actually implies a high effective PL1 limit value.

To get round this problem, the PL1 limit uapi is expanded to include a special value 0 to designate a disabled PL1 limit.

---
 .../ABI/testing/sysfs-driver-intel-i915-hwmon |  3 ++-
 drivers/gpu/drm/i915/i915_hwmon.c             | 24 +++++++++++++++++++
 2 files changed, 26 insertions(+), 1 deletion(-)
Documentation/ABI/testing/sysfs-driver-intel-i915-hwmon +2 -1
index 2d6a472eef885..96fec0bb74c2c 100644
@@ -14,7 +14,8 @@ Description:	RW. Card reactive sustained  (PL1/Tau) power limit in microwatts.
 
 		The power controller will throttle the operating frequency
 		if the power averaged over a window (typically seconds)
-		exceeds this limit.
+		exceeds this limit. A read value of 0 means that the PL1 power
+		limit is disabled. Writing 0 disables the limit if possible.
 
 		Only supported for particular Intel i915 graphics platforms.
 
drivers/gpu/drm/i915/i915_hwmon.c +24 -0
index 596dd2c070106..c099057888914 100644
@@ -349,6 +349,8 @@ hwm_power_is_visible(const struct hwm_drvdata *ddat, u32 attr, int chan)
 	}
 }
 
+#define PL1_DISABLE 0
+
 /*
  * HW allows arbitrary PL1 limits to be set but silently clamps these values to
  * "typical but not guaranteed" min/max values in rg.pkg_power_sku. Follow the
@@ -362,6 +364,14 @@ hwm_power_max_read(struct hwm_drvdata *ddat, long *val)
 	intel_wakeref_t wakeref;
 	u64 r, min, max;
 
+	/* Check if PL1 limit is disabled */
+	with_intel_runtime_pm(ddat->uncore->rpm, wakeref)
+		r = intel_uncore_read(ddat->uncore, hwmon->rg.pkg_rapl_limit);
+	if (!(r & PKG_PWR_LIM_1_EN)) {
+		*val = PL1_DISABLE;
+		return 0;
+	}
+
 	*val = hwm_field_read_and_scale(ddat,
 					hwmon->rg.pkg_rapl_limit,
 					PKG_PWR_LIM_1,
@@ -385,8 +395,22 @@ static int
 hwm_power_max_write(struct hwm_drvdata *ddat, long val)
 {
 	struct i915_hwmon *hwmon = ddat->hwmon;
+	intel_wakeref_t wakeref;
 	u32 nval;
 
+	if (val == PL1_DISABLE) {
+		/* Disable PL1 limit */
+		hwm_locked_with_pm_intel_uncore_rmw(ddat, hwmon->rg.pkg_rapl_limit,
+						    PKG_PWR_LIM_1_EN, 0);
+
+		/* Verify, because PL1 limit cannot be disabled on all platforms */
+		with_intel_runtime_pm(ddat->uncore->rpm, wakeref)
+			nval = intel_uncore_read(ddat->uncore, hwmon->rg.pkg_rapl_limit);
+		if (nval & PKG_PWR_LIM_1_EN)
+			return -EPERM;
+		return 0;
+	}
+
 	/* Computation in 64-bits to avoid overflow. Round to nearest. */
 	nval = DIV_ROUND_CLOSEST_ULL((u64)val << hwmon->scl_shift_power, SF_POWER);
 	nval = PKG_PWR_LIM_1_EN | REG_FIELD_PREP(PKG_PWR_LIM_1, nval);
Signature · 1 line
2.38.0
#1 lore raw

[Intel-gfx] ✗ Fi.CI.CHECKPATCH: warning for drm/i915/hwmon: Use 0 to designate disabled PL1 power limit

== Series Details ==

== Series Details ==

Series: drm/i915/hwmon: Use 0 to designate disabled PL1 power limit
URL : https://patchwork.freedesktop.org/series/115749/
State : warning

== Summary ==

Error: dim checkpatch failed
53e9cd9d9794 drm/i915/hwmon: Use 0 to designate disabled PL1 power limit -:16: WARNING:COMMIT_LOG_USE_LINK: Unknown link reference 'Bug:', use 'Link:' instead #16:

-:17: WARNING:COMMIT_LOG_USE_LINK: Unknown link reference 'Bug:', use 'Link:' instead #17:

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

#2 lore raw

[Intel-gfx] ✓ Fi.CI.BAT: success for drm/i915/hwmon: Use 0 to designate disabled PL1 power limit

In reply to Ashutosh Dixit
== Series Details ==

== Series Details ==

Series: drm/i915/hwmon: Use 0 to designate disabled PL1 power limit
URL : https://patchwork.freedesktop.org/series/115749/
State : success

== Summary ==

CI Bug Log - changes from CI_DRM_12931 -> Patchwork_115749v1
====================================================

Summary
-------

**SUCCESS**

No regressions found.

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

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

Additional (1): fi-kbl-soraka

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

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

### IGT changes ###

#### Issues hit ####

* igt@gem_exec_suspend@basic-s0@smem:
- bat-rpls-2: [PASS][1] -> [ABORT][2] ([i915#6687])
[1]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_12931/bat-rpls-2/igt@gem_exec_suspend@[email protected]
[2]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_115749v1/bat-rpls-2/igt@gem_exec_suspend@[email protected]

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

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

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

* igt@i915_selftest@live@gt_lrc:
- bat-dg2-11: [PASS][8] -> [INCOMPLETE][9] ([i915#7609] / [i915#7913])
[8]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_12931/bat-dg2-11/igt@i915_selftest@live@gt_lrc.html
[9]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_115749v1/bat-dg2-11/igt@i915_selftest@live@gt_lrc.html

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

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

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

* igt@kms_pipe_crc_basic@nonblocking-crc-frame-sequence:
- bat-dg2-11: NOTRUN -> [SKIP][14] ([i915#5354])
[14]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_115749v1/bat-dg2-11/igt@[email protected]

* igt@kms_setmode@basic-clone-single-crtc:
- fi-skl-guc: NOTRUN -> [SKIP][15] ([fdo#109271]) +19 similar issues
[15]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_115749v1/fi-skl-guc/igt@[email protected]

#### Possible fixes ####

* igt@i915_module_load@load:
- fi-skl-guc: [ABORT][16] -> [PASS][17]
[16]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_12931/fi-skl-guc/igt@[email protected]
[17]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_115749v1/fi-skl-guc/igt@[email protected]

#### Warnings ####

* igt@i915_selftest@live@slpc:
- bat-rpls-2: [DMESG-FAIL][18] ([i915#6367] / [i915#7913]) -> [DMESG-FAIL][19] ([i915#6997] / [i915#7913])
[18]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_12931/bat-rpls-2/igt@i915_selftest@[email protected]
[19]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_115749v1/bat-rpls-2/igt@i915_selftest@[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#4613]: https://gitlab.freedesktop.org/drm/intel/issues/4613
[i915#5354]: https://gitlab.freedesktop.org/drm/intel/issues/5354
[i915#6367]: https://gitlab.freedesktop.org/drm/intel/issues/6367
[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#7609]: https://gitlab.freedesktop.org/drm/intel/issues/7609
[i915#7913]: https://gitlab.freedesktop.org/drm/intel/issues/7913
[i915#7978]: https://gitlab.freedesktop.org/drm/intel/issues/7978

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

* Linux: CI_DRM_12931 -> Patchwork_115749v1

CI-20190529: 20190529
CI_DRM_12931: e1b8055e62c6f94ef94db3e7f125704ac0fab0b5 @ git://anongit.freedesktop.org/gfx-ci/linux
IGT_7223: 2cbfa210fc95d126edf9a60ae6ab4e96cf4fca7f @ https://gitlab.freedesktop.org/drm/igt-gpu-tools.git
Patchwork_115749v1: e1b8055e62c6f94ef94db3e7f125704ac0fab0b5 @ git://anongit.freedesktop.org/gfx-ci/linux

### Linux commits

63469035e427 drm/i915/hwmon: Use 0 to designate disabled PL1 power limit

== Logs ==

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

#3 lore raw

[Intel-gfx] ✓ Fi.CI.IGT: success for drm/i915/hwmon: Use 0 to designate disabled PL1 power limit

In reply to Ashutosh Dixit
== Series Details ==

== Series Details ==

Series: drm/i915/hwmon: Use 0 to designate disabled PL1 power limit
URL : https://patchwork.freedesktop.org/series/115749/
State : success

== Summary ==

CI Bug Log - changes from CI_DRM_12931_full -> Patchwork_115749v1_full
====================================================

Summary
-------

**SUCCESS**

No regressions found.

Participating hosts (7 -> 7)
------------------------------

No changes in participating hosts

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

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

### IGT changes ###

#### Issues hit ####

* igt@gem_exec_fair@basic-deadline:
- shard-glk: [PASS][1] -> [FAIL][2] ([i915#2846])
[1]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_12931/shard-glk2/igt@[email protected]
[2]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_115749v1/shard-glk9/igt@[email protected]

* igt@gem_exec_fair@basic-none-solo@rcs0:
- shard-apl: [PASS][3] -> [FAIL][4] ([i915#2842]) +1 similar issue
[3]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_12931/shard-apl6/igt@gem_exec_fair@[email protected]
[4]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_115749v1/shard-apl4/igt@gem_exec_fair@[email protected]

* igt@gem_exec_fair@basic-pace-share@rcs0:
- shard-glk: [PASS][5] -> [FAIL][6] ([i915#2842])
[5]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_12931/shard-glk9/igt@gem_exec_fair@[email protected]
[6]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_115749v1/shard-glk2/igt@gem_exec_fair@[email protected]

* igt@gem_lmem_swapping@parallel-random-engines:
- shard-glk: NOTRUN -> [SKIP][7] ([fdo#109271] / [i915#4613])
[7]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_115749v1/shard-glk7/igt@[email protected]

* igt@gen9_exec_parse@allowed-all:
- shard-glk: [PASS][8] -> [ABORT][9] ([i915#5566]) +1 similar issue
[8]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_12931/shard-glk7/igt@[email protected]
[9]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_115749v1/shard-glk5/igt@[email protected]

* igt@kms_ccs@pipe-b-bad-rotation-90-y_tiled_gen12_rc_ccs_cc:
- shard-glk: NOTRUN -> [SKIP][10] ([fdo#109271] / [i915#3886])
[10]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_115749v1/shard-glk7/igt@kms_ccs@pipe-b-bad-rotation-90-y_tiled_gen12_rc_ccs_cc.html

* igt@kms_flip@2x-flip-vs-expired-vblank-interruptible@ab-hdmi-a1-hdmi-a2:
- shard-glk: [PASS][11] -> [FAIL][12] ([i915#79])
[11]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_12931/shard-glk1/igt@kms_flip@[email protected]
[12]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_115749v1/shard-glk8/igt@kms_flip@[email protected]

* igt@kms_flip_scaled_crc@flip-64bpp-yftile-to-16bpp-yftile-upscaling@pipe-a-valid-mode:
- shard-glk: NOTRUN -> [SKIP][13] ([fdo#109271]) +52 similar issues
[13]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_115749v1/shard-glk7/igt@kms_flip_scaled_crc@flip-64bpp-yftile-to-16bpp-yftile-upscaling@pipe-a-valid-mode.html

* igt@kms_psr2_su@frontbuffer-xrgb8888:
- shard-glk: NOTRUN -> [SKIP][14] ([fdo#109271] / [i915#658])
[14]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_115749v1/shard-glk7/igt@[email protected]

#### Possible fixes ####

* igt@gem_exec_endless@dispatch@vcs1:
- {shard-tglu}: [TIMEOUT][15] ([i915#3778]) -> [PASS][16]
[15]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_12931/shard-tglu-9/igt@gem_exec_endless@[email protected]
[16]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_115749v1/shard-tglu-10/igt@gem_exec_endless@[email protected]

* igt@kms_addfb_basic@size-max:
- {shard-dg1}: [DMESG-WARN][17] -> [PASS][18]
[17]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_12931/shard-dg1-17/igt@[email protected]
[18]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_115749v1/shard-dg1-14/igt@[email protected]

* igt@kms_flip@2x-plain-flip-fb-recreate-interruptible@ac-hdmi-a1-hdmi-a2:
- shard-glk: [FAIL][19] ([i915#2122]) -> [PASS][20]
[19]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_12931/shard-glk3/igt@kms_flip@[email protected]
[20]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_115749v1/shard-glk6/igt@kms_flip@[email protected]

* {igt@perf@stress-open-close@0-rcs0}:
- shard-glk: [ABORT][21] ([i915#5213]) -> [PASS][22]
[21]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_12931/shard-glk3/igt@perf@[email protected]
[22]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_115749v1/shard-glk7/igt@perf@[email protected]

{name}: This element is suppressed. This means it is ignored when computing
the status of the difference (SUCCESS, WARNING, or FAILURE).

[IGT#2]: https://gitlab.freedesktop.org/drm/igt-gpu-tools/issues/2
[fdo#109271]: https://bugs.freedesktop.org/show_bug.cgi?id=109271
[fdo#109289]: https://bugs.freedesktop.org/show_bug.cgi?id=109289
[fdo#109307]: https://bugs.freedesktop.org/show_bug.cgi?id=109307
[fdo#109309]: https://bugs.freedesktop.org/show_bug.cgi?id=109309
[fdo#109506]: https://bugs.freedesktop.org/show_bug.cgi?id=109506
[fdo#111068]: https://bugs.freedesktop.org/show_bug.cgi?id=111068
[fdo#111615]: https://bugs.freedesktop.org/show_bug.cgi?id=111615
[fdo#111825]: https://bugs.freedesktop.org/show_bug.cgi?id=111825
[fdo#111827]: https://bugs.freedesktop.org/show_bug.cgi?id=111827
[i915#1072]: https://gitlab.freedesktop.org/drm/intel/issues/1072
[i915#1755]: https://gitlab.freedesktop.org/drm/intel/issues/1755
[i915#1839]: https://gitlab.freedesktop.org/drm/intel/issues/1839
[i915#2122]: https://gitlab.freedesktop.org/drm/intel/issues/2122
[i915#2434]: https://gitlab.freedesktop.org/drm/intel/issues/2434
[i915#2527]: https://gitlab.freedesktop.org/drm/intel/issues/2527
[i915#2575]: https://gitlab.freedesktop.org/drm/intel/issues/2575
[i915#2587]: https://gitlab.freedesktop.org/drm/intel/issues/2587
[i915#2672]: https://gitlab.freedesktop.org/drm/intel/issues/2672
[i915#280]: https://gitlab.freedesktop.org/drm/intel/issues/280
[i915#2842]: https://gitlab.freedesktop.org/drm/intel/issues/2842
[i915#2846]: https://gitlab.freedesktop.org/drm/intel/issues/2846
[i915#3281]: https://gitlab.freedesktop.org/drm/intel/issues/3281
[i915#3282]: https://gitlab.freedesktop.org/drm/intel/issues/3282
[i915#3297]: https://gitlab.freedesktop.org/drm/intel/issues/3297
[i915#3318]: https://gitlab.freedesktop.org/drm/intel/issues/3318
[i915#3359]: https://gitlab.freedesktop.org/drm/intel/issues/3359
[i915#3458]: https://gitlab.freedesktop.org/drm/intel/issues/3458
[i915#3528]: https://gitlab.freedesktop.org/drm/intel/issues/3528
[i915#3539]: https://gitlab.freedesktop.org/drm/intel/issues/3539
[i915#3555]: https://gitlab.freedesktop.org/drm/intel/issues/3555
[i915#3638]: https://gitlab.freedesktop.org/drm/intel/issues/3638
[i915#3689]: https://gitlab.freedesktop.org/drm/intel/issues/3689
[i915#3708]: https://gitlab.freedesktop.org/drm/intel/issues/3708
[i915#3778]: https://gitlab.freedesktop.org/drm/intel/issues/3778
[i915#3886]: https://gitlab.freedesktop.org/drm/intel/issues/3886
[i915#3989]: https://gitlab.freedesktop.org/drm/intel/issues/3989
[i915#404]: https://gitlab.freedesktop.org/drm/intel/issues/404
[i915#4077]: https://gitlab.freedesktop.org/drm/intel/issues/4077
[i915#4078]: https://gitlab.freedesktop.org/drm/intel/issues/4078
[i915#4079]: https://gitlab.freedesktop.org/drm/intel/issues/4079
[i915#4083]: https://gitlab.freedesktop.org/drm/intel/issues/4083
[i915#4103]: https://gitlab.freedesktop.org/drm/intel/issues/4103
[i915#4212]: https://gitlab.freedesktop.org/drm/intel/issues/4212
[i915#4213]: https://gitlab.freedesktop.org/drm/intel/issues/4213
[i915#426]: https://gitlab.freedesktop.org/drm/intel/issues/426
[i915#4270]: https://gitlab.freedesktop.org/drm/intel/issues/4270
[i915#4387]: https://gitlab.freedesktop.org/drm/intel/issues/4387
[i915#4538]: https://gitlab.freedesktop.org/drm/intel/issues/4538
[i915#454]: https://gitlab.freedesktop.org/drm/intel/issues/454
[i915#4565]: https://gitlab.freedesktop.org/drm/intel/issues/4565
[i915#4579]: https://gitlab.freedesktop.org/drm/intel/issues/4579
[i915#4613]: https://gitlab.freedesktop.org/drm/intel/issues/4613
[i915#4771]: https://gitlab.freedesktop.org/drm/intel/issues/4771
[i915#4812]: https://gitlab.freedesktop.org/drm/intel/issues/4812
[i915#4818]: https://gitlab.freedesktop.org/drm/intel/issues/4818
[i915#4833]: https://gitlab.freedesktop.org/drm/intel/issues/4833
[i915#4852]: https://gitlab.freedesktop.org/drm/intel/issues/4852
[i915#4880]: https://gitlab.freedesktop.org/drm/intel/issues/4880
[i915#5176]: https://gitlab.freedesktop.org/drm/intel/issues/5176
[i915#5213]: https://gitlab.freedesktop.org/drm/intel/issues/5213
[i915#5286]: https://gitlab.freedesktop.org/drm/intel/issues/5286
[i915#5289]: https://gitlab.freedesktop.org/drm/intel/issues/5289
[i915#5325]: https://gitlab.freedesktop.org/drm/intel/issues/5325
[i915#5563]: https://gitlab.freedesktop.org/drm/intel/issues/5563
[i915#5566]: https://gitlab.freedesktop.org/drm/intel/issues/5566
[i915#6095]: https://gitlab.freedesktop.org/drm/intel/issues/6095
[i915#6227]: https://gitlab.freedesktop.org/drm/intel/issues/6227
[i915#6301]: https://gitlab.freedesktop.org/drm/intel/issues/6301
[i915#6334]: https://gitlab.freedesktop.org/drm/intel/issues/6334
[i915#6433]: https://gitlab.freedesktop.org/drm/intel/issues/6433
[i915#6493]: https://gitlab.freedesktop.org/drm/intel/issues/6493
[i915#658]: https://gitlab.freedesktop.org/drm/intel/issues/658
[i915#7116]: https://gitlab.freedesktop.org/drm/intel/issues/7116
[i915#7561]: https://gitlab.freedesktop.org/drm/intel/issues/7561
[i915#7697]: https://gitlab.freedesktop.org/drm/intel/issues/7697
[i915#7711]: https://gitlab.freedesktop.org/drm/intel/issues/7711
[i915#7828]: https://gitlab.freedesktop.org/drm/intel/issues/7828
[i915#79]: https://gitlab.freedesktop.org/drm/intel/issues/79
[i915#8011]: https://gitlab.freedesktop.org/drm/intel/issues/8011
[i915#8292]: https://gitlab.freedesktop.org/drm/intel/issues/8292

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

* Linux: CI_DRM_12931 -> Patchwork_115749v1

CI-20190529: 20190529
CI_DRM_12931: e1b8055e62c6f94ef94db3e7f125704ac0fab0b5 @ git://anongit.freedesktop.org/gfx-ci/linux
IGT_7223: 2cbfa210fc95d126edf9a60ae6ab4e96cf4fca7f @ https://gitlab.freedesktop.org/drm/igt-gpu-tools.git
Patchwork_115749v1: e1b8055e62c6f94ef94db3e7f125704ac0fab0b5 @ git://anongit.freedesktop.org/gfx-ci/linux
piglit_4509: fdc5a4ca11124ab8413c7988896eec4c97336694 @ git://anongit.freedesktop.org/piglit

== Logs ==

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

#4 lore raw
In reply to Ashutosh Dixit
Quoted 10 lines · Ashutosh Dixit

On ATSM the PL1 limit is disabled at power up. The previous uapi assumed that the PL1 limit is always enabled and therefore did not have a notion of a disabled PL1 limit. This results in erroneous PL1 limit values when the PL1 limit is disabled. For example at power up, the disabled ATSM PL1 limit was previously shown as 0 which means a low PL1 limit whereas the limit being disabled actually implies a high effective PL1 limit value.

To get round this problem, the PL1 limit uapi is expanded to include a special value 0 to designate a disabled PL1 limit.

This patch is another attempt to show when the PL1 power limit is disabled and to disable it when it needs to. Previous abandoned attempts to do this are [1] and [2].

The preferred way to do this was [2] but that was NAK'd by hwmon folks (see [2]). That is why here we fall back on the approach in [1].

This patch is identical to [1] except that the value used to disable the PL1 limit has been changed to 0 (from -1 in [1]) as was suggested in [2] (both -1 and 0 seem ok for the purpose).

Quoted 2 lines

The link between this patch and these pretty serious bugs might not be immediately clear so here's an explanation:

* Because on ATSM the PL1 power limit is disabled on power up and there were no means to enable it, in 6fd3d8bf89fc we implemented the means to enable the limit when the PL1 hwmon entry (power1_max) was written to.

* Now there is an IGT igt@i915_hwmon@hwmon_write which (a) reads orig value from all hwmon sysfs (b) does a bunch of random writes and finally (c) restores the orig value read. On ATSM since the orig value was 0, when the IGT restores the 0 value, the PL1 limit is now enabled with a value of 0.

* PL1 limit of 0 implies a low PL1 limit which causes GPU freq to fall to 100 MHz. This causes GuC FW load and several IGT's to start timing out and gives rise the above (and even more) bugs about GuC FW load timing out.

* After this patch, writing 0 would disable the PL1 limit instead of enabling it, avoiding the freq drop issue above, and resolving this Intel CI issue.

Thanks.
--
Ashutosh

[1] https://patchwork.freedesktop.org/patch/522612/?series=113972&rev=1
[2] https://patchwork.freedesktop.org/patch/522652/?series=113984&rev=1

maintainer Reviewed-by
#5 lore raw
Quoted 12 lines · Ashutosh
Quoted 10 lines · Ashutosh Dixit

On ATSM the PL1 limit is disabled at power up. The previous uapi assumed that the PL1 limit is always enabled and therefore did not have a notion of a disabled PL1 limit. This results in erroneous PL1 limit values when the PL1 limit is disabled. For example at power up, the disabled ATSM PL1 limit was previously shown as 0 which means a low PL1 limit whereas the limit being disabled actually implies a high effective PL1 limit value.

To get round this problem, the PL1 limit uapi is expanded to include a special value 0 to designate a disabled PL1 limit.

Quoted 6 lines

This patch is another attempt to show when the PL1 power limit is disabled and to disable it when it needs to. Previous abandoned attempts to do this are [1] and [2].

The preferred way to do this was [2] but that was NAK'd by hwmon folks (see [2]). That is why here we fall back on the approach in [1].

I still don't get it, but let's move on...

Quoted 21 lines

This patch is identical to [1] except that the value used to disable the PL1 limit has been changed to 0 (from -1 in [1]) as was suggested in [2] (both -1 and 0 seem ok for the purpose).

Quoted 2 lines

The link between this patch and these pretty serious bugs might not be immediately clear so here's an explanation:

* Because on ATSM the PL1 power limit is disabled on power up and there were no means to enable it, in 6fd3d8bf89fc we implemented the means to enable the limit when the PL1 hwmon entry (power1_max) was written to.

* Now there is an IGT igt@i915_hwmon@hwmon_write which (a) reads orig value from all hwmon sysfs (b) does a bunch of random writes and finally (c) restores the orig value read. On ATSM since the orig value was 0, when the IGT restores the 0 value, the PL1 limit is now enabled with a value of 0.

Quoted 4 lines

* PL1 limit of 0 implies a low PL1 limit which causes GPU freq to fall to 100 MHz. This causes GuC FW load and several IGT's to start timing out and gives rise the above (and even more) bugs about GuC FW load timing out.

I believe these 3 bullets are key information that deserves to be in the commit message itself.

With that there,

Quoted 11 lines

* After this patch, writing 0 would disable the PL1 limit instead of enabling it, avoiding the freq drop issue above, and resolving this Intel CI issue.

Thanks.
--
Ashutosh

[1] https://patchwork.freedesktop.org/patch/522612/?series=113972&rev=1
[2] https://patchwork.freedesktop.org/patch/522652/?series=113984&rev=1

#6 lore raw
Quoted 44 lines · Rodrigo Vivi
Quoted 12 lines · Ashutosh
Quoted 10 lines · Ashutosh Dixit

On ATSM the PL1 limit is disabled at power up. The previous uapi assumed that the PL1 limit is always enabled and therefore did not have a notion of a disabled PL1 limit. This results in erroneous PL1 limit values when the PL1 limit is disabled. For example at power up, the disabled ATSM PL1 limit was previously shown as 0 which means a low PL1 limit whereas the limit being disabled actually implies a high effective PL1 limit value.

To get round this problem, the PL1 limit uapi is expanded to include a special value 0 to designate a disabled PL1 limit.

Quoted 6 lines

This patch is another attempt to show when the PL1 power limit is disabled and to disable it when it needs to. Previous abandoned attempts to do this are [1] and [2].

The preferred way to do this was [2] but that was NAK'd by hwmon folks (see [2]). That is why here we fall back on the approach in [1].

I still don't get it, but let's move on...

Quoted 21 lines

This patch is identical to [1] except that the value used to disable the PL1 limit has been changed to 0 (from -1 in [1]) as was suggested in [2] (both -1 and 0 seem ok for the purpose).

Quoted 2 lines

The link between this patch and these pretty serious bugs might not be immediately clear so here's an explanation:

* Because on ATSM the PL1 power limit is disabled on power up and there were no means to enable it, in 6fd3d8bf89fc we implemented the means to enable the limit when the PL1 hwmon entry (power1_max) was written to.

* Now there is an IGT igt@i915_hwmon@hwmon_write which (a) reads orig value from all hwmon sysfs (b) does a bunch of random writes and finally (c) restores the orig value read. On ATSM since the orig value was 0, when the IGT restores the 0 value, the PL1 limit is now enabled with a value of 0.

Quoted 7 lines
Quoted 4 lines

* PL1 limit of 0 implies a low PL1 limit which causes GPU freq to fall to 100 MHz. This causes GuC FW load and several IGT's to start timing out and gives rise the above (and even more) bugs about GuC FW load timing out.

I believe these 3 bullets are key information that deserves to be in the commit message itself.

Done in v2.

Quoted 4 lines

With that there,

Thanks.
--
Ashutosh

Quoted 13 lines
Quoted 13 lines

* After this patch, writing 0 would disable the PL1 limit instead of enabling it, avoiding the freq drop issue above, and resolving this Intel CI issue.

Thanks.
--
Ashutosh

[1] https://patchwork.freedesktop.org/patch/522612/?series=113972&rev=1
[2] https://patchwork.freedesktop.org/patch/522652/?series=113984&rev=1