Skip to contentSkip to conversation

lib/igt_kmod: Allow some leeway in igt_kmod_unload_r

PATCH In review Jonathan Cavitt 3 participants 6 messages Jan 9, 2023 – Jan 17, 2023 Library code

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 lib/igt_kmod: Allow some leeway in igt_kmod_unload_r

kmod_module_remove_module occasionally returns EAGAIN for mei_gsc in the setup of some gem_lmem_swapping subtests. Just because EAGAIN is returned doesn't mean the module is lost and unable to be unloaded. Try again some number of times (currently 10) before giving up.

Retries will occur for -EBUSY and -EAGAIN, as these imply the system is waiting for the target module can simply be waited for. All other errors exit immediately, but as the context for each error informs their relative severity, no warnings will be issued.

References: VLK-30287, VLK-39629

CC Stuart Summers <[email protected]>
CC Sandeep Kumar Parupalli <[email protected]>
CC Chris Wilson <[email protected]>
---
 lib/igt_kmod.c | 41 ++++++++++++++++++++++++++++++++++++++---
 1 file changed, 38 insertions(+), 3 deletions(-)
lib/igt_kmod.c +38 -3
index 17090110c..c840f9a17 100644
@@ -253,8 +253,11 @@ out:
 
 static int igt_kmod_unload_r(struct kmod_module *kmod, unsigned int flags)
 {
+#define MAX_TRIES	20
+#define SLEEP_DURATION	500000
 	struct kmod_list *holders, *pos;
-	int err = 0;
+	int err, tries;
+	const char *mod_name = kmod_module_get_name(kmod);
 
 	holders = kmod_module_get_holders(kmod);
 	kmod_list_foreach(pos, holders) {
@@ -269,7 +272,6 @@ static int igt_kmod_unload_r(struct kmod_module *kmod, unsigned int flags)
 		return err;
 
 	if (igt_kmod_is_loading(kmod)) {
-		const char *mod_name = kmod_module_get_name(kmod);
 		igt_debug("%s still initializing\n", mod_name);
 		err = igt_wait(!igt_kmod_is_loading(kmod), 10000, 100);
 		if (err < 0) {
@@ -279,7 +281,40 @@ static int igt_kmod_unload_r(struct kmod_module *kmod, unsigned int flags)
 		}
 	}
 
-	return kmod_module_remove_module(kmod, flags);
+	for (tries = 0; tries < MAX_TRIES; tries++) {
+		bool loop = false;
+
+		err = kmod_module_remove_module(kmod, flags);
+
+		/* Only loop in the following cases */
+		switch (err) {
+		case -EBUSY:
+		case -EAGAIN:
+			/* Waiting for module to be available */
+			loop = true;
+			break;
+		default:
+			break;
+                }
+		if (!loop)
+			break;
+
+		igt_debug("Module %s failed to unload with err: %d on attempt: %i\n",
+			  mod_name, err, tries + 1);
+
+		usleep(SLEEP_DURATION);
+	}
+
+	if (err == -ENOENT)
+		igt_debug("Module %s could not be found.  Skipping.\n", mod_name);
+	else if (err)
+		igt_info("Module %s failed to unload with err: %d after ~%.1fms\n",
+			 mod_name, err, SLEEP_DURATION*tries/1000.);
+	else if (tries)
+		igt_info("Module %s unload took ~%.1fms over %i attempts\n",
+			 mod_name, SLEEP_DURATION*tries/1000., tries + 1);
+
+	return err;
 }
 
 /**
Signature · 1 line
2.25.1
#1 lore raw

-----Original Message-----
From: Cavitt, Jonathan <[email protected]>
Sent: Monday, January 9, 2023 11:26 AM
To: [email protected]
Cc: Dutt, Sudeep <[email protected]>; Cavitt, Jonathan <[email protected]>
Subject: [PATCH i-g-t] lib/igt_kmod: Allow some leeway in igt_kmod_unload_r

Quoted 5 lines

kmod_module_remove_module occasionally returns EAGAIN for mei_gsc in the setup of some gem_lmem_swapping subtests. Just because EAGAIN is returned doesn't mean the module is lost and unable to be unloaded. Try again some number of times (currently 10) before

Just noticed it's actually 20 times in the code. I'll fix this before confirming the final push if this change is accepted.
-Jonathan Cavitt

Quoted 89 lines

giving up.

Retries will occur for -EBUSY and -EAGAIN, as these imply the system is waiting for the target module can simply be waited for. All other errors exit immediately, but as the context for each error informs their relative severity, no warnings will be issued.

References: VLK-30287, VLK-39629

CC Stuart Summers <[email protected]>
CC Sandeep Kumar Parupalli <[email protected]>
CC Chris Wilson <[email protected]>
---
 lib/igt_kmod.c | 41 ++++++++++++++++++++++++++++++++++++++---
 1 file changed, 38 insertions(+), 3 deletions(-)
lib/igt_kmod.c +38 -3
index 17090110c..c840f9a17 100644
@@ -253,8 +253,11 @@ out:
 
 static int igt_kmod_unload_r(struct kmod_module *kmod, unsigned int flags)
 {
+#define MAX_TRIES	20
+#define SLEEP_DURATION	500000
 	struct kmod_list *holders, *pos;
-	int err = 0;
+	int err, tries;
+	const char *mod_name = kmod_module_get_name(kmod);
 
 	holders = kmod_module_get_holders(kmod);
 	kmod_list_foreach(pos, holders) {
@@ -269,7 +272,6 @@ static int igt_kmod_unload_r(struct kmod_module *kmod, unsigned int flags)
 		return err;
 
 	if (igt_kmod_is_loading(kmod)) {
-		const char *mod_name = kmod_module_get_name(kmod);
 		igt_debug("%s still initializing\n", mod_name);
 		err = igt_wait(!igt_kmod_is_loading(kmod), 10000, 100);
 		if (err < 0) {
@@ -279,7 +281,40 @@ static int igt_kmod_unload_r(struct kmod_module *kmod, unsigned int flags)
 		}
 	}
 
-	return kmod_module_remove_module(kmod, flags);
+	for (tries = 0; tries < MAX_TRIES; tries++) {
+		bool loop = false;
+
+		err = kmod_module_remove_module(kmod, flags);
+
+		/* Only loop in the following cases */
+		switch (err) {
+		case -EBUSY:
+		case -EAGAIN:
+			/* Waiting for module to be available */
+			loop = true;
+			break;
+		default:
+			break;
+                }
+		if (!loop)
+			break;
+
+		igt_debug("Module %s failed to unload with err: %d on attempt: %i\n",
+			  mod_name, err, tries + 1);
+
+		usleep(SLEEP_DURATION);
+	}
+
+	if (err == -ENOENT)
+		igt_debug("Module %s could not be found.  Skipping.\n", mod_name);
+	else if (err)
+		igt_info("Module %s failed to unload with err: %d after ~%.1fms\n",
+			 mod_name, err, SLEEP_DURATION*tries/1000.);
+	else if (tries)
+		igt_info("Module %s unload took ~%.1fms over %i attempts\n",
+			 mod_name, SLEEP_DURATION*tries/1000., tries + 1);
+
+	return err;
 }
 
 /**
Signature · 1 line
2.25.1
#2 lore raw

[igt-dev] ✓ Fi.CI.BAT: success for lib/igt_kmod: Allow some leeway in igt_kmod_unload_r

In reply to Jonathan Cavitt
== Series Details ==

== Series Details ==

Series: lib/igt_kmod: Allow some leeway in igt_kmod_unload_r
URL : https://patchwork.freedesktop.org/series/112566/
State : success

== Summary ==

CI Bug Log - changes from CI_DRM_12560 -> IGTPW_8320
====================================================

Summary
-------

**SUCCESS**

No regressions found.

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

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

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

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

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

### IGT changes ###

#### Suppressed ####

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

* {igt@kms_chamelium_hpd@common-hpd-after-suspend}:
- {bat-rpls-2}: NOTRUN -> [SKIP][1]
[1]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_8320/bat-rpls-2/igt@[email protected]

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

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

### IGT changes ###

#### Issues hit ####

* igt@gem_exec_gttfill@basic:
- fi-kbl-soraka: NOTRUN -> [SKIP][2] ([fdo#109271]) +7 similar issues
[2]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_8320/fi-kbl-soraka/igt@[email protected]

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

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

* igt@i915_selftest@live@execlists:
- fi-kbl-soraka: NOTRUN -> [INCOMPLETE][5] ([i915#7156])
[5]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_8320/fi-kbl-soraka/igt@i915_selftest@[email protected]

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

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

* igt@prime_vgem@basic-fence-flip:
- fi-bsw-kefka: NOTRUN -> [SKIP][8] ([fdo#109271]) +17 similar issues
[8]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_8320/fi-bsw-kefka/igt@[email protected]

#### Possible fixes ####

* igt@i915_selftest@live@reset:
- {bat-rpls-2}: [DMESG-FAIL][9] ([i915#4983]) -> [PASS][10]
[9]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_12560/bat-rpls-2/igt@i915_selftest@[email protected]
[10]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_8320/bat-rpls-2/igt@i915_selftest@[email protected]
- {bat-rpls-1}: [DMESG-FAIL][11] ([i915#4983]) -> [PASS][12]
[11]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_12560/bat-rpls-1/igt@i915_selftest@[email protected]
[12]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_8320/bat-rpls-1/igt@i915_selftest@[email protected]

* igt@kms_cursor_legacy@basic-busy-flip-before-cursor@atomic-transitions-varying-size:
- fi-bsw-n3050: [FAIL][13] ([i915#6298]) -> [PASS][14]
[13]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_12560/fi-bsw-n3050/igt@kms_cursor_legacy@basic-busy-flip-before-cursor@atomic-transitions-varying-size.html
[14]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_8320/fi-bsw-n3050/igt@kms_cursor_legacy@basic-busy-flip-before-cursor@atomic-transitions-varying-size.html

{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
[i915#1845]: https://gitlab.freedesktop.org/drm/intel/issues/1845
[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#4983]: https://gitlab.freedesktop.org/drm/intel/issues/4983
[i915#5334]: https://gitlab.freedesktop.org/drm/intel/issues/5334
[i915#6298]: https://gitlab.freedesktop.org/drm/intel/issues/6298
[i915#6367]: https://gitlab.freedesktop.org/drm/intel/issues/6367
[i915#6997]: https://gitlab.freedesktop.org/drm/intel/issues/6997
[i915#7156]: https://gitlab.freedesktop.org/drm/intel/issues/7156
[i915#7359]: https://gitlab.freedesktop.org/drm/intel/issues/7359
[i915#7699]: https://gitlab.freedesktop.org/drm/intel/issues/7699

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

* CI: CI-20190529 -> None
* IGT: IGT_7113 -> IGTPW_8320

CI-20190529: 20190529
CI_DRM_12560: 0eccbe4822259a5e1a78bb7a4c027514d26a2b23 @ git://anongit.freedesktop.org/gfx-ci/linux
IGTPW_8320: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_8320/index.html
IGT_7113: 15562e123ee6ed88163c7da2ef330dfe9bbd16a5 @ https://gitlab.freedesktop.org/drm/igt-gpu-tools.git

== Logs ==

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

#3 lore raw

[igt-dev] ✓ Fi.CI.IGT: success for lib/igt_kmod: Allow some leeway in igt_kmod_unload_r

In reply to Jonathan Cavitt
== Series Details ==

== Series Details ==

Series: lib/igt_kmod: Allow some leeway in igt_kmod_unload_r
URL : https://patchwork.freedesktop.org/series/112566/
State : success

== Summary ==

CI Bug Log - changes from CI_DRM_12560_full -> IGTPW_8320_full
====================================================

Summary
-------

**SUCCESS**

No regressions found.

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

Participating hosts (13 -> 10)
------------------------------

Missing (3): pig-skl-6260u pig-kbl-iris pig-glk-j5005

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

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

### IGT changes ###

#### Suppressed ####

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

* igt@gem_eio@unwedge-stress:
- {shard-dg1}: [PASS][1] -> [DMESG-FAIL][2]
[1]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_12560/shard-dg1-15/igt@[email protected]
[2]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_8320/shard-dg1-14/igt@[email protected]

* igt@i915_suspend@basic-s3-without-i915:
- {shard-dg1}: [PASS][3] -> [DMESG-WARN][4] +1 similar issue
[3]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_12560/shard-dg1-19/igt@[email protected]
[4]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_8320/shard-dg1-14/igt@[email protected]

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

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

### IGT changes ###

#### Issues hit ####

* igt@gem_exec_fair@basic-none-rrul@rcs0:
- shard-glk: [PASS][5] -> [FAIL][6] ([i915#2842]) +1 similar issue
[5]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_12560/shard-glk5/igt@gem_exec_fair@[email protected]
[6]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_8320/shard-glk1/igt@gem_exec_fair@[email protected]

* igt@gem_exec_fair@basic-pace-solo@rcs0:
- shard-apl: [PASS][7] -> [FAIL][8] ([i915#2842])
[7]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_12560/shard-apl6/igt@gem_exec_fair@[email protected]
[8]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_8320/shard-apl7/igt@gem_exec_fair@[email protected]

* igt@gem_lmem_swapping@heavy-verify-multi:
- shard-apl: NOTRUN -> [SKIP][9] ([fdo#109271] / [i915#4613])
[9]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_8320/shard-apl2/igt@[email protected]

* igt@gem_partial_pwrite_pread@writes-after-reads:
- shard-apl: [PASS][10] -> [INCOMPLETE][11] ([i915#7708])
[10]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_12560/shard-apl1/igt@[email protected]
[11]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_8320/shard-apl2/igt@[email protected]

* igt@gem_userptr_blits@vma-merge:
- shard-apl: NOTRUN -> [FAIL][12] ([i915#3318])
[12]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_8320/shard-apl1/igt@[email protected]

* igt@i915_selftest@perf@engine_cs:
- shard-snb: [PASS][13] -> [SKIP][14] ([fdo#109271])
[13]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_12560/shard-snb2/igt@i915_selftest@perf@engine_cs.html
[14]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_8320/shard-snb7/igt@i915_selftest@perf@engine_cs.html

* igt@kms_ccs@pipe-c-crc-primary-basic-y_tiled_gen12_rc_ccs_cc:
- shard-apl: NOTRUN -> [SKIP][15] ([fdo#109271] / [i915#3886]) +1 similar issue
[15]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_8320/shard-apl1/igt@kms_ccs@pipe-c-crc-primary-basic-y_tiled_gen12_rc_ccs_cc.html

* igt@kms_cursor_legacy@flip-vs-cursor@atomic-transitions:
- shard-apl: [PASS][16] -> [FAIL][17] ([i915#2346])
[16]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_12560/shard-apl1/igt@kms_cursor_legacy@[email protected]
[17]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_8320/shard-apl2/igt@kms_cursor_legacy@[email protected]

* igt@kms_frontbuffer_tracking@fbcpsr-2p-primscrn-spr-indfb-onoff:
- shard-apl: NOTRUN -> [SKIP][18] ([fdo#109271]) +28 similar issues
[18]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_8320/shard-apl3/igt@[email protected]

* igt@kms_psr2_sf@primary-plane-update-sf-dmg-area:
- shard-apl: NOTRUN -> [SKIP][19] ([fdo#109271] / [i915#658])
[19]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_8320/shard-apl2/igt@[email protected]

* igt@runner@aborted:
- shard-snb: NOTRUN -> [FAIL][20] ([i915#4312])
[20]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_8320/shard-snb7/igt@[email protected]

#### Possible fixes ####

* igt@api_intel_bb@object-reloc-keep-cache:
- {shard-rkl}: [SKIP][21] ([i915#3281]) -> [PASS][22] +7 similar issues
[21]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_12560/shard-rkl-2/igt@[email protected]
[22]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_8320/shard-rkl-5/igt@[email protected]

* igt@drm_fdinfo@most-busy-check-all@rcs0:
- {shard-rkl}: [FAIL][23] ([i915#7742]) -> [PASS][24]
[23]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_12560/shard-rkl-3/igt@drm_fdinfo@[email protected]
[24]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_8320/shard-rkl-6/igt@drm_fdinfo@[email protected]

* igt@gem_ctx_exec@basic-nohangcheck:
- {shard-tglu}: [FAIL][25] ([i915#6268]) -> [PASS][26]
[25]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_12560/shard-tglu-5/igt@[email protected]
[26]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_8320/shard-tglu-5/igt@[email protected]

* igt@gem_eio@in-flight-suspend:
- {shard-rkl}: [FAIL][27] ([fdo#103375]) -> [PASS][28]
[27]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_12560/shard-rkl-3/igt@[email protected]
[28]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_8320/shard-rkl-6/igt@[email protected]

* igt@gem_exec_fair@basic-none-share@rcs0:
- shard-glk: [FAIL][29] ([i915#2842]) -> [PASS][30]
[29]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_12560/shard-glk2/igt@gem_exec_fair@[email protected]
[30]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_8320/shard-glk5/igt@gem_exec_fair@[email protected]

* igt@gem_exec_fair@basic-none-solo@rcs0:
- {shard-rkl}: [FAIL][31] ([i915#2842]) -> [PASS][32]
[31]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_12560/shard-rkl-3/igt@gem_exec_fair@[email protected]
[32]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_8320/shard-rkl-6/igt@gem_exec_fair@[email protected]

* igt@gem_partial_pwrite_pread@writes-after-reads:
- {shard-rkl}: [SKIP][33] ([i915#3282]) -> [PASS][34] +7 similar issues
[33]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_12560/shard-rkl-3/igt@[email protected]
[34]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_8320/shard-rkl-5/igt@[email protected]

* igt@gem_softpin@noreloc-s3:
- shard-snb: [SKIP][35] ([fdo#109271]) -> [PASS][36]
[35]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_12560/shard-snb5/igt@[email protected]
[36]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_8320/shard-snb7/igt@[email protected]

* igt@gen9_exec_parse@bb-chained:
- {shard-rkl}: [SKIP][37] ([i915#2527]) -> [PASS][38] +1 similar issue
[37]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_12560/shard-rkl-3/igt@[email protected]
[38]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_8320/shard-rkl-5/igt@[email protected]

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

* igt@i915_pm_rpm@cursor:
- {shard-rkl}: [SKIP][41] ([i915#1849]) -> [PASS][42]
[41]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_12560/shard-rkl-5/igt@[email protected]
[42]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_8320/shard-rkl-6/igt@[email protected]

* igt@kms_async_flips@alternate-sync-async-flip@pipe-a-hdmi-a-4:
- {shard-dg1}: [FAIL][43] -> [PASS][44]
[43]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_12560/shard-dg1-15/igt@kms_async_flips@[email protected]
[44]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_8320/shard-dg1-17/igt@kms_async_flips@[email protected]

* igt@kms_ccs@pipe-b-bad-aux-stride-y_tiled_gen12_rc_ccs:
- {shard-rkl}: [SKIP][45] ([i915#1845] / [i915#4098]) -> [PASS][46] +21 similar issues
[45]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_12560/shard-rkl-3/igt@kms_ccs@pipe-b-bad-aux-stride-y_tiled_gen12_rc_ccs.html
[46]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_8320/shard-rkl-6/igt@kms_ccs@pipe-b-bad-aux-stride-y_tiled_gen12_rc_ccs.html

* igt@kms_cursor_crc@cursor-suspend@pipe-b-vga-1:
- shard-snb: [DMESG-WARN][47] ([i915#5090]) -> [PASS][48]
[47]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_12560/shard-snb4/igt@kms_cursor_crc@[email protected]
[48]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_8320/shard-snb2/igt@kms_cursor_crc@[email protected]

* igt@kms_cursor_legacy@2x-long-flip-vs-cursor-atomic:
- shard-glk: [FAIL][49] ([i915#72]) -> [PASS][50]
[49]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_12560/shard-glk9/igt@[email protected]
[50]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_8320/shard-glk4/igt@[email protected]

* igt@kms_cursor_legacy@flip-vs-cursor@atomic-transitions-varying-size:
- shard-glk: [FAIL][51] ([i915#2346]) -> [PASS][52]
[51]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_12560/shard-glk5/igt@kms_cursor_legacy@[email protected]
[52]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_8320/shard-glk9/igt@kms_cursor_legacy@[email protected]

* igt@kms_fbcon_fbt@psr:
- {shard-rkl}: [SKIP][53] ([fdo#110189] / [i915#3955]) -> [PASS][54]
[53]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_12560/shard-rkl-2/igt@[email protected]
[54]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_8320/shard-rkl-6/igt@[email protected]

* igt@kms_flip@2x-flip-vs-expired-vblank-interruptible@ab-hdmi-a1-hdmi-a2:
- shard-glk: [FAIL][55] ([i915#2122]) -> [PASS][56]
[55]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_12560/shard-glk8/igt@kms_flip@[email protected]
[56]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_8320/shard-glk8/igt@kms_flip@[email protected]

* igt@kms_flip@flip-vs-expired-vblank-interruptible@a-hdmi-a2:
- shard-glk: [FAIL][57] ([i915#79]) -> [PASS][58]
[57]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_12560/shard-glk8/igt@kms_flip@[email protected]
[58]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_8320/shard-glk7/igt@kms_flip@[email protected]

* igt@kms_frontbuffer_tracking@fbc-1p-offscren-pri-indfb-draw-blt:
- {shard-tglu}: [SKIP][59] ([i915#1849]) -> [PASS][60]
[59]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_12560/shard-tglu-6/igt@[email protected]
[60]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_8320/shard-tglu-5/igt@[email protected]

* igt@kms_frontbuffer_tracking@psr-modesetfrombusy:
- {shard-rkl}: [SKIP][61] ([i915#1849] / [i915#4098]) -> [PASS][62] +14 similar issues
[61]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_12560/shard-rkl-5/igt@[email protected]
[62]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_8320/shard-rkl-6/igt@[email protected]

* igt@kms_psr@cursor_blt:
- {shard-rkl}: [SKIP][63] ([i915#1072]) -> [PASS][64] +2 similar issues
[63]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_12560/shard-rkl-2/igt@kms_psr@cursor_blt.html
[64]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_8320/shard-rkl-6/igt@kms_psr@cursor_blt.html

* igt@kms_universal_plane@disable-primary-vs-flip-pipe-a:
- {shard-rkl}: [SKIP][65] ([i915#1845] / [i915#4070] / [i915#4098]) -> [PASS][66]
[65]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_12560/shard-rkl-2/igt@[email protected]
[66]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_8320/shard-rkl-6/igt@[email protected]

* igt@kms_vblank@pipe-c-ts-continuation-idle:
- {shard-tglu}: [SKIP][67] ([i915#7651]) -> [PASS][68] +6 similar issues
[67]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_12560/shard-tglu-6/igt@[email protected]
[68]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_8320/shard-tglu-2/igt@[email protected]

* igt@kms_vblank@pipe-c-wait-idle:
- {shard-tglu}: [SKIP][69] ([i915#1845] / [i915#7651]) -> [PASS][70]
[69]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_12560/shard-tglu-6/igt@[email protected]
[70]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_8320/shard-tglu-7/igt@[email protected]

* igt@perf@gen12-oa-tlb-invalidate:
- {shard-rkl}: [SKIP][71] ([fdo#109289]) -> [PASS][72]
[71]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_12560/shard-rkl-5/igt@[email protected]
[72]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_8320/shard-rkl-1/igt@[email protected]

* igt@perf@gen8-unprivileged-single-ctx-counters:
- {shard-rkl}: [SKIP][73] ([i915#2436]) -> [PASS][74]
[73]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_12560/shard-rkl-4/igt@[email protected]
[74]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_8320/shard-rkl-5/igt@[email protected]

* igt@perf_pmu@idle@rcs0:
- {shard-rkl}: [FAIL][75] ([i915#4349]) -> [PASS][76]
[75]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_12560/shard-rkl-1/igt@perf_pmu@[email protected]
[76]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_8320/shard-rkl-5/igt@perf_pmu@[email protected]

* igt@prime_vgem@basic-fence-read:
- {shard-rkl}: [SKIP][77] ([fdo#109295] / [i915#3291] / [i915#3708]) -> [PASS][78]
[77]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_12560/shard-rkl-3/igt@[email protected]
[78]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_8320/shard-rkl-5/igt@[email protected]

* igt@sysfs_timeslice_duration@timeout@vcs0:
- {shard-dg1}: [FAIL][79] ([i915#1755]) -> [PASS][80]
[79]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_12560/shard-dg1-14/igt@sysfs_timeslice_duration@[email protected]
[80]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_8320/shard-dg1-14/igt@sysfs_timeslice_duration@[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#109274]: https://bugs.freedesktop.org/show_bug.cgi?id=109274
[fdo#109280]: https://bugs.freedesktop.org/show_bug.cgi?id=109280
[fdo#109283]: https://bugs.freedesktop.org/show_bug.cgi?id=109283
[fdo#109285]: https://bugs.freedesktop.org/show_bug.cgi?id=109285
[fdo#109289]: https://bugs.freedesktop.org/show_bug.cgi?id=109289
[fdo#109295]: https://bugs.freedesktop.org/show_bug.cgi?id=109295
[fdo#109300]: https://bugs.freedesktop.org/show_bug.cgi?id=109300
[fdo#109302]: https://bugs.freedesktop.org/show_bug.cgi?id=109302
[fdo#109303]: https://bugs.freedesktop.org/show_bug.cgi?id=109303
[fdo#109308]: https://bugs.freedesktop.org/show_bug.cgi?id=109308
[fdo#109313]: https://bugs.freedesktop.org/show_bug.cgi?id=109313
[fdo#109314]: https://bugs.freedesktop.org/show_bug.cgi?id=109314
[fdo#109315]: https://bugs.freedesktop.org/show_bug.cgi?id=109315
[fdo#109506]: https://bugs.freedesktop.org/show_bug.cgi?id=109506
[fdo#110189]: https://bugs.freedesktop.org/show_bug.cgi?id=110189
[fdo#110542]: https://bugs.freedesktop.org/show_bug.cgi?id=110542
[fdo#110723]: https://bugs.freedesktop.org/show_bug.cgi?id=110723
[fdo#111068]: https://bugs.freedesktop.org/show_bug.cgi?id=111068
[fdo#111614]: https://bugs.freedesktop.org/show_bug.cgi?id=111614
[fdo#111615]: https://bugs.freedesktop.org/show_bug.cgi?id=111615
[fdo#111644]: https://bugs.freedesktop.org/show_bug.cgi?id=111644
[fdo#111656]: https://bugs.freedesktop.org/show_bug.cgi?id=111656
[fdo#111825]: https://bugs.freedesktop.org/show_bug.cgi?id=111825
[fdo#111827]: https://bugs.freedesktop.org/show_bug.cgi?id=111827
[fdo#112054]: https://bugs.freedesktop.org/show_bug.cgi?id=112054
[i915#1072]: https://gitlab.freedesktop.org/drm/intel/issues/1072
[i915#132]: https://gitlab.freedesktop.org/drm/intel/issues/132
[i915#1397]: https://gitlab.freedesktop.org/drm/intel/issues/1397
[i915#1755]: https://gitlab.freedesktop.org/drm/intel/issues/1755
[i915#1825]: https://gitlab.freedesktop.org/drm/intel/issues/1825
[i915#1839]: https://gitlab.freedesktop.org/drm/intel/issues/1839
[i915#1845]: https://gitlab.freedesktop.org/drm/intel/issues/1845
[i915#1849]: https://gitlab.freedesktop.org/drm/intel/issues/1849
[i915#2122]: https://gitlab.freedesktop.org/drm/intel/issues/2122
[i915#2190]: https://gitlab.freedesktop.org/drm/intel/issues/2190
[i915#2346]: https://gitlab.freedesktop.org/drm/intel/issues/2346
[i915#2436]: https://gitlab.freedesktop.org/drm/intel/issues/2436
[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#2582]: https://gitlab.freedesktop.org/drm/intel/issues/2582
[i915#2587]: https://gitlab.freedesktop.org/drm/intel/issues/2587
[i915#2658]: https://gitlab.freedesktop.org/drm/intel/issues/2658
[i915#2672]: https://gitlab.freedesktop.org/drm/intel/issues/2672
[i915#2705]: https://gitlab.freedesktop.org/drm/intel/issues/2705
[i915#280]: https://gitlab.freedesktop.org/drm/intel/issues/280
[i915#284]: https://gitlab.freedesktop.org/drm/intel/issues/284
[i915#2842]: https://gitlab.freedesktop.org/drm/intel/issues/2842
[i915#2856]: https://gitlab.freedesktop.org/drm/intel/issues/2856
[i915#2920]: https://gitlab.freedesktop.org/drm/intel/issues/2920
[i915#2994]: https://gitlab.freedesktop.org/drm/intel/issues/2994
[i915#3116]: https://gitlab.freedesktop.org/drm/intel/issues/3116
[i915#3281]: https://gitlab.freedesktop.org/drm/intel/issues/3281
[i915#3282]: https://gitlab.freedesktop.org/drm/intel/issues/3282
[i915#3291]: https://gitlab.freedesktop.org/drm/intel/issues/3291
[i915#3297]: https://gitlab.freedesktop.org/drm/intel/issues/3297
[i915#3299]: https://gitlab.freedesktop.org/drm/intel/issues/3299
[i915#3318]: https://gitlab.freedesktop.org/drm/intel/issues/3318
[i915#3359]: https://gitlab.freedesktop.org/drm/intel/issues/3359
[i915#3361]: https://gitlab.freedesktop.org/drm/intel/issues/3361
[i915#3458]: https://gitlab.freedesktop.org/drm/intel/issues/3458
[i915#3469]: https://gitlab.freedesktop.org/drm/intel/issues/3469
[i915#3539]: https://gitlab.freedesktop.org/drm/intel/issues/3539
[i915#3546]: https://gitlab.freedesktop.org/drm/intel/issues/3546
[i915#3555]: https://gitlab.freedesktop.org/drm/intel/issues/3555
[i915#3558]: https://gitlab.freedesktop.org/drm/intel/issues/3558
[i915#3591]: https://gitlab.freedesktop.org/drm/intel/issues/3591
[i915#3637]: https://gitlab.freedesktop.org/drm/intel/issues/3637
[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#3734]: https://gitlab.freedesktop.org/drm/intel/issues/3734
[i915#3742]: https://gitlab.freedesktop.org/drm/intel/issues/3742
[i915#3840]: https://gitlab.freedesktop.org/drm/intel/issues/3840
[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#4079]: https://gitlab.freedesktop.org/drm/intel/issues/4079
[i915#4083]: https://gitlab.freedesktop.org/drm/intel/issues/4083
[i915#4098]: https://gitlab.freedesktop.org/drm/intel/issues/4098
[i915#4103]: https://gitlab.freedesktop.org/drm/intel/issues/4103
[i915#426]: https://gitlab.freedesktop.org/drm/intel/issues/426
[i915#4270]: https://gitlab.freedesktop.org/drm/intel/issues/4270
[i915#4312]: https://gitlab.freedesktop.org/drm/intel/issues/4312
[i915#433]: https://gitlab.freedesktop.org/drm/intel/issues/433
[i915#4349]: https://gitlab.freedesktop.org/drm/intel/issues/4349
[i915#4525]: https://gitlab.freedesktop.org/drm/intel/issues/4525
[i915#4538]: https://gitlab.freedesktop.org/drm/intel/issues/4538
[i915#4613]: https://gitlab.freedesktop.org/drm/intel/issues/4613
[i915#4771]: https://gitlab.freedesktop.org/drm/intel/issues/4771
[i915#4852]: https://gitlab.freedesktop.org/drm/intel/issues/4852
[i915#5090]: https://gitlab.freedesktop.org/drm/intel/issues/5090
[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#5288]: https://gitlab.freedesktop.org/drm/intel/issues/5288
[i915#5289]: https://gitlab.freedesktop.org/drm/intel/issues/5289
[i915#5325]: https://gitlab.freedesktop.org/drm/intel/issues/5325
[i915#5327]: https://gitlab.freedesktop.org/drm/intel/issues/5327
[i915#533]: https://gitlab.freedesktop.org/drm/intel/issues/533
[i915#5439]: https://gitlab.freedesktop.org/drm/intel/issues/5439
[i915#5461]: https://gitlab.freedesktop.org/drm/intel/issues/5461
[i915#5784]: https://gitlab.freedesktop.org/drm/intel/issues/5784
[i915#6095]: https://gitlab.freedesktop.org/drm/intel/issues/6095
[i915#6117]: https://gitlab.freedesktop.org/drm/intel/issues/6117
[i915#6227]: https://gitlab.freedesktop.org/drm/intel/issues/6227
[i915#6230]: https://gitlab.freedesktop.org/drm/intel/issues/6230
[i915#6245]: https://gitlab.freedesktop.org/drm/intel/issues/6245
[i915#6247]: https://gitlab.freedesktop.org/drm/intel/issues/6247
[i915#6248]: https://gitlab.freedesktop.org/drm/intel/issues/6248
[i915#6258]: https://gitlab.freedesktop.org/drm/intel/issues/6258
[i915#6268]: https://gitlab.freedesktop.org/drm/intel/issues/6268
[i915#6301]: https://gitlab.freedesktop.org/drm/intel/issues/6301
[i915#6335]: https://gitlab.freedesktop.org/drm/intel/issues/6335
[i915#6344]: https://gitlab.freedesktop.org/drm/intel/issues/6344
[i915#6403]: https://gitlab.freedesktop.org/drm/intel/issues/6403
[i915#6433]: https://gitlab.freedesktop.org/drm/intel/issues/6433
[i915#6497]: https://gitlab.freedesktop.org/drm/intel/issues/6497
[i915#6524]: https://gitlab.freedesktop.org/drm/intel/issues/6524
[i915#658]: https://gitlab.freedesktop.org/drm/intel/issues/658
[i915#6590]: https://gitlab.freedesktop.org/drm/intel/issues/6590
[i915#6768]: https://gitlab.freedesktop.org/drm/intel/issues/6768
[i915#6944]: https://gitlab.freedesktop.org/drm/intel/issues/6944
[i915#6953]: https://gitlab.freedesktop.org/drm/intel/issues/6953
[i915#7116]: https://gitlab.freedesktop.org/drm/intel/issues/7116
[i915#7118]: https://gitlab.freedesktop.org/drm/intel/issues/7118
[i915#7128]: https://gitlab.freedesktop.org/drm/intel/issues/7128
[i915#72]: https://gitlab.freedesktop.org/drm/intel/issues/72
[i915#7294]: https://gitlab.freedesktop.org/drm/intel/issues/7294
[i915#7456]: https://gitlab.freedesktop.org/drm/intel/issues/7456
[i915#7561]: https://gitlab.freedesktop.org/drm/intel/issues/7561
[i915#7582]: https://gitlab.freedesktop.org/drm/intel/issues/7582
[i915#7651]: https://gitlab.freedesktop.org/drm/intel/issues/7651
[i915#7697]: https://gitlab.freedesktop.org/drm/intel/issues/7697
[i915#7701]: https://gitlab.freedesktop.org/drm/intel/issues/7701
[i915#7707]: https://gitlab.freedesktop.org/drm/intel/issues/7707
[i915#7708]: https://gitlab.freedesktop.org/drm/intel/issues/7708
[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#79]: https://gitlab.freedesktop.org/drm/intel/issues/79

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

* CI: CI-20190529 -> None
* IGT: IGT_7113 -> IGTPW_8320
* Piglit: piglit_4509 -> None

CI-20190529: 20190529
CI_DRM_12560: 0eccbe4822259a5e1a78bb7a4c027514d26a2b23 @ git://anongit.freedesktop.org/gfx-ci/linux
IGTPW_8320: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_8320/index.html
IGT_7113: 15562e123ee6ed88163c7da2ef330dfe9bbd16a5 @ https://gitlab.freedesktop.org/drm/igt-gpu-tools.git
piglit_4509: fdc5a4ca11124ab8413c7988896eec4c97336694 @ git://anongit.freedesktop.org/piglit

== Logs ==

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

#4 lore raw
In reply to Jonathan Cavitt

Hi Jonathan,

Quoted 6 lines · Jonathan Cavitt

kmod_module_remove_module occasionally returns EAGAIN for mei_gsc in the setup of some gem_lmem_swapping subtests. Just because EAGAIN is returned doesn't mean the module is lost and unable to be unloaded. Try again some number of times (currently 10) before giving up.

Quoted 6 lines

Retries will occur for -EBUSY and -EAGAIN, as these imply the system is waiting for the target module can simply be waited for. All other errors exit immediately, but as the context for each error informs their relative severity, no warnings will be issued.

References: VLK-30287, VLK-39629

- ^ --------- ^
Please remove any refs not reachable from internet.

Quoted 28 lines
CC Stuart Summers <[email protected]>
CC Sandeep Kumar Parupalli <[email protected]>
CC Chris Wilson <[email protected]>
---
 lib/igt_kmod.c | 41 ++++++++++++++++++++++++++++++++++++++---
 1 file changed, 38 insertions(+), 3 deletions(-)
lib/igt_kmod.c +4 -1
index 17090110c..c840f9a17 100644
@@ -253,8 +253,11 @@ out:
 
 static int igt_kmod_unload_r(struct kmod_module *kmod, unsigned int flags)
 {
+#define MAX_TRIES	20
+#define SLEEP_DURATION	500000
 	struct kmod_list *holders, *pos;
-	int err = 0;
+	int err, tries;
+	const char *mod_name = kmod_module_get_name(kmod);
 
 	holders = kmod_module_get_holders(kmod);
 	kmod_list_foreach(pos, holders) {

lib/igt_kmod.c static int igt_kmod_unload_r(struct kmod_module *kmod, unsigned int flags) · line 272

Quoted 4 lines
lib/igt_kmod.c +0 -1
@@ -269,7 +272,6 @@ static int igt_kmod_unload_r(struct kmod_module *kmod, unsigned int flags)
 		return err;
 
 	if (igt_kmod_is_loading(kmod)) {
-		const char *mod_name = kmod_module_get_name(kmod);

Please describe this change, it looks unrelated.

Quoted 15 lines
lib/igt_kmod.c +7 -1
 		igt_debug("%s still initializing\n", mod_name);
 		err = igt_wait(!igt_kmod_is_loading(kmod), 10000, 100);
 		if (err < 0) {
@@ -279,7 +281,40 @@ static int igt_kmod_unload_r(struct kmod_module *kmod, unsigned int flags)
 		}
 	}
 
-	return kmod_module_remove_module(kmod, flags);
+	for (tries = 0; tries < MAX_TRIES; tries++) {
+		bool loop = false;
+
+		err = kmod_module_remove_module(kmod, flags);
+
+		/* Only loop in the following cases */
+		switch (err) {

lib/igt_kmod.c static int igt_kmod_unload_r(struct kmod_module *kmod, unsigned int flags) · line 300

Quoted 10 lines
lib/igt_kmod.c +10 -0
+		case -EBUSY:
+		case -EAGAIN:
+			/* Waiting for module to be available */
+			loop = true;
+			break;
+		default:
+			break;
+                }
+		if (!loop)
+			break;

