Skip to contentSkip to conversation

Flush G2H handler during a GT reset

PATCH New Matthew Brost 2 participants 5 messages Jan 13, 2022

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

cover Flush G2H handler during a GT reset

After a small fix to error capture code, we now can flush G2H during a GT reset which simplifies code and seals some extreme corner case races.

Matthew Brost (2):
drm/i915: Allocate intel_engine_coredump_alloc with ALLOW_FAIL drm/i915/guc: Flush G2H handler during a GT reset

 .../gpu/drm/i915/gt/uc/intel_guc_submission.c  | 18 +-----------------
 drivers/gpu/drm/i915/i915_gpu_error.c          |  2 +-
 2 files changed, 2 insertions(+), 18 deletions(-)
Signature · 1 line
2.34.1
#1 lore raw

PATCH 1/2 drm/i915: Allocate intel_engine_coredump_alloc with ALLOW_FAIL

Allocate intel_engine_coredump_alloc with ALLOW_FAIL rather than GFP_KERNEL do fully decouple the error capture from fence signalling.

Fixes 8b91cdd4f8649 ("drm/i915: Use __GFP_KSWAPD_RECLAIM in the capture code")
---
 drivers/gpu/drm/i915/i915_gpu_error.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/gpu/drm/i915/i915_gpu_error.c +1 -1
