Skip to contentSkip to conversation

drm/i915/selftest/gsc: Ensure GSC Proxy init completes before selftests

PATCH Superseded Alan Previn 3 participants 7 messages May 30, 2023 – Jun 8, 2023

Subsystems (2)

v2 of 7 Superseded Latest is v7 →

lore
Share & tools
lore
#0 lore raw

PATCH v2 1/1 drm/i915/selftest/gsc: Ensure GSC Proxy init completes before selftests

On MTL, if the GSC Proxy init flows haven't completed, submissions to the GSC engine will fail. Those init flows are dependent on the mei's gsc_proxy component that is loaded in parallel with i915 and a worker that could potentially start after i915 driver init is done.

That said, all subsytems that access the GSC engine today does check for such init flow completion before using the GSC engine. However, selftests currently don't wait on anything before starting.

To fix this, add a waiter function at the start of __run_selftests that waits for gsc-proxy init flows to complete. While implementing this, use an table of function pointers so its scalable to add additional waiter functions for future such "wait on dependency" cases that.

Difference from prior versions:
v1: Based on internal testing, increase the timeout for gsc-proxy
specific case to 8 seconds.

---
 .../gpu/drm/i915/selftests/i915_selftest.c    | 61 +++++++++++++++++++
 1 file changed, 61 insertions(+)
drivers/gpu/drm/i915/selftests/i915_selftest.c +61 -0
index 39da0fb0d6d2..77168a7a7e3f 100644
@@ -24,6 +24,8 @@
 #include <linux/random.h>
 
 #include "gt/intel_gt_pm.h"
+#include "gt/uc/intel_gsc_fw.h"
+
 #include "i915_driver.h"
 #include "i915_drv.h"
 #include "i915_selftest.h"
@@ -127,6 +129,63 @@ static void set_default_test_all(struct selftest *st, unsigned int count)
 		st[i].enabled = true;
 }
 