May you turn switch into if() ? Now it looks convoluted.

lib/igt_kmod.c static int igt_kmod_unload_r(struct kmod_module *kmod, unsigned int flags) · line 309

Quoted 9 lines
lib/igt_kmod.c +9 -0
+
+		igt_debug("Module %s failed to unload with err: %d on attempt: %i\n",
+			  mod_name, err, tries + 1);
+
+		usleep(SLEEP_DURATION);
+	}
+
+	if (err == -ENOENT)
+		igt_debug("Module %s could not be found.  Skipping.\n", mod_name);

------------------------------------------------------- ^^^^^^^^^^ Please remove / Skipping./, you print debugs and you will not decide what caller will do.

One more error would be if driver is compiled in, so it just can not be removed (will it be -ENOTSUP ?).

lib/igt_kmod.c static int igt_kmod_unload_r(struct kmod_module *kmod, unsigned int flags) · line 311

Quoted 2 lines
lib/igt_kmod.c +2 -0
+	else if (err)
+		igt_info("Module %s failed to unload with err: %d after ~%.1fms\n",

--------------- ^
Please make them all into igt_info or igt_debug.

lib/igt_kmod.c static int igt_kmod_unload_r(struct kmod_module *kmod, unsigned int flags) · line 314

Quoted 3 lines
lib/igt_kmod.c +3 -0
+			 mod_name, err, SLEEP_DURATION*tries/1000.);
+	else if (tries)
+		igt_info("Module %s unload took ~%.1fms over %i attempts\n",

--------------- ^
Same here, please be consistent.

Regards,
Kamil

Quoted 9 lines
lib/igt_kmod.c +3 -0
+			 mod_name, SLEEP_DURATION*tries/1000., tries + 1);
+
+	return err;
 }
 
 /**
Signature · 1 line
2.25.1
#5 lore raw

-----Original Message-----
From: Kamil Konieczny <[email protected]>
Sent: Tuesday, January 17, 2023 8:07 AM
To: [email protected]
Cc: Cavitt, Jonathan <[email protected]>; Summers, Stuart <[email protected]>; Parupalli, Sandeep Kumar <[email protected]>; Chris Wilson <[email protected]>
Subject: Re: [igt-dev] [PATCH i-g-t] lib/igt_kmod: Allow some leeway in igt_kmod_unload_r

Quoted 49 lines

Hi Jonathan,

Quoted 6 lines · Jonathan Cavitt

kmod_module_remove_module occasionally returns EAGAIN for mei_gsc in the setup of some gem_lmem_swapping subtests. Just because EAGAIN is returned doesn't mean the module is lost and unable to be unloaded. Try again some number of times (currently 10) before giving up.

Quoted 6 lines

Retries will occur for -EBUSY and -EAGAIN, as these imply the system is waiting for the target module can simply be waited for. All other errors exit immediately, but as the context for each error informs their relative severity, no warnings will be issued.

References: VLK-30287, VLK-39629

- ^ --------- ^
Please remove any refs not reachable from internet.

Quoted 30 lines
CC Stuart Summers <[email protected]>
CC Sandeep Kumar Parupalli <[email protected]>
CC Chris Wilson <[email protected]>
---
 lib/igt_kmod.c | 41 ++++++++++++++++++++++++++++++++++++++---
 1 file changed, 38 insertions(+), 3 deletions(-)
lib/igt_kmod.c +4 -1
index 17090110c..c840f9a17 100644
@@ -253,8 +253,11 @@ out:
 
 static int igt_kmod_unload_r(struct kmod_module *kmod, unsigned int flags)
 {
+#define MAX_TRIES	20
+#define SLEEP_DURATION	500000
 	struct kmod_list *holders, *pos;
-	int err = 0;
+	int err, tries;
+	const char *mod_name = kmod_module_get_name(kmod);
 
 	holders = kmod_module_get_holders(kmod);
 	kmod_list_foreach(pos, holders) {
@@ -269,7 +272,6 @@ static int igt_kmod_unload_r(struct kmod_module *kmod, unsigned int flags)
 		return err;
 
Quoted 4 lines

lib/igt_kmod.c static int igt_kmod_unload_r(struct kmod_module *kmod, unsigned int flags) · line 272

Quoted 2 lines
lib/igt_kmod.c +0 -1
 	if (igt_kmod_is_loading(kmod)) {
-		const char *mod_name = kmod_module_get_name(kmod);

Please describe this change, it looks unrelated.

The debug/info messages at the end of this function print the mod_name, so we need to initialize it at the start of the test, rather than just when igt_kmod_is_loading.

Quoted 20 lines
Quoted 20 lines
lib/igt_kmod.c +11 -1
 		igt_debug("%s still initializing\n", mod_name);
 		err = igt_wait(!igt_kmod_is_loading(kmod), 10000, 100);
 		if (err < 0) {
@@ -279,7 +281,40 @@ static int igt_kmod_unload_r(struct kmod_module *kmod, unsigned int flags)
 		}
 	}
 
-	return kmod_module_remove_module(kmod, flags);
+	for (tries = 0; tries < MAX_TRIES; tries++) {
+		bool loop = false;
+
+		err = kmod_module_remove_module(kmod, flags);
+
+		/* Only loop in the following cases */
+		switch (err) {
+		case -EBUSY:
+		case -EAGAIN:
+			/* Waiting for module to be available */
+			loop = true;
Quoted 8 lines

lib/igt_kmod.c static int igt_kmod_unload_r(struct kmod_module *kmod, unsigned int flags) · line 300

Quoted 6 lines
lib/igt_kmod.c +6 -0
+			break;
+		default:
+			break;
+                }
+		if (!loop)
+			break;

