Skip to contentSkip to conversation

More error capture improvements

PATCH Superseded [email protected] 3 participants 8 messages Feb 17, 2023 – Mar 8, 2023

Subsystems (2)

v2 of 3 Superseded Latest is v3 →

lore
Share & tools
lore
#0 lore raw

v2 cover More error capture improvements

From: John Harrison <[email protected]>

Ecodes got lost with the switch to GuC based register lists. Put them back.

Seqno values got lost with the switch to per context timelines. Put those back too.

v2: Rework the timeline patch to just read the single seqno value rather than copying the entire object.

John Harrison (3):
drm/i915/guc: Fix missing ecodes drm/i915/guc: Clean up of register capture search drm/i915: Include timeline seqno in error capture

 .../gpu/drm/i915/gt/uc/intel_guc_capture.c    | 27 ++++++++++++++++---
 drivers/gpu/drm/i915/i915_gpu_error.c         |  3 +++
 drivers/gpu/drm/i915/i915_gpu_error.h         |  1 +
 3 files changed, 28 insertions(+), 3 deletions(-)
Signature · 1 line
2.39.1
#1 lore raw

PATCH v2 1/3 drm/i915/guc: Fix missing ecodes

From: John Harrison <[email protected]>

Error captures are tagged with an 'ecode'. This is a pseduo-unique magic number that is meant to distinguish similar seeming bugs with different underlying signatures. It is a combination of two ring state registers. Unfortunately, the register state being used is only valid in execlist mode. In GuC mode, the register state exists in a separate list of arbitrary register address/value pairs rather than the named entry structure. So, search through that list to find the two exciting registers and copy them over to the structure's named members.

v2: if else if instead of if if (Alan)

Fixes a6f0f9cf330a ("drm/i915/guc: Plumb GuC-capture into gpu_coredump")
Cc Alan Previn <[email protected]>
Cc Umesh Nerlige Ramappa <[email protected]>
Cc Lucas De Marchi <[email protected]>
Cc Jani Nikula <[email protected]>
Cc Joonas Lahtinen <[email protected]>
Cc Rodrigo Vivi <[email protected]>
Cc Tvrtko Ursulin <[email protected]>
Cc Matt Roper <[email protected]>
Cc Aravind Iddamsetty <[email protected]>
Cc Michael Cheng <[email protected]>
Cc Matthew Brost <[email protected]>
Cc Bruce Chang <[email protected]>
Cc Daniele Ceraolo Spurio <[email protected]>
Cc Matthew Auld <[email protected]>
---
 .../gpu/drm/i915/gt/uc/intel_guc_capture.c    | 22 +++++++++++++++++++
 1 file changed, 22 insertions(+)
drivers/gpu/drm/i915/gt/uc/intel_guc_capture.c +22 -0
index 101d44de729b1..36196cbb24c6b 100644
@@ -1562,6 +1562,27 @@ int intel_guc_capture_print_engine_node(struct drm_i915_error_state_buf *ebuf,
 
 #endif //CONFIG_DRM_I915_CAPTURE_ERROR
 
+static void guc_capture_find_ecode(struct intel_engine_coredump *ee)
+{
+	struct gcap_reg_list_info *reginfo;
+	struct guc_mmio_reg *regs;
+	i915_reg_t reg_ipehr = RING_IPEHR(0);
+	i915_reg_t reg_instdone = RING_INSTDONE(0);
+	int i;
+
+	if (!ee->guc_capture_node)
+		return;
+
+	reginfo = ee->guc_capture_node->reginfo + GUC_CAPTURE_LIST_TYPE_ENGINE_INSTANCE;
+	regs = reginfo->regs;
+	for (i = 0; i < reginfo->num_regs; i++) {
+		if (regs[i].offset == reg_ipehr.reg)
+			ee->ipehr = regs[i].value;
+		else if (regs[i].offset == reg_instdone.reg)
+			ee->instdone.instdone = regs[i].value;
+	}
+}
+
 void intel_guc_capture_free_node(struct intel_engine_coredump *ee)
 {
 	if (!ee || !ee->guc_capture_node)
@@ -1601,6 +1622,7 @@ void intel_guc_capture_get_matching_node(struct intel_gt *gt,
 			list_del(&n->link);
 			ee->guc_capture_node = n;
 			ee->guc_capture = guc->capture;
+			guc_capture_find_ecode(ee);
 			return;
 		}
 	}
Signature · 1 line
2.39.1
#2 lore raw

PATCH v2 2/3 drm/i915/guc: Clean up of register capture search

In reply to [email protected]

From: John Harrison <[email protected]>

The comparison in the search for a matching register capture node was not the most readable. It was also assuming that a zero GuC id means invalid, which it does not. So remove one invalid term, one redundant term and re-format to keep each term on a single line, and only one term per line.

---
 drivers/gpu/drm/i915/gt/uc/intel_guc_capture.c | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)