index 67f3515f07e7a..aee42eae4729f 100644
@@ -1516,7 +1516,7 @@ capture_engine(struct intel_engine_cs *engine,
 	struct i915_request *rq = NULL;
 	unsigned long flags;
 
-	ee = intel_engine_coredump_alloc(engine, GFP_KERNEL);
+	ee = intel_engine_coredump_alloc(engine, ALLOW_FAIL);
 	if (!ee)
 		return NULL;
 
Signature · 1 line
2.34.1
#2 lore raw

PATCH 2/2 drm/i915/guc: Flush G2H handler during a GT reset

In reply to Matthew Brost

Now that the error capture is fully decoupled from fence signalling (request retirement to free memory, which is turn depends on resets) we can safely flush the G2H handler during a GT reset. This is eliminates corner cases where GuC generated G2H (e.g. engine resets) race with a GT reset.

---
 .../gpu/drm/i915/gt/uc/intel_guc_submission.c  | 18 +-----------------
 1 file changed, 1 insertion(+), 17 deletions(-)
drivers/gpu/drm/i915/gt/uc/intel_guc_submission.c +1 -17
index 23a40f10d376d..f8614ff904b2b 100644
@@ -1396,8 +1396,6 @@ static void guc_flush_destroyed_contexts(struct intel_guc *guc);
 
 void intel_guc_submission_reset_prepare(struct intel_guc *guc)
 {
-	int i;
-
 	if (unlikely(!guc_submission_initialized(guc))) {
 		/* Reset called during driver load? GuC not yet initialised! */
 		return;
@@ -1414,21 +1412,7 @@ void intel_guc_submission_reset_prepare(struct intel_guc *guc)
 
 	guc_flush_submissions(guc);
 	guc_flush_destroyed_contexts(guc);
-
-	/*
-	 * Handle any outstanding G2Hs before reset. Call IRQ handler directly
-	 * each pass as interrupt have been disabled. We always scrub for
-	 * outstanding G2H as it is possible for outstanding_submission_g2h to
-	 * be incremented after the context state update.
-	 */
-	for (i = 0; i < 4 && atomic_read(&guc->outstanding_submission_g2h); ++i) {
-		intel_guc_to_host_event_handler(guc);
-#define wait_for_reset(guc, wait_var) \
-		intel_guc_wait_for_pending_msg(guc, wait_var, false, (HZ / 20))
-		do {
-			wait_for_reset(guc, &guc->outstanding_submission_g2h);
-		} while (!list_empty(&guc->ct.requests.incoming));
-	}
+	flush_work(&guc->ct.requests.worker);
 
 	scrub_guc_desc_for_outstanding_g2h(guc);
 }
Signature · 1 line
2.34.1
#3 lore raw

[Intel-gfx] ✗ Fi.CI.CHECKPATCH: warning for Flush G2H handler during a GT reset

In reply to Matthew Brost
== Series Details ==

== Series Details ==

Series: Flush G2H handler during a GT reset
URL : https://patchwork.freedesktop.org/series/98855/
State : warning

== Summary ==

$ dim checkpatch origin/drm-tip
df8c84b965e7 drm/i915: Allocate intel_engine_coredump_alloc with ALLOW_FAIL
6af3f3db9124 drm/i915/guc: Flush G2H handler during a GT reset
-:49: WARNING:FROM_SIGN_OFF_MISMATCH: From:/Signed-off-by: email address mismatch: 'From: Matthew Brost <[email protected]>' != 'Signed-off-by: Matthew Brost <[email protected]>'

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

#4 lore raw

[Intel-gfx] ✗ Fi.CI.BAT: failure for Flush G2H handler during a GT reset

In reply to Matthew Brost
== Series Details ==

== Series Details ==

Series: Flush G2H handler during a GT reset
URL : https://patchwork.freedesktop.org/series/98855/
State : failure

== Summary ==

CI Bug Log - changes from CI_DRM_11079 -> Patchwork_21998
====================================================

Summary
-------

**FAILURE**

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

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

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

Participating hosts (39 -> 42)
------------------------------

Additional (6): bat-dg1-6 bat-dg1-5 bat-adlp-6 bat-rpls-1 bat-jsl-2 bat-jsl-1
Missing (3): fi-bsw-cyan shard-rkl shard-tglu

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

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

### IGT changes ###

#### Possible regressions ####

* igt@i915_selftest@live@hangcheck:
- bat-dg1-5: NOTRUN -> [INCOMPLETE][1]
[1]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_21998/bat-dg1-5/igt@i915_selftest@[email protected]
- bat-dg1-6: NOTRUN -> [INCOMPLETE][2]
[2]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_21998/bat-dg1-6/igt@i915_selftest@[email protected]

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

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

### IGT changes ###

#### Issues hit ####

* igt@amdgpu/amd_basic@cs-gfx:
- fi-hsw-4770: NOTRUN -> [SKIP][3] ([fdo#109271] / [fdo#109315]) +17 similar issues
[3]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_21998/fi-hsw-4770/igt@amdgpu/[email protected]

* igt@amdgpu/amd_basic@semaphore:
- fi-bdw-5557u: NOTRUN -> [SKIP][4] ([fdo#109271]) +31 similar issues
[4]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_21998/fi-bdw-5557u/igt@amdgpu/[email protected]

* igt@fbdev@info:
- bat-dg1-6: NOTRUN -> [SKIP][5] ([i915#2582]) +4 similar issues
[5]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_21998/bat-dg1-6/igt@[email protected]

* igt@gem_exec_gttfill@basic:
- bat-dg1-6: NOTRUN -> [SKIP][6] ([i915#4086])
[6]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_21998/bat-dg1-6/igt@[email protected]
- bat-dg1-5: NOTRUN -> [SKIP][7] ([i915#4086])
[7]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_21998/bat-dg1-5/igt@[email protected]

* igt@gem_mmap@basic:
- bat-dg1-6: NOTRUN -> [SKIP][8] ([i915#4083])
[8]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_21998/bat-dg1-6/igt@[email protected]
- bat-dg1-5: NOTRUN -> [SKIP][9] ([i915#4083])
[9]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_21998/bat-dg1-5/igt@[email protected]

* igt@gem_tiled_blits@basic:
- bat-dg1-6: NOTRUN -> [SKIP][10] ([i915#4077]) +2 similar issues
[10]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_21998/bat-dg1-6/igt@[email protected]

* igt@gem_tiled_fence_blits@basic:
- bat-dg1-5: NOTRUN -> [SKIP][11] ([i915#4077]) +2 similar issues
[11]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_21998/bat-dg1-5/igt@[email protected]

* igt@gem_tiled_pread_basic:
- bat-dg1-5: NOTRUN -> [SKIP][12] ([i915#4079]) +1 similar issue
[12]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_21998/bat-dg1-5/igt@gem_tiled_pread_basic.html
- bat-dg1-6: NOTRUN -> [SKIP][13] ([i915#4079]) +1 similar issue
[13]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_21998/bat-dg1-6/igt@gem_tiled_pread_basic.html

* igt@i915_pm_backlight@basic-brightness:
- bat-dg1-5: NOTRUN -> [SKIP][14] ([i915#1155])
[14]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_21998/bat-dg1-5/igt@[email protected]
- bat-dg1-6: NOTRUN -> [SKIP][15] ([i915#1155])
[15]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_21998/bat-dg1-6/igt@[email protected]

* igt@i915_pm_rpm@basic-pci-d3-state:
- fi-skl-6600u: [PASS][16] -> [FAIL][17] ([i915#3239])
[16]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_11079/fi-skl-6600u/igt@[email protected]
[17]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_21998/fi-skl-6600u/igt@[email protected]

* igt@kms_addfb_basic@addfb25-x-tiled-legacy:
- bat-dg1-6: NOTRUN -> [SKIP][18] ([i915#4212]) +7 similar issues
[18]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_21998/bat-dg1-6/igt@[email protected]

* igt@kms_addfb_basic@basic-y-tiled-legacy:
- bat-dg1-5: NOTRUN -> [SKIP][19] ([i915#4215])
[19]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_21998/bat-dg1-5/igt@[email protected]
- bat-dg1-6: NOTRUN -> [SKIP][20] ([i915#4215])
[20]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_21998/bat-dg1-6/igt@[email protected]

* igt@kms_addfb_basic@tile-pitch-mismatch:
- bat-dg1-5: NOTRUN -> [SKIP][21] ([i915#4212]) +7 similar issues
[21]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_21998/bat-dg1-5/igt@[email protected]

* igt@kms_busy@basic:
- bat-dg1-6: NOTRUN -> [SKIP][22] ([i915#4303])
[22]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_21998/bat-dg1-6/igt@[email protected]

* igt@kms_chamelium@dp-crc-fast:
- fi-bdw-5557u: NOTRUN -> [SKIP][23] ([fdo#109271] / [fdo#111827]) +8 similar issues
[23]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_21998/fi-bdw-5557u/igt@[email protected]

* igt@kms_chamelium@hdmi-edid-read:
- bat-dg1-6: NOTRUN -> [SKIP][24] ([fdo#111827]) +8 similar issues
[24]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_21998/bat-dg1-6/igt@[email protected]

* igt@kms_chamelium@hdmi-hpd-fast:
- bat-dg1-5: NOTRUN -> [SKIP][25] ([fdo#111827]) +8 similar issues
[25]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_21998/bat-dg1-5/igt@[email protected]

* igt@kms_cursor_legacy@basic-busy-flip-before-cursor-atomic:
- bat-dg1-6: NOTRUN -> [SKIP][26] ([i915#4103] / [i915#4213]) +1 similar issue
[26]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_21998/bat-dg1-6/igt@[email protected]

* igt@kms_cursor_legacy@basic-busy-flip-before-cursor-legacy:
- bat-dg1-5: NOTRUN -> [SKIP][27] ([i915#4103] / [i915#4213]) +1 similar issue
[27]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_21998/bat-dg1-5/igt@[email protected]

* igt@kms_cursor_legacy@basic-flip-after-cursor-legacy:
- bat-dg1-6: NOTRUN -> [SKIP][28] ([i915#4078]) +24 similar issues
[28]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_21998/bat-dg1-6/igt@[email protected]

* igt@kms_force_connector_basic@force-load-detect:
- bat-dg1-6: NOTRUN -> [SKIP][29] ([fdo#109285])
[29]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_21998/bat-dg1-6/igt@[email protected]
- bat-dg1-5: NOTRUN -> [SKIP][30] ([fdo#109285])
[30]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_21998/bat-dg1-5/igt@[email protected]

* igt@kms_psr@primary_page_flip:
- bat-dg1-5: NOTRUN -> [SKIP][31] ([i915#1072] / [i915#4078]) +3 similar issues
[31]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_21998/bat-dg1-5/igt@kms_psr@primary_page_flip.html

* igt@kms_psr@sprite_plane_onoff:
- bat-dg1-6: NOTRUN -> [SKIP][32] ([i915#1072] / [i915#4078]) +3 similar issues
[32]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_21998/bat-dg1-6/igt@kms_psr@sprite_plane_onoff.html

* igt@prime_vgem@basic-fence-mmap:
- bat-dg1-5: NOTRUN -> [SKIP][33] ([i915#3708] / [i915#4077]) +1 similar issue
[33]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_21998/bat-dg1-5/igt@[email protected]

* igt@prime_vgem@basic-gtt:
- bat-dg1-6: NOTRUN -> [SKIP][34] ([i915#3708] / [i915#4077]) +1 similar issue
[34]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_21998/bat-dg1-6/igt@[email protected]

* igt@prime_vgem@basic-userptr:
- bat-dg1-6: NOTRUN -> [SKIP][35] ([i915#3708] / [i915#4873])
[35]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_21998/bat-dg1-6/igt@[email protected]
- bat-dg1-5: NOTRUN -> [SKIP][36] ([i915#3708] / [i915#4873])
[36]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_21998/bat-dg1-5/igt@[email protected]

* igt@prime_vgem@basic-write:
- bat-dg1-5: NOTRUN -> [SKIP][37] ([i915#3708]) +3 similar issues
[37]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_21998/bat-dg1-5/igt@[email protected]
- bat-dg1-6: NOTRUN -> [SKIP][38] ([i915#3708]) +3 similar issues
[38]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_21998/bat-dg1-6/igt@[email protected]

#### Possible fixes ####

* igt@i915_selftest@live@hangcheck:
- fi-hsw-4770: [INCOMPLETE][39] -> [PASS][40]
[39]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_11079/fi-hsw-4770/igt@i915_selftest@[email protected]
[40]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_21998/fi-hsw-4770/igt@i915_selftest@[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#109285]: https://bugs.freedesktop.org/show_bug.cgi?id=109285
[fdo#109315]: https://bugs.freedesktop.org/show_bug.cgi?id=109315
[fdo#111827]: https://bugs.freedesktop.org/show_bug.cgi?id=111827
[i915#1072]: https://gitlab.freedesktop.org/drm/intel/issues/1072
[i915#1155]: https://gitlab.freedesktop.org/drm/intel/issues/1155
[i915#2190]: https://gitlab.freedesktop.org/drm/intel/issues/2190
[i915#2582]: https://gitlab.freedesktop.org/drm/intel/issues/2582
[i915#3003]: https://gitlab.freedesktop.org/drm/intel/issues/3003
[i915#3239]: https://gitlab.freedesktop.org/drm/intel/issues/3239
[i915#3282]: https://gitlab.freedesktop.org/drm/intel/issues/3282
[i915#3291]: https://gitlab.freedesktop.org/drm/intel/issues/3291
[i915#3301]: https://gitlab.freedesktop.org/drm/intel/issues/3301
[i915#3708]: https://gitlab.freedesktop.org/drm/intel/issues/3708
[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#4086]: https://gitlab.freedesktop.org/drm/intel/issues/4086
[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#4215]: https://gitlab.freedesktop.org/drm/intel/issues/4215
[i915#4303]: https://gitlab.freedesktop.org/drm/intel/issues/4303
[i915#4613]: https://gitlab.freedesktop.org/drm/intel/issues/4613
[i915#4873]: https://gitlab.freedesktop.org/drm/intel/issues/4873
[i915#4898]: https://gitlab.freedesktop.org/drm/intel/issues/4898
[i915#533]: https://gitlab.freedesktop.org/drm/intel/issues/533

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

* Linux: CI_DRM_11079 -> Patchwork_21998

CI-20190529: 20190529
CI_DRM_11079: fd69ca3bcb1f4080babbb2790de47dad5c14f358 @ git://anongit.freedesktop.org/gfx-ci/linux
IGT_6326: ec75f64fcbcf4aac58fbf1bf629e8f59b19db4ce @ https://gitlab.freedesktop.org/drm/igt-gpu-tools.git
Patchwork_21998: 6af3f3db9124ef6e2c0d099b490624d9f3bbc8b7 @ git://anongit.freedesktop.org/gfx-ci/linux

== Linux commits ==

6af3f3db9124 drm/i915/guc: Flush G2H handler during a GT reset df8c84b965e7 drm/i915: Allocate intel_engine_coredump_alloc with ALLOW_FAIL

== Logs ==

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