May you turn switch into if() ? Now it looks convoluted.

This was designed to be easily extendable for additional cases where we want to wait for kmod_module_remove_module to succeed, or if certain other error cases needed additional management. I'll change it over to this:

		loop = err == -EBUSY || err == -EAGAIN;

I don't foresee this condition needing to be extended, but if it does, this line might get cumbersomely large.

Quoted 14 lines

lib/igt_kmod.c static int igt_kmod_unload_r(struct kmod_module *kmod, unsigned int flags) · line 309

Quoted 10 lines
lib/igt_kmod.c +9 -0
+
+		igt_debug("Module %s failed to unload with err: %d on attempt: %i\n",
+			  mod_name, err, tries + 1);
+
+		usleep(SLEEP_DURATION);
+	}
+
+	if (err == -ENOENT)
+		igt_debug("Module %s could not be found.  Skipping.\n", mod_name);

------------------------------------------------------- ^^^^^^^^^^ Please remove / Skipping./, you print debugs and you will not decide what caller will do.

Quoted 2 lines

One more error would be if driver is compiled in, so it just can not be removed (will it be -ENOTSUP ?).

All other errors should be caught below. We just don't inform on -ENOENT because that's an expected condition for builtins we won't be fixing, so we issue an igt_debug instead. In other words, we don't inform the user of -ENOENT errors because the desired end result for the user is still achieved (module X is not loaded). By comparison, it sounds like the -ENOTSUP case keeps the module loaded, so we should probably inform the user the module did not unload.