drivers/gpu/drm/i915/gt/uc/intel_guc_capture.c +2 -3
index 36196cbb24c6b..cf49188db6a6e 100644
@@ -1616,9 +1616,8 @@ void intel_guc_capture_get_matching_node(struct intel_gt *gt,
 	list_for_each_entry_safe(n, ntmp, &guc->capture->outlist, link) {
 		if (n->eng_inst == GUC_ID_TO_ENGINE_INSTANCE(ee->engine->guc_id) &&
 		    n->eng_class == GUC_ID_TO_ENGINE_CLASS(ee->engine->guc_id) &&
-		    n->guc_id && n->guc_id == ce->guc_id.id &&
-		    (n->lrca & CTX_GTT_ADDRESS_MASK) && (n->lrca & CTX_GTT_ADDRESS_MASK) ==
-		    (ce->lrc.lrca & CTX_GTT_ADDRESS_MASK)) {
+		    n->guc_id == ce->guc_id.id &&
+		    (n->lrca & CTX_GTT_ADDRESS_MASK) == (ce->lrc.lrca & CTX_GTT_ADDRESS_MASK)) {
 			list_del(&n->link);
 			ee->guc_capture_node = n;
 			ee->guc_capture = guc->capture;
Signature · 1 line
2.39.1
#3 lore raw

PATCH v2 3/3 drm/i915: Include timeline seqno in error capture

In reply to [email protected]

From: John Harrison <[email protected]>

The seqno value actually written out to memory is no longer in the regular HWSP. Instead, it is now in its own private timeline buffer. Thus, it is no longer visible in an error capture. So, explicitly read the value and include that in the capture.

---
 drivers/gpu/drm/i915/i915_gpu_error.c | 3 +++
 drivers/gpu/drm/i915/i915_gpu_error.h | 1 +
 2 files changed, 4 insertions(+)
drivers/gpu/drm/i915/i915_gpu_error.c +3 -0
index 904f21e1380cd..036a65c9cbf67 100644
@@ -505,6 +505,7 @@ static void error_print_context(struct drm_i915_error_state_buf *m,
 		   header, ctx->comm, ctx->pid, ctx->sched_attr.priority,
 		   ctx->guilty, ctx->active,
 		   ctx->total_runtime, ctx->avg_runtime);
+	err_printf(m, "  context timeline seqno %d\n", ctx->hwsp_seqno);
 }
 
 static struct i915_vma_coredump *
@@ -1395,6 +1396,8 @@ static bool record_context(struct i915_gem_context_coredump *e,
 	e->sched_attr = ctx->sched;
 	e->guilty = atomic_read(&ctx->guilty_count);
 	e->active = atomic_read(&ctx->active_count);
+	e->hwsp_seqno = (ce->timeline && ce->timeline->hwsp_seqno) ?
+				*ce->timeline->hwsp_seqno : ~0U;
 
 	e->total_runtime = intel_context_get_total_runtime_ns(ce);
 	e->avg_runtime = intel_context_get_avg_runtime_ns(ce);
drivers/gpu/drm/i915/i915_gpu_error.h +1 -0
index 56027ffbce51f..a91932cc65317 100644
@@ -107,6 +107,7 @@ struct intel_engine_coredump {
 		int active;
 		int guilty;
 		struct i915_sched_attr sched_attr;
+		u32 hwsp_seqno;
 	} context;
 
 	struct i915_vma_coredump *vma;
Signature · 1 line
2.39.1
Reviewed-by on v2 3/3
#4 lore raw

Re: [Intel-gfx] [PATCH v2 3/3] drm/i915: Include timeline seqno in error capture

Quoted 8 lines · On Thu, 2023-02-16 at 18:24 -0800, [email protected] wrote:

From: John Harrison <[email protected]>

The seqno value actually written out to memory is no longer in the regular HWSP. Instead, it is now in its own private timeline buffer. Thus, it is no longer visible in an error capture. So, explicitly read the value and include that in the capture.

alan: snip.

simple one ... LGTM

#5 lore raw

Re: [Intel-gfx] [PATCH v2 3/3] drm/i915: Include timeline seqno in error capture

Quoted 8 lines · Alan Previn
Quoted 7 lines · On Thu, 2023-02-16 at 18:24 -0800, [email protected] wrote:

From: John Harrison <[email protected]>

The seqno value actually written out to memory is no longer in the regular HWSP. Instead, it is now in its own private timeline buffer. Thus, it is no longer visible in an error capture. So, explicitly read the value and include that in the capture.

Quoted 5 lines
Quoted 1 line

alan: snip.

simple one ... LGTM

alan: i just realized i missed something. On the following hunk,
seqno printout should be using a %u format specifier since we could use the upper most bit of that 32 bit value:
Consider above a conditional RB (based on this fix) - sorry about that.

@@ -505,6 +505,7 @@ static void error_print_context(struct drm_i915_error_state_buf *m,
header, ctx->comm, ctx->pid, ctx->sched_attr.priority, ctx->guilty, ctx->active,
ctx->total_runtime, ctx->avg_runtime);
+ err_printf(m, " context timeline seqno %d\n", ctx->hwsp_seqno);

#6 lore raw

[Intel-gfx] ✗ Fi.CI.CHECKPATCH: warning for More error capture improvements (rev2)

In reply to [email protected]
== Series Details ==

== Series Details ==

Series: More error capture improvements (rev2)
URL : https://patchwork.freedesktop.org/series/113628/
State : warning

== Summary ==

Error: dim checkpatch failed
ee9d337e5e7f drm/i915/guc: Fix missing ecodes -:15: WARNING:REPEATED_WORD: Possible repeated word: 'if' #15:
v2: if else if instead of if if (Alan)

total: 0 errors, 1 warnings, 0 checks, 34 lines checked fa6abadc061c drm/i915/guc: Clean up of register capture search f2ef1d45f6b2 drm/i915: Include timeline seqno in error capture

#7 lore raw

[Intel-gfx] ✗ Fi.CI.BAT: failure for More error capture improvements (rev2)

In reply to [email protected]
== Series Details ==

== Series Details ==

Series: More error capture improvements (rev2)
URL : https://patchwork.freedesktop.org/series/113628/
State : failure

== Summary ==

CI Bug Log - changes from CI_DRM_12754 -> Patchwork_113628v2
====================================================

Summary
-------

**FAILURE**

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

If you think the reported changes have nothing to do with the changes introduced in Patchwork_113628v2, 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_113628v2/index.html

Participating hosts (40 -> 39)
------------------------------

Additional (1): fi-kbl-soraka
Missing (2): bat-dg1-6 fi-snb-2520m

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

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

### IGT changes ###

#### Possible regressions ####

* igt@i915_suspend@basic-s3-without-i915:
- fi-cfl-8700k: [PASS][1] -> [ABORT][2]
[1]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_12754/fi-cfl-8700k/igt@[email protected]
[2]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_113628v2/fi-cfl-8700k/igt@[email protected]

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

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

### IGT changes ###

#### Issues hit ####

* igt@gem_exec_gttfill@basic:
- fi-pnv-d510: [PASS][3] -> [FAIL][4] ([i915#7229])
[3]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_12754/fi-pnv-d510/igt@[email protected]
[4]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_113628v2/fi-pnv-d510/igt@[email protected]

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

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

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

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

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

* igt@i915_suspend@basic-s2idle-without-i915:
- fi-apl-guc: [PASS][10] -> [DMESG-WARN][11] ([i915#1982])
[10]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_12754/fi-apl-guc/igt@[email protected]
[11]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_113628v2/fi-apl-guc/igt@[email protected]

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

* igt@kms_chamelium_hpd@common-hpd-after-suspend:
- bat-dg2-11: NOTRUN -> [SKIP][13] ([i915#7828])
[13]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_113628v2/bat-dg2-11/igt@[email protected]

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

#### Possible fixes ####

* igt@i915_selftest@live@guc:
- bat-rpls-2: [DMESG-WARN][15] ([i915#7852]) -> [PASS][16]
[15]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_12754/bat-rpls-2/igt@i915_selftest@[email protected]
[16]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_113628v2/bat-rpls-2/igt@i915_selftest@[email protected]

* igt@i915_selftest@live@slpc:
- bat-rpls-1: [DMESG-FAIL][17] ([i915#6367] / [i915#7996]) -> [PASS][18]
[17]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_12754/bat-rpls-1/igt@i915_selftest@[email protected]
[18]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_113628v2/bat-rpls-1/igt@i915_selftest@[email protected]

* igt@i915_selftest@live@workarounds:
- bat-dg2-11: [INCOMPLETE][19] ([i915#7913]) -> [PASS][20]
[19]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_12754/bat-dg2-11/igt@i915_selftest@[email protected]
[20]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_113628v2/bat-dg2-11/igt@i915_selftest@[email protected]

[fdo#109271]: https://bugs.freedesktop.org/show_bug.cgi?id=109271
[i915#1886]: https://gitlab.freedesktop.org/drm/intel/issues/1886
[i915#1982]: https://gitlab.freedesktop.org/drm/intel/issues/1982
[i915#2190]: https://gitlab.freedesktop.org/drm/intel/issues/2190
[i915#4613]: https://gitlab.freedesktop.org/drm/intel/issues/4613
[i915#5334]: https://gitlab.freedesktop.org/drm/intel/issues/5334
[i915#5354]: https://gitlab.freedesktop.org/drm/intel/issues/5354
[i915#6367]: https://gitlab.freedesktop.org/drm/intel/issues/6367
[i915#7229]: https://gitlab.freedesktop.org/drm/intel/issues/7229
[i915#7828]: https://gitlab.freedesktop.org/drm/intel/issues/7828
[i915#7852]: https://gitlab.freedesktop.org/drm/intel/issues/7852
[i915#7872]: https://gitlab.freedesktop.org/drm/intel/issues/7872
[i915#7913]: https://gitlab.freedesktop.org/drm/intel/issues/7913
[i915#7996]: https://gitlab.freedesktop.org/drm/intel/issues/7996

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

* Linux: CI_DRM_12754 -> Patchwork_113628v2

CI-20190529: 20190529
CI_DRM_12754: e9f03769fd297b17cd356ec6274e4824511e750c @ git://anongit.freedesktop.org/gfx-ci/linux
IGT_7161: 5574f110ae838031eef6db5236bad02e8c2d2dee @ https://gitlab.freedesktop.org/drm/igt-gpu-tools.git
Patchwork_113628v2: e9f03769fd297b17cd356ec6274e4824511e750c @ git://anongit.freedesktop.org/gfx-ci/linux

### Linux commits

2530e7b9aef9 drm/i915: Include timeline seqno in error capture 366be0e6f630 drm/i915/guc: Clean up of register capture search bb4a9f9eb0fa drm/i915/guc: Fix missing ecodes

== Logs ==

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