+static int
+__wait_gsc_proxy_completed(struct drm_i915_private *i915,
+			   unsigned long timeout_ms)
+{
+	bool need_to_wait = (IS_ENABLED(CONFIG_INTEL_MEI_GSC_PROXY) &&
+			     i915->media_gt &&
+			     HAS_ENGINE(i915->media_gt, GSC0) &&
+			     intel_uc_fw_is_loadable(&i915->media_gt->uc.gsc.fw));
+
+	/*
+	 * For gsc proxy component loading + init, we need a much longer timeout
+	 * than what CI selftest infrastrucutre currently uses. This longer wait
+	 * period depends on the kernel config and component driver load ordering
+	 */
+	if (timeout_ms < 8000)
+		timeout_ms = 8000;
+
+	if (need_to_wait &&
+	    (wait_for(intel_gsc_uc_fw_proxy_init_done(&i915->media_gt->uc.gsc),
+	    timeout_ms)))
+		return -ETIME;
+
+	return 0;
+}
+
+struct __startup_waiter {
+	const char *name;
+	int (*wait_to_completed)(struct drm_i915_private *i915, unsigned long timeout_ms);
+};
+
+static struct __startup_waiter all_startup_waiters[] = { \
+	{"gsc_proxy", __wait_gsc_proxy_completed} \
+	};
+
+static int __wait_on_all_system_dependencies(struct drm_i915_private *i915)
+{
+	struct __startup_waiter *waiter = all_startup_waiters;
+	int count = ARRAY_SIZE(all_startup_waiters);
+	int ret;
+
+	if (!waiter || !count || !i915)
+		return 0;
+
+	for (; count--; waiter++) {
+		if (!waiter->wait_to_completed)
+			continue;
+		ret = waiter->wait_to_completed(i915, i915_selftest.timeout_ms);
+		if (ret) {
+			pr_info(DRIVER_NAME ": Pre-selftest waiter %s failed with %d\n",
+				waiter->name, ret);
+			return ret;
+		}
+	}
+
+	return 0;
+}
+
 static int __run_selftests(const char *name,
 			   struct selftest *st,
 			   unsigned int count,
@@ -134,6 +193,8 @@ static int __run_selftests(const char *name,
 {
 	int err = 0;
 
+	__wait_on_all_system_dependencies(data);
+
 	while (!i915_selftest.random_seed)
 		i915_selftest.random_seed = get_random_u32();
 

base-commit: 0ae4ee2c735979030a0219218081eee661606921

Signature · 1 line
2.39.0
#1 lore raw

[Intel-gfx] ✗ Fi.CI.CHECKPATCH: warning for drm/i915/selftest/gsc: Ensure GSC Proxy init completes before selftests (rev2)

== Series Details ==

== Series Details ==

Series: drm/i915/selftest/gsc: Ensure GSC Proxy init completes before selftests (rev2)
URL : https://patchwork.freedesktop.org/series/117713/
State : warning

== Summary ==

Error: dim checkpatch failed
35fe6f671494 drm/i915/selftest/gsc: Ensure GSC Proxy init completes before selftests -:74: WARNING:LINE_CONTINUATIONS: Avoid unnecessary line continuations #74: FILE: drivers/gpu/drm/i915/selftests/i915_selftest.c:162:
+static struct __startup_waiter all_startup_waiters[] = { \

total: 0 errors, 1 warnings, 0 checks, 79 lines checked

#2 lore raw

[Intel-gfx] ✓ Fi.CI.BAT: success for drm/i915/selftest/gsc: Ensure GSC Proxy init completes before selftests (rev2)

In reply to Alan Previn
== Series Details ==

== Series Details ==

Series: drm/i915/selftest/gsc: Ensure GSC Proxy init completes before selftests (rev2)
URL : https://patchwork.freedesktop.org/series/117713/
State : success

== Summary ==

CI Bug Log - changes from CI_DRM_13206 -> Patchwork_117713v2
====================================================

Summary
-------

**SUCCESS**

No regressions found.

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

Participating hosts (35 -> 36)
------------------------------

Additional (1): bat-rpls-2

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

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

### IGT changes ###

#### Issues hit ####

* igt@debugfs_test@basic-hwmon:
- bat-rpls-2: NOTRUN -> [SKIP][1] ([i915#7456])
[1]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_117713v2/bat-rpls-2/igt@[email protected]

* igt@fbdev@read:
- bat-rpls-2: NOTRUN -> [SKIP][2] ([i915#2582]) +4 similar issues
[2]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_117713v2/bat-rpls-2/igt@[email protected]

* igt@gem_exec_suspend@basic-s0@smem:
- bat-jsl-1: [PASS][3] -> [ABORT][4] ([i915#5122])
[3]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_13206/bat-jsl-1/igt@gem_exec_suspend@[email protected]
[4]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_117713v2/bat-jsl-1/igt@gem_exec_suspend@[email protected]

* igt@gem_lmem_swapping@verify-random:
- bat-rpls-2: NOTRUN -> [SKIP][5] ([i915#4613]) +3 similar issues
[5]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_117713v2/bat-rpls-2/igt@[email protected]

* igt@gem_tiled_pread_basic:
- bat-rpls-2: NOTRUN -> [SKIP][6] ([i915#3282])
[6]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_117713v2/bat-rpls-2/igt@gem_tiled_pread_basic.html

* igt@i915_pm_backlight@basic-brightness:
- bat-rpls-2: NOTRUN -> [SKIP][7] ([i915#7561])
[7]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_117713v2/bat-rpls-2/igt@[email protected]

* igt@i915_pm_backlight@basic-brightness@edp-1:
- bat-rplp-1: NOTRUN -> [ABORT][8] ([i915#7077])
[8]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_117713v2/bat-rplp-1/igt@i915_pm_backlight@[email protected]

* igt@i915_pm_rpm@basic-pci-d3-state:
- fi-hsw-4770: [PASS][9] -> [SKIP][10] ([fdo#109271])
[9]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_13206/fi-hsw-4770/igt@[email protected]
[10]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_117713v2/fi-hsw-4770/igt@[email protected]

* igt@i915_pm_rpm@basic-rte:
- fi-hsw-4770: [PASS][11] -> [FAIL][12] ([i915#7364])
[11]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_13206/fi-hsw-4770/igt@[email protected]
[12]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_117713v2/fi-hsw-4770/igt@[email protected]

* igt@i915_pm_rps@basic-api:
- bat-rpls-2: NOTRUN -> [SKIP][13] ([i915#6621])
[13]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_117713v2/bat-rpls-2/igt@[email protected]

* igt@i915_selftest@live@gt_pm:
- bat-rpls-2: NOTRUN -> [DMESG-FAIL][14] ([i915#4258] / [i915#7913])
[14]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_117713v2/bat-rpls-2/igt@i915_selftest@live@gt_pm.html

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

* igt@i915_selftest@live@reset:
- bat-rpls-1: [PASS][17] -> [ABORT][18] ([i915#4983] / [i915#7461] / [i915#7981] / [i915#8347] / [i915#8384])
[17]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_13206/bat-rpls-1/igt@i915_selftest@[email protected]
[18]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_117713v2/bat-rpls-1/igt@i915_selftest@[email protected]

* igt@i915_selftest@live@slpc:
- bat-rpls-2: NOTRUN -> [DMESG-WARN][19] ([i915#6367])
[19]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_117713v2/bat-rpls-2/igt@i915_selftest@[email protected]

* igt@i915_suspend@basic-s2idle-without-i915:
- bat-rpls-2: NOTRUN -> [ABORT][20] ([i915#6687])
[20]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_117713v2/bat-rpls-2/igt@[email protected]

* igt@i915_suspend@basic-s3-without-i915:
- bat-jsl-1: [PASS][21] -> [FAIL][22] ([fdo#103375])
[21]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_13206/bat-jsl-1/igt@[email protected]
[22]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_117713v2/bat-jsl-1/igt@[email protected]

* igt@kms_busy@basic:
- bat-rpls-2: NOTRUN -> [SKIP][23] ([i915#1845]) +14 similar issues
[23]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_117713v2/bat-rpls-2/igt@[email protected]

* igt@kms_chamelium_edid@hdmi-edid-read:
- bat-rpls-2: NOTRUN -> [SKIP][24] ([i915#7828]) +7 similar issues
[24]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_117713v2/bat-rpls-2/igt@[email protected]

* igt@kms_chamelium_hpd@common-hpd-after-suspend:
- fi-bsw-n3050: NOTRUN -> [SKIP][25] ([fdo#109271])
[25]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_117713v2/fi-bsw-n3050/igt@[email protected]

* igt@kms_flip@basic-flip-vs-dpms:
- bat-rpls-2: NOTRUN -> [SKIP][26] ([i915#3637]) +3 similar issues
[26]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_117713v2/bat-rpls-2/igt@[email protected]

* igt@kms_force_connector_basic@force-load-detect:
- bat-rpls-2: NOTRUN -> [SKIP][27] ([fdo#109285])
[27]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_117713v2/bat-rpls-2/igt@[email protected]

* igt@kms_frontbuffer_tracking@basic:
- bat-rpls-2: NOTRUN -> [SKIP][28] ([i915#1849])
[28]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_117713v2/bat-rpls-2/igt@[email protected]

* igt@kms_psr@sprite_plane_onoff:
- bat-rpls-2: NOTRUN -> [SKIP][29] ([i915#1072]) +3 similar issues
[29]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_117713v2/bat-rpls-2/igt@kms_psr@sprite_plane_onoff.html

* igt@kms_setmode@basic-clone-single-crtc:
- bat-rpls-2: NOTRUN -> [SKIP][30] ([i915#3555] / [i915#4579])
[30]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_117713v2/bat-rpls-2/igt@[email protected]

* igt@prime_vgem@basic-fence-flip:
- bat-rpls-2: NOTRUN -> [SKIP][31] ([fdo#109295] / [i915#1845] / [i915#3708])
[31]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_117713v2/bat-rpls-2/igt@[email protected]

* igt@prime_vgem@basic-fence-read:
- bat-rpls-2: NOTRUN -> [SKIP][32] ([fdo#109295] / [i915#3708]) +2 similar issues
[32]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_117713v2/bat-rpls-2/igt@[email protected]

#### Possible fixes ####

* igt@i915_module_load@load:
- {bat-adlp-11}: [ABORT][33] ([i915#4423] / [i915#8189]) -> [PASS][34]
[33]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_13206/bat-adlp-11/igt@[email protected]
[34]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_117713v2/bat-adlp-11/igt@[email protected]

* igt@i915_selftest@live@late_gt_pm:
- fi-bsw-n3050: [ABORT][35] ([i915#6217]) -> [PASS][36]
[35]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_13206/fi-bsw-n3050/igt@i915_selftest@live@late_gt_pm.html
[36]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_117713v2/fi-bsw-n3050/igt@i915_selftest@live@late_gt_pm.html

#### Warnings ####

* igt@kms_setmode@basic-clone-single-crtc:
- bat-rplp-1: [ABORT][37] ([i915#4579] / [i915#8260]) -> [SKIP][38] ([i915#3555] / [i915#4579])
[37]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_13206/bat-rplp-1/igt@[email protected]
[38]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_117713v2/bat-rplp-1/igt@[email protected]

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

[fdo#103375]: https://bugs.freedesktop.org/show_bug.cgi?id=103375
[fdo#109271]: https://bugs.freedesktop.org/show_bug.cgi?id=109271
[fdo#109285]: https://bugs.freedesktop.org/show_bug.cgi?id=109285
[fdo#109295]: https://bugs.freedesktop.org/show_bug.cgi?id=109295
[i915#1072]: https://gitlab.freedesktop.org/drm/intel/issues/1072
[i915#1845]: https://gitlab.freedesktop.org/drm/intel/issues/1845
[i915#1849]: https://gitlab.freedesktop.org/drm/intel/issues/1849
[i915#2582]: https://gitlab.freedesktop.org/drm/intel/issues/2582
[i915#3282]: https://gitlab.freedesktop.org/drm/intel/issues/3282
[i915#3555]: https://gitlab.freedesktop.org/drm/intel/issues/3555
[i915#3637]: https://gitlab.freedesktop.org/drm/intel/issues/3637
[i915#3708]: https://gitlab.freedesktop.org/drm/intel/issues/3708
[i915#4093]: https://gitlab.freedesktop.org/drm/intel/issues/4093
[i915#4103]: https://gitlab.freedesktop.org/drm/intel/issues/4103
[i915#4258]: https://gitlab.freedesktop.org/drm/intel/issues/4258
[i915#4423]: https://gitlab.freedesktop.org/drm/intel/issues/4423
[i915#4579]: https://gitlab.freedesktop.org/drm/intel/issues/4579
[i915#4613]: https://gitlab.freedesktop.org/drm/intel/issues/4613
[i915#4983]: https://gitlab.freedesktop.org/drm/intel/issues/4983
[i915#5122]: https://gitlab.freedesktop.org/drm/intel/issues/5122
[i915#6217]: https://gitlab.freedesktop.org/drm/intel/issues/6217
[i915#6367]: https://gitlab.freedesktop.org/drm/intel/issues/6367
[i915#6621]: https://gitlab.freedesktop.org/drm/intel/issues/6621
[i915#6687]: https://gitlab.freedesktop.org/drm/intel/issues/6687
[i915#6868]: https://gitlab.freedesktop.org/drm/intel/issues/6868
[i915#7059]: https://gitlab.freedesktop.org/drm/intel/issues/7059
[i915#7077]: https://gitlab.freedesktop.org/drm/intel/issues/7077
[i915#7364]: https://gitlab.freedesktop.org/drm/intel/issues/7364
[i915#7456]: https://gitlab.freedesktop.org/drm/intel/issues/7456
[i915#7461]: https://gitlab.freedesktop.org/drm/intel/issues/7461
[i915#7561]: https://gitlab.freedesktop.org/drm/intel/issues/7561
[i915#7828]: https://gitlab.freedesktop.org/drm/intel/issues/7828
[i915#7913]: https://gitlab.freedesktop.org/drm/intel/issues/7913
[i915#7979]: https://gitlab.freedesktop.org/drm/intel/issues/7979
[i915#7981]: https://gitlab.freedesktop.org/drm/intel/issues/7981
[i915#8189]: https://gitlab.freedesktop.org/drm/intel/issues/8189
[i915#8260]: https://gitlab.freedesktop.org/drm/intel/issues/8260
[i915#8347]: https://gitlab.freedesktop.org/drm/intel/issues/8347
[i915#8384]: https://gitlab.freedesktop.org/drm/intel/issues/8384

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

* Linux: CI_DRM_13206 -> Patchwork_117713v2

CI-20190529: 20190529
CI_DRM_13206: 1f26581192d798031ff95fcbce2c2fe4ac953c65 @ git://anongit.freedesktop.org/gfx-ci/linux
IGT_7313: 989920cfc4aa76d04c3af0acf8a0319c4e8f4f4c @ https://gitlab.freedesktop.org/drm/igt-gpu-tools.git
Patchwork_117713v2: 1f26581192d798031ff95fcbce2c2fe4ac953c65 @ git://anongit.freedesktop.org/gfx-ci/linux

### Linux commits

98cc1ac59ad1 drm/i915/selftest/gsc: Ensure GSC Proxy init completes before selftests

== Logs ==

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

#3 lore raw

[Intel-gfx] ✓ Fi.CI.IGT: success for drm/i915/selftest/gsc: Ensure GSC Proxy init completes before selftests (rev2)

In reply to Alan Previn
== Series Details ==

== Series Details ==

Series: drm/i915/selftest/gsc: Ensure GSC Proxy init completes before selftests (rev2)
URL : https://patchwork.freedesktop.org/series/117713/
State : success

== Summary ==

CI Bug Log - changes from CI_DRM_13206_full -> Patchwork_117713v2_full
====================================================

Summary
-------

**SUCCESS**

No regressions found.

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

No changes in participating hosts

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

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

### IGT changes ###

#### Suppressed ####

The following results come from untrusted machines, tests, or statuses. They do not affect the overall result.

* igt@i915_pm_rpm@system-suspend-devices:
- {shard-tglu}: [PASS][1] -> [ABORT][2]
[1]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_13206/shard-tglu-2/igt@[email protected]
[2]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_117713v2/shard-tglu-8/igt@[email protected]

* igt@kms_flip@flip-vs-blocking-wf-vblank@a-hdmi-a1:
- {shard-tglu}: [PASS][3] -> [INCOMPLETE][4]
[3]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_13206/shard-tglu-2/igt@kms_flip@[email protected]
[4]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_117713v2/shard-tglu-9/igt@kms_flip@[email protected]

* igt@kms_flip@flip-vs-expired-vblank-interruptible@b-hdmi-a4:
- {shard-dg1}: [PASS][5] -> [FAIL][6]
[5]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_13206/shard-dg1-14/igt@kms_flip@[email protected]
[6]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_117713v2/shard-dg1-18/igt@kms_flip@[email protected]

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

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

### IGT changes ###

#### Issues hit ####

* igt@gem_exec_fair@basic-pace-share@rcs0:
- shard-glk: [PASS][7] -> [FAIL][8] ([i915#2842])
[7]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_13206/shard-glk3/igt@gem_exec_fair@[email protected]
[8]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_117713v2/shard-glk7/igt@gem_exec_fair@[email protected]

* igt@kms_plane_scaling@planes-downscale-factor-0-25-unity-scaling@pipe-a-hdmi-a-1:
- shard-snb: NOTRUN -> [SKIP][9] ([fdo#109271]) +4 similar issues
[9]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_117713v2/shard-snb1/igt@kms_plane_scaling@[email protected]

* igt@kms_plane_scaling@planes-downscale-factor-0-5-upscale-20x20@pipe-b-hdmi-a-1:
- shard-snb: NOTRUN -> [SKIP][10] ([fdo#109271] / [i915#4579]) +2 similar issues
[10]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_117713v2/shard-snb1/igt@kms_plane_scaling@[email protected]

#### Possible fixes ####

* igt@gem_eio@hibernate:
- {shard-tglu}: [ABORT][11] ([i915#7975] / [i915#8213] / [i915#8398]) -> [PASS][12]
[11]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_13206/shard-tglu-10/igt@[email protected]
[12]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_117713v2/shard-tglu-2/igt@[email protected]

* igt@gem_exec_fair@basic-none@vcs0:
- {shard-rkl}: [FAIL][13] ([i915#2842]) -> [PASS][14]
[13]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_13206/shard-rkl-6/igt@gem_exec_fair@[email protected]
[14]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_117713v2/shard-rkl-6/igt@gem_exec_fair@[email protected]

* igt@i915_pm_rc6_residency@rc6-idle@bcs0:
- {shard-dg1}: [FAIL][15] ([i915#3591]) -> [PASS][16]
[15]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_13206/shard-dg1-15/igt@i915_pm_rc6_residency@[email protected]
[16]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_117713v2/shard-dg1-14/igt@i915_pm_rc6_residency@[email protected]

* igt@i915_pm_rpm@dpms-mode-unset-lpsp:
- {shard-rkl}: [SKIP][17] ([i915#1397]) -> [PASS][18] +2 similar issues
[17]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_13206/shard-rkl-3/igt@[email protected]
[18]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_117713v2/shard-rkl-7/igt@[email protected]

* igt@i915_pm_rpm@modeset-lpsp-stress:
- {shard-dg1}: [SKIP][19] ([i915#1397]) -> [PASS][20]
[19]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_13206/shard-dg1-13/igt@[email protected]
[20]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_117713v2/shard-dg1-19/igt@[email protected]

* igt@kms_cursor_legacy@single-move@pipe-b:
- {shard-rkl}: [INCOMPLETE][21] ([i915#8011]) -> [PASS][22]
[21]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_13206/shard-rkl-7/igt@kms_cursor_legacy@[email protected]
[22]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_117713v2/shard-rkl-1/igt@kms_cursor_legacy@[email protected]

* igt@perf_pmu@busy-double-start@vcs0:
- {shard-dg1}: [FAIL][23] ([i915#4349]) -> [PASS][24]
[23]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_13206/shard-dg1-19/igt@perf_pmu@[email protected]
[24]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_117713v2/shard-dg1-17/igt@perf_pmu@[email protected]

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

[fdo#109271]: https://bugs.freedesktop.org/show_bug.cgi?id=109271
[fdo#109274]: https://bugs.freedesktop.org/show_bug.cgi?id=109274
[fdo#109289]: https://bugs.freedesktop.org/show_bug.cgi?id=109289
[fdo#109309]: https://bugs.freedesktop.org/show_bug.cgi?id=109309
[fdo#110189]: https://bugs.freedesktop.org/show_bug.cgi?id=110189
[fdo#111068]: https://bugs.freedesktop.org/show_bug.cgi?id=111068
[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#1257]: https://gitlab.freedesktop.org/drm/intel/issues/1257
[i915#1397]: https://gitlab.freedesktop.org/drm/intel/issues/1397
[i915#1902]: https://gitlab.freedesktop.org/drm/intel/issues/1902
[i915#1937]: https://gitlab.freedesktop.org/drm/intel/issues/1937
[i915#2437]: https://gitlab.freedesktop.org/drm/intel/issues/2437
[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#2842]: https://gitlab.freedesktop.org/drm/intel/issues/2842
[i915#2856]: https://gitlab.freedesktop.org/drm/intel/issues/2856
[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#3359]: https://gitlab.freedesktop.org/drm/intel/issues/3359
[i915#3458]: https://gitlab.freedesktop.org/drm/intel/issues/3458
[i915#3539]: https://gitlab.freedesktop.org/drm/intel/issues/3539
[i915#3555]: https://gitlab.freedesktop.org/drm/intel/issues/3555
[i915#3591]: https://gitlab.freedesktop.org/drm/intel/issues/3591
[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#3742]: https://gitlab.freedesktop.org/drm/intel/issues/3742
[i915#3886]: https://gitlab.freedesktop.org/drm/intel/issues/3886
[i915#3955]: https://gitlab.freedesktop.org/drm/intel/issues/3955
[i915#4070]: https://gitlab.freedesktop.org/drm/intel/issues/4070
[i915#4077]: https://gitlab.freedesktop.org/drm/intel/issues/4077
[i915#4078]: https://gitlab.freedesktop.org/drm/intel/issues/4078
[i915#4103]: https://gitlab.freedesktop.org/drm/intel/issues/4103
[i915#4213]: https://gitlab.freedesktop.org/drm/intel/issues/4213
[i915#4270]: https://gitlab.freedesktop.org/drm/intel/issues/4270
[i915#4349]: https://gitlab.freedesktop.org/drm/intel/issues/4349
[i915#4538]: https://gitlab.freedesktop.org/drm/intel/issues/4538
[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#4816]: https://gitlab.freedesktop.org/drm/intel/issues/4816
[i915#4833]: https://gitlab.freedesktop.org/drm/intel/issues/4833
[i915#4852]: https://gitlab.freedesktop.org/drm/intel/issues/4852
[i915#4860]: https://gitlab.freedesktop.org/drm/intel/issues/4860
[i915#4885]: https://gitlab.freedesktop.org/drm/intel/issues/4885
[i915#5176]: https://gitlab.freedesktop.org/drm/intel/issues/5176
[i915#5235]: https://gitlab.freedesktop.org/drm/intel/issues/5235
[i915#5286]: https://gitlab.freedesktop.org/drm/intel/issues/5286
[i915#5354]: https://gitlab.freedesktop.org/drm/intel/issues/5354
[i915#5439]: https://gitlab.freedesktop.org/drm/intel/issues/5439
[i915#5723]: https://gitlab.freedesktop.org/drm/intel/issues/5723
[i915#5784]: https://gitlab.freedesktop.org/drm/intel/issues/5784
[i915#6095]: https://gitlab.freedesktop.org/drm/intel/issues/6095
[i915#6524]: https://gitlab.freedesktop.org/drm/intel/issues/6524
[i915#658]: https://gitlab.freedesktop.org/drm/intel/issues/658
[i915#7116]: https://gitlab.freedesktop.org/drm/intel/issues/7116
[i915#7711]: https://gitlab.freedesktop.org/drm/intel/issues/7711
[i915#7742]: https://gitlab.freedesktop.org/drm/intel/issues/7742
[i915#7828]: https://gitlab.freedesktop.org/drm/intel/issues/7828
[i915#7975]: https://gitlab.freedesktop.org/drm/intel/issues/7975
[i915#8011]: https://gitlab.freedesktop.org/drm/intel/issues/8011
[i915#8213]: https://gitlab.freedesktop.org/drm/intel/issues/8213
[i915#8292]: https://gitlab.freedesktop.org/drm/intel/issues/8292
[i915#8347]: https://gitlab.freedesktop.org/drm/intel/issues/8347
[i915#8381]: https://gitlab.freedesktop.org/drm/intel/issues/8381
[i915#8398]: https://gitlab.freedesktop.org/drm/intel/issues/8398
[i915#8414]: https://gitlab.freedesktop.org/drm/intel/issues/8414
[i915#8502]: https://gitlab.freedesktop.org/drm/intel/issues/8502
[i915#8555]: https://gitlab.freedesktop.org/drm/intel/issues/8555

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

* Linux: CI_DRM_13206 -> Patchwork_117713v2

CI-20190529: 20190529
CI_DRM_13206: 1f26581192d798031ff95fcbce2c2fe4ac953c65 @ git://anongit.freedesktop.org/gfx-ci/linux
IGT_7313: 989920cfc4aa76d04c3af0acf8a0319c4e8f4f4c @ https://gitlab.freedesktop.org/drm/igt-gpu-tools.git
Patchwork_117713v2: 1f26581192d798031ff95fcbce2c2fe4ac953c65 @ 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_117713v2/index.html

Reviewed-by on v2 1/1
#4 lore raw
In reply to Alan Previn

See my comments below.

Quoted 71 lines

-----Original Message-----
From: Alan Previn <[email protected]>
Sent: May 30, 2023 1:01 PM
To: [email protected]
Cc: [email protected]; Alan Previn <[email protected]>
Subject: [v2] drm/i915/selftest/gsc: Ensure GSC Proxy init completes before selftests

On MTL, if the GSC Proxy init flows haven't completed, submissions to the GSC engine will fail. Those init flows are dependent on the mei's gsc_proxy component that is loaded in parallel with i915 and a worker that could potentially start after i915 driver init is done.

That said, all subsytems that access the GSC engine today does check for such init flow completion before using the GSC engine. However, selftests currently don't wait on anything before starting.

To fix this, add a waiter function at the start of __run_selftests that waits for gsc-proxy init flows to complete. While implementing this, use an table of function pointers so its scalable to add additional waiter functions for future such "wait on dependency" cases that.

Difference from prior versions:
v1: Based on internal testing, increase the timeout for gsc-proxy
specific case to 8 seconds.

---
 .../gpu/drm/i915/selftests/i915_selftest.c    | 61 +++++++++++++++++++
 1 file changed, 61 insertions(+)

base-commit: 0ae4ee2c735979030a0219218081eee661606921

drivers/gpu/drm/i915/selftests/i915_selftest.c +7 -0
index 39da0fb0d6d2..77168a7a7e3f 100644
@@ -24,6 +24,8 @@
 #include <linux/random.h>
 
 #include "gt/intel_gt_pm.h"
+#include "gt/uc/intel_gsc_fw.h"
+
 #include "i915_driver.h"
 #include "i915_drv.h"
 #include "i915_selftest.h"
@@ -127,6 +129,63 @@ static void set_default_test_all(struct selftest *st,
 unsigned int count)
 		st[i].enabled = true;
 }
 
+static int
+__wait_gsc_proxy_completed(struct drm_i915_private *i915,
+			   unsigned long timeout_ms)
+{
+	bool need_to_wait = (IS_ENABLED(CONFIG_INTEL_MEI_GSC_PROXY)

&&

drivers/gpu/drm/i915/selftests/i915_selftest.c +3 -0
+			     i915->media_gt &&
+			     HAS_ENGINE(i915->media_gt, GSC0) &&
+			     intel_uc_fw_is_loadable(&i915->media_gt-
Quoted 1 line

uc.gsc.fw));

drivers/gpu/drm/i915/selftests/i915_selftest.c +3 -0
+
+	/*
+	 * For gsc proxy component loading + init, we need a much longer

timeout

drivers/gpu/drm/i915/selftests/i915_selftest.c +2 -0
+	 * than what CI selftest infrastrucutre currently uses. This longer wait
+	 * period depends on the kernel config and component driver load

ordering

drivers/gpu/drm/i915/selftests/i915_selftest.c static void set_default_test_all(struct selftest *st, unsigned int count) · line 147

Quoted 3 lines
drivers/gpu/drm/i915/selftests/i915_selftest.c +3 -0
+	 */
+	if (timeout_ms < 8000)
+		timeout_ms = 8000;

Lgtm, just an concern about the fixed number here, shall we set the minimal here, or let i915_selftest.timeout_ms take control? Thus no longer need coding change here in the future.

Quoted 58 lines
drivers/gpu/drm/i915/selftests/i915_selftest.c +3 -0
+
+	if (need_to_wait &&
+	    (wait_for(intel_gsc_uc_fw_proxy_init_done(&i915->media_gt-
Quoted 1 line

uc.gsc),

drivers/gpu/drm/i915/selftests/i915_selftest.c +9 -0
+	    timeout_ms)))
+		return -ETIME;
+
+	return 0;
+}
+
+struct __startup_waiter {
+	const char *name;
+	int (*wait_to_completed)(struct drm_i915_private *i915, unsigned

long timeout_ms);

drivers/gpu/drm/i915/selftests/i915_selftest.c +7 -0
+};
+
+static struct __startup_waiter all_startup_waiters[] = { \
+	{"gsc_proxy", __wait_gsc_proxy_completed} \
+	};
+
+static int __wait_on_all_system_dependencies(struct drm_i915_private

*i915)

drivers/gpu/drm/i915/selftests/i915_selftest.c +12 -0
+{
+	struct __startup_waiter *waiter = all_startup_waiters;
+	int count = ARRAY_SIZE(all_startup_waiters);
+	int ret;
+
+	if (!waiter || !count || !i915)
+		return 0;
+
+	for (; count--; waiter++) {
+		if (!waiter->wait_to_completed)
+			continue;
+		ret = waiter->wait_to_completed(i915,

i915_selftest.timeout_ms);

drivers/gpu/drm/i915/selftests/i915_selftest.c +2 -0
+		if (ret) {
+			pr_info(DRIVER_NAME ": Pre-selftest waiter %s failed

with %d\n",

drivers/gpu/drm/i915/selftests/i915_selftest.c +10 -0
+				waiter->name, ret);
+			return ret;
+		}
+	}
+
+	return 0;
+}
+
 static int __run_selftests(const char *name,
 			   struct selftest *st,
 			   unsigned int count,
@@ -134,6 +193,8 @@ static int __run_selftests(const char *name,
 {
 	int err = 0;
 
+	__wait_on_all_system_dependencies(data);
+
 	while (!i915_selftest.random_seed)
 		i915_selftest.random_seed = get_random_u32();
 
#5 lore raw
Quoted 4 lines · Zhanjun

See my comments below.

Quoted 2 lines

-----Original Message-----
From: Alan Previn <[email protected]>

alan:snip

Quoted 24 lines
Quoted 17 lines
drivers/gpu/drm/i915/selftests/i915_selftest.c +5 -0
+static int
+__wait_gsc_proxy_completed(struct drm_i915_private *i915,
+			   unsigned long timeout_ms)
+{
+	bool need_to_wait = (IS_ENABLED(CONFIG_INTEL_MEI_GSC_PROXY)

&&

drivers/gpu/drm/i915/selftests/i915_selftest.c +3 -0
+			     i915->media_gt &&
+			     HAS_ENGINE(i915->media_gt, GSC0) &&
+			     intel_uc_fw_is_loadable(&i915->media_gt-
Quoted 1 line

uc.gsc.fw));

drivers/gpu/drm/i915/selftests/i915_selftest.c +3 -0
+
+	/*
+	 * For gsc proxy component loading + init, we need a much longer

timeout

(quoted diff) +2 -0
+	 * than what CI selftest infrastrucutre currently uses. This longer wait
+	 * period depends on the kernel config and component driver load

ordering

drivers/gpu/drm/i915/selftests/i915_selftest.c static void set_default_test_all(struct selftest *st, unsigned int count) · line 147

Quoted 3 lines
drivers/gpu/drm/i915/selftests/i915_selftest.c +3 -0
+	 */
+	if (timeout_ms < 8000)
+		timeout_ms = 8000;

Lgtm, just an concern about the fixed number here, shall we set the minimal here, or let i915_selftest.timeout_ms take control? Thus no longer need coding change here in the future.

Quoted 1 line

Thanks Zhanjun, unfortunately, based on internal testing, i915_selftest.timeout_ms default is too low that it does occasionally timeout for CI. From experience, with a lean ubuntu config, it typically takes about ~1 seconds for the mei-gsc-sw-proxy component driver to load after i915 loads. Since CI regular unloads and reloads i915, the timeout observed ends up being reported as issue.

8 seconds was based on internal testing of the worst case scenario - which hardly ever happens. We've only seen the 8 second happen when the kernel config has configs enabled for very many SOC IP drivers and component driver (seen one at least one customer config) or if the MTL board IFWI was only just reflashed (this would be a one-off 8 seconds, we suspect due to the firmware doing additional steps)

#6 lore raw
Quoted 55 lines

-----Original Message-----
From: Teres Alexis, Alan Previn <[email protected]>
Sent: June 8, 2023 2:31 PM
To: Dong, Zhanjun <[email protected]>; intel- [email protected]
Cc: [email protected]
Subject: Re: [v2] drm/i915/selftest/gsc: Ensure GSC Proxy init completes before selftests

Quoted 4 lines · Zhanjun

See my comments below.

Quoted 2 lines

-----Original Message-----
From: Alan Previn <[email protected]>

alan:snip

Quoted 10 lines
Quoted 10 lines
drivers/gpu/drm/i915/selftests/i915_selftest.c +5 -0
+static int
+__wait_gsc_proxy_completed(struct drm_i915_private *i915,
+			   unsigned long timeout_ms)
+{
+	bool need_to_wait = (IS_ENABLED(CONFIG_INTEL_MEI_GSC_PROXY)

&&

drivers/gpu/drm/i915/selftests/i915_selftest.c +3 -0
+			     i915->media_gt &&
+			     HAS_ENGINE(i915->media_gt, GSC0) &&
+			     intel_uc_fw_is_loadable(&i915->media_gt-
Quoted 1 line

uc.gsc.fw));

Quoted 13 lines

drivers/gpu/drm/i915/selftests/i915_selftest.c static void set_default_test_all(struct selftest *st, unsigned int count) · line 147

Quoted 10 lines
drivers/gpu/drm/i915/selftests/i915_selftest.c +3 -0
+
+	/*
+	 * For gsc proxy component loading + init, we need a much longer

timeout

(quoted diff) +2 -0
+	 * than what CI selftest infrastrucutre currently uses. This longer wait
+	 * period depends on the kernel config and component driver load

ordering

drivers/gpu/drm/i915/selftests/i915_selftest.c +3 -0
+	 */
+	if (timeout_ms < 8000)
+		timeout_ms = 8000;

Lgtm, just an concern about the fixed number here, shall we set the

minimal here, or let i915_selftest.timeout_ms take control? Thus no longer need coding change here in the future.

Quoted 2 lines

Thanks Zhanjun, unfortunately, based on internal testing, i915_selftest.timeout_ms default is too
low that it does occasionally timeout for CI. From experience, with a lean ubuntu config, it typically
takes about ~1 seconds for the mei-gsc-sw-proxy component driver to load after i915 loads.
Since CI regular unloads and reloads i915, the timeout observed ends up being reported as issue.

Quoted 9 lines

8 seconds was based on internal testing of the worst case scenario - which hardly ever happens.
We've only seen the 8 second happen when the kernel config has configs enabled for very many SOC IP
drivers and component driver (seen one at least one customer config) or if the MTL board IFWI was only
just reflashed (this would be a one-off 8 seconds, we suspect due to the firmware doing additional steps)

Thanks for detailed info. The i915_selftest.timeout_ms is too low for this test, so it need an special minimal for itself, valid reason. The concern I raised is at minor level. Looks good to me.

Regards,
Zhanjun