If this is incorrect, and -ENOTSUP is in the same class of error as -ENOENT, I can add that to the set of errors we don't directly inform on.

Quoted 5 lines

lib/igt_kmod.c static int igt_kmod_unload_r(struct kmod_module *kmod, unsigned int flags) · line 311

Quoted 3 lines
lib/igt_kmod.c +2 -0
+	else if (err)
+		igt_info("Module %s failed to unload with err: %d after ~%.1fms\n",

--------------- ^
Please make them all into igt_info or igt_debug.

Every error other than -ENOENT (for reasons explained above) is a genuine issue that should be warned on, but issuing a full warning isn't desirable in most cases, so we simply inform instead. We cannot hide these issues behind igt_debug.

Additionally, below, the module taking more than one attempt to unload is a genuine issue the user should be made privy to, so we shouldn't hide it behind igt_debug either.

It was argued to me in the past that we could just remove the -ENOENT igt_debug statement entirely. I'll do that and see how that's received, and if it's received positively, the reason for why igt_debug is used in the -ENOENT case and nowhere else is a moot distinction.
-Jonathan Cavitt

Quoted 20 lines

lib/igt_kmod.c static int igt_kmod_unload_r(struct kmod_module *kmod, unsigned int flags) · line 314

Quoted 4 lines
lib/igt_kmod.c +3 -0
+			 mod_name, err, SLEEP_DURATION*tries/1000.);
+	else if (tries)
+		igt_info("Module %s unload took ~%.1fms over %i attempts\n",

--------------- ^
Same here, please be consistent.

Regards,
Kamil

Quoted 9 lines
lib/igt_kmod.c +3 -0
+			 mod_name, SLEEP_DURATION*tries/1000., tries + 1);
+
+	return err;
 }
 
 /**
Signature · 1 line
2.25.1