Skip to contentSkip to conversation

drm/i915/guc: Improve CTB error handling

PATCH Superseded Michal Wajdeczko 2 participants 6 messages Aug 21, 2021

Subsystems (2)

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore
#0 lore raw

cover drm/i915/guc: Improve CTB error handling

There was a gap in handling MMIO result from CTB (de)registration and while fixing it improve some other error reports.

Michal Wajdeczko (4):
drm/i915/guc: Verify result from CTB (de)register action drm/i915/guc: Print error name on CTB (de)registration failure drm/i915/guc: Print error name on CTB send failure drm/i915/guc: Move and improve error message for missed CTB reply

 drivers/gpu/drm/i915/gt/uc/intel_guc_ct.c | 30 ++++++++++++++---------
 1 file changed, 18 insertions(+), 12 deletions(-)
Signature · 1 line
2.25.1
#1 lore raw

PATCH 1/4 drm/i915/guc: Verify result from CTB (de)register action

In commit b839a869dfc9 ("drm/i915/guc: Add support for data reporting in GuC responses") we missed the hypothetical case that GuC might return positive non-zero value as success data.

While that would be lucky treated as error case, and at the end will result in reporting valid -EIO, in the meantime this value will be passed to ERR_PTR that could be misleading.

v2: rebased

---
 drivers/gpu/drm/i915/gt/uc/intel_guc_ct.c | 10 ++++++++--
 1 file changed, 8 insertions(+), 2 deletions(-)
drivers/gpu/drm/i915/gt/uc/intel_guc_ct.c +8 -2
index 22b4733b55e2..4e6bb2d6b058 100644
@@ -168,12 +168,15 @@ static int guc_action_register_ct_buffer(struct intel_guc *guc, u32 type,
 		FIELD_PREP(HOST2GUC_REGISTER_CTB_REQUEST_MSG_2_DESC_ADDR, desc_addr),
 		FIELD_PREP(HOST2GUC_REGISTER_CTB_REQUEST_MSG_3_BUFF_ADDR, buff_addr),
 	};
+	int ret;
 
 	GEM_BUG_ON(type != GUC_CTB_TYPE_HOST2GUC && type != GUC_CTB_TYPE_GUC2HOST);
 	GEM_BUG_ON(size % SZ_4K);
 
 	/* CT registration must go over MMIO */
-	return intel_guc_send_mmio(guc, request, ARRAY_SIZE(request), NULL, 0);
+	ret = intel_guc_send_mmio(guc, request, ARRAY_SIZE(request), NULL, 0);
+
+	return ret > 0 ? -EPROTO : ret;
 }
 
 static int ct_register_buffer(struct intel_guc_ct *ct, u32 type,
@@ -201,11 +204,14 @@ static int guc_action_deregister_ct_buffer(struct intel_guc *guc, u32 type)
 		FIELD_PREP(GUC_HXG_REQUEST_MSG_0_ACTION, GUC_ACTION_HOST2GUC_DEREGISTER_CTB),
 		FIELD_PREP(HOST2GUC_DEREGISTER_CTB_REQUEST_MSG_1_TYPE, type),
 	};
+	int ret;
 
 	GEM_BUG_ON(type != GUC_CTB_TYPE_HOST2GUC && type != GUC_CTB_TYPE_GUC2HOST);
 
 	/* CT deregistration must go over MMIO */
-	return intel_guc_send_mmio(guc, request, ARRAY_SIZE(request), NULL, 0);
+	ret = intel_guc_send_mmio(guc, request, ARRAY_SIZE(request), NULL, 0);
+
+	return ret > 0 ? -EPROTO : ret;
 }
 
 static int ct_deregister_buffer(struct intel_guc_ct *ct, u32 type)
Signature · 1 line
2.25.1
#2 lore raw

PATCH 2/4 drm/i915/guc: Print error name on CTB (de)registration failure

In reply to Michal Wajdeczko

Instead of plain error value (%d) print more user friendly error name (%pe).

---
 drivers/gpu/drm/i915/gt/uc/intel_guc_ct.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)
drivers/gpu/drm/i915/gt/uc/intel_guc_ct.c +4 -4
index 4e6bb2d6b058..de5705fc3d22 100644
@@ -191,8 +191,8 @@ static int ct_register_buffer(struct intel_guc_ct *ct, u32 type,
 	err = guc_action_register_ct_buffer(ct_to_guc(ct), type,
 					    desc_addr, buff_addr, size);
 	if (unlikely(err))
-		CT_ERROR(ct, "Failed to register %s buffer (err=%d)\n",
-			 guc_ct_buffer_type_to_str(type), err);
+		CT_ERROR(ct, "Failed to register %s buffer (%pe)\n",
+			 guc_ct_buffer_type_to_str(type), ERR_PTR(err));
 	return err;
 }
 
@@ -219,8 +219,8 @@ static int ct_deregister_buffer(struct intel_guc_ct *ct, u32 type)
 	int err = guc_action_deregister_ct_buffer(ct_to_guc(ct), type);
 
 	if (unlikely(err))
-		CT_ERROR(ct, "Failed to deregister %s buffer (err=%d)\n",
-			 guc_ct_buffer_type_to_str(type), err);
+		CT_ERROR(ct, "Failed to deregister %s buffer (%pe)\n",
+			 guc_ct_buffer_type_to_str(type), ERR_PTR(err));
 	return err;
 }
 
Signature · 1 line
2.25.1
#3 lore raw

PATCH 3/4 drm/i915/guc: Print error name on CTB send failure

In reply to Michal Wajdeczko

Instead of plain error value (%d) print more user friendly error name (%pe).

---
 drivers/gpu/drm/i915/gt/uc/intel_guc_ct.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/gpu/drm/i915/gt/uc/intel_guc_ct.c +2 -2
index de5705fc3d22..5658c9c8c890 100644
@@ -781,8 +781,8 @@ int intel_guc_ct_send(struct intel_guc_ct *ct, const u32 *action, u32 len,
 
 	ret = ct_send(ct, action, len, response_buf, response_buf_size, &status);
 	if (unlikely(ret < 0)) {
-		CT_ERROR(ct, "Sending action %#x failed (err=%d status=%#X)\n",
-			 action[0], ret, status);
+		CT_ERROR(ct, "Sending action %#x failed (%pe) status=%#X\n",
+			 action[0], ERR_PTR(ret), status);
 	} else if (unlikely(ret)) {
 		CT_DEBUG(ct, "send action %#x returned %d (%#x)\n",
 			 action[0], ret, ret);
Signature · 1 line
2.25.1
#4 lore raw

PATCH 4/4 drm/i915/guc: Move and improve error message for missed CTB reply

In reply to Michal Wajdeczko

If we timeout waiting for a CT reply we print very simple error message. Improve that and by moving error reporting to the caller we can use CT_ERROR instead of DRM_ERROR and report just fence as error code will be reported later anyway.

---
 drivers/gpu/drm/i915/gt/uc/intel_guc_ct.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)
drivers/gpu/drm/i915/gt/uc/intel_guc_ct.c +4 -4
index 5658c9c8c890..a15d7cb30292 100644
@@ -528,9 +528,6 @@ static int wait_for_ct_request_update(struct ct_request *req, u32 *status)
 		err = wait_for(done, GUC_CTB_RESPONSE_TIMEOUT_LONG_MS);
 #undef done
 
-	if (unlikely(err))
-		DRM_ERROR("CT: fence %u err %d\n", req->fence, err);
-
 	*status = req->status;
 	return err;
 }
@@ -728,8 +725,11 @@ static int ct_send(struct intel_guc_ct *ct,
 
 	err = wait_for_ct_request_update(&request, status);
 	g2h_release_space(ct, GUC_CTB_HXG_MSG_MAX_LEN);
-	if (unlikely(err))
+	if (unlikely(err)) {
+		CT_ERROR(ct, "No response for request %#x (fence %u)\n",
+			 action[0], request.fence);
 		goto unlink;
+	}
 
 	if (FIELD_GET(GUC_HXG_MSG_0_TYPE, *status) != GUC_HXG_TYPE_RESPONSE_SUCCESS) {
 		err = -EIO;
Signature · 1 line
2.25.1
#5 lore raw

[Intel-gfx] ✗ Fi.CI.BAT: failure for drm/i915/guc: Improve CTB error handling (rev2)

In reply to Michal Wajdeczko
== Series Details ==

== Series Details ==

Series: drm/i915/guc: Improve CTB error handling (rev2)
URL : https://patchwork.freedesktop.org/series/92118/
State : failure

== Summary ==

CI Bug Log - changes from CI_DRM_10505 -> Patchwork_20863
====================================================

Summary
-------

**FAILURE**

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

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

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

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

### IGT changes ###

#### Possible regressions ####

* igt@i915_selftest@live@gt_pm:
- fi-rkl-11600: [PASS][1] -> [DMESG-FAIL][2]
[1]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_10505/fi-rkl-11600/igt@i915_selftest@live@gt_pm.html
[2]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_20863/fi-rkl-11600/igt@i915_selftest@live@gt_pm.html

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

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

### IGT changes ###

#### Issues hit ####

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

* igt@amdgpu/amd_prime@i915-to-amd:
- fi-kbl-soraka: NOTRUN -> [SKIP][4] ([fdo#109271])
[4]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_20863/fi-kbl-soraka/igt@amdgpu/[email protected]

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

* igt@i915_pm_backlight@basic-brightness:
- fi-tgl-1115g4: NOTRUN -> [SKIP][7] ([i915#1155])
[7]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_20863/fi-tgl-1115g4/igt@[email protected]

* igt@i915_pm_rpm@module-reload:
- fi-tgl-1115g4: NOTRUN -> [INCOMPLETE][8] ([i915#4006])
[8]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_20863/fi-tgl-1115g4/igt@[email protected]

* igt@i915_selftest@live@late_gt_pm:
- fi-bsw-nick: [PASS][9] -> [DMESG-FAIL][10] ([i915#2927])
[9]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_10505/fi-bsw-nick/igt@i915_selftest@live@late_gt_pm.html
[10]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_20863/fi-bsw-nick/igt@i915_selftest@live@late_gt_pm.html

* igt@kms_addfb_basic@too-wide:
- fi-tgl-1115g4: NOTRUN -> [DMESG-WARN][11] ([i915#4002]) +91 similar issues
[11]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_20863/fi-tgl-1115g4/igt@[email protected]

* igt@kms_chamelium@common-hpd-after-suspend:
- fi-tgl-1115g4: NOTRUN -> [SKIP][12] ([fdo#111827]) +8 similar issues
[12]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_20863/fi-tgl-1115g4/igt@[email protected]

* igt@kms_chamelium@hdmi-edid-read:
- fi-kbl-8809g: NOTRUN -> [SKIP][13] ([fdo#109271] / [fdo#111827]) +8 similar issues
[13]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_20863/fi-kbl-8809g/igt@[email protected]

* igt@kms_force_connector_basic@force-load-detect:
- fi-tgl-1115g4: NOTRUN -> [SKIP][14] ([fdo#109285])
[14]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_20863/fi-tgl-1115g4/igt@[email protected]

* igt@kms_pipe_crc_basic@compare-crc-sanitycheck-pipe-d:
- fi-kbl-8809g: NOTRUN -> [SKIP][15] ([fdo#109271] / [i915#533])
[15]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_20863/fi-kbl-8809g/igt@[email protected]

* igt@kms_psr@cursor_plane_move:
- fi-kbl-8809g: NOTRUN -> [SKIP][16] ([fdo#109271]) +35 similar issues
[16]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_20863/fi-kbl-8809g/igt@kms_psr@cursor_plane_move.html

* igt@kms_psr@primary_mmap_gtt:
- fi-tgl-1115g4: NOTRUN -> [SKIP][17] ([i915#1072]) +2 similar issues
[17]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_20863/fi-tgl-1115g4/igt@kms_psr@primary_mmap_gtt.html

* igt@kms_psr@primary_page_flip:
- fi-tgl-1115g4: NOTRUN -> [SKIP][18] ([i915#1072] / [i915#1385])
[18]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_20863/fi-tgl-1115g4/igt@kms_psr@primary_page_flip.html

* igt@prime_vgem@basic-userptr:
- fi-tgl-1115g4: NOTRUN -> [SKIP][19] ([i915#3301])
[19]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_20863/fi-tgl-1115g4/igt@[email protected]

* igt@runner@aborted:
- fi-bsw-nick: NOTRUN -> [FAIL][20] ([fdo#109271] / [i915#1436])
[20]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_20863/fi-bsw-nick/igt@[email protected]
- fi-tgl-1115g4: NOTRUN -> [FAIL][21] ([i915#2722] / [i915#3834])
[21]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_20863/fi-tgl-1115g4/igt@[email protected]

#### Possible fixes ####

* igt@gem_exec_suspend@basic-s3:
- fi-kbl-8809g: [DMESG-WARN][22] ([i915#3848]) -> [PASS][23]
[22]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_10505/fi-kbl-8809g/igt@[email protected]
[23]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_20863/fi-kbl-8809g/igt@[email protected]

* igt@i915_selftest@live@workarounds:
- fi-rkl-guc: [INCOMPLETE][24] ([i915#3920]) -> [PASS][25]
[24]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_10505/fi-rkl-guc/igt@i915_selftest@[email protected]
[25]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_20863/fi-rkl-guc/igt@i915_selftest@[email protected]

[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#1385]: https://gitlab.freedesktop.org/drm/intel/issues/1385
[i915#1436]: https://gitlab.freedesktop.org/drm/intel/issues/1436
[i915#2190]: https://gitlab.freedesktop.org/drm/intel/issues/2190
[i915#2722]: https://gitlab.freedesktop.org/drm/intel/issues/2722
[i915#2927]: https://gitlab.freedesktop.org/drm/intel/issues/2927
[i915#3301]: https://gitlab.freedesktop.org/drm/intel/issues/3301
[i915#3834]: https://gitlab.freedesktop.org/drm/intel/issues/3834
[i915#3848]: https://gitlab.freedesktop.org/drm/intel/issues/3848
[i915#3920]: https://gitlab.freedesktop.org/drm/intel/issues/3920
[i915#4002]: https://gitlab.freedesktop.org/drm/intel/issues/4002
[i915#4006]: https://gitlab.freedesktop.org/drm/intel/issues/4006
[i915#533]: https://gitlab.freedesktop.org/drm/intel/issues/533

Participating hosts (40 -> 36)
------------------------------

Additional (1): fi-tgl-1115g4
Missing (5): fi-ilk-m540 fi-hsw-4200u fi-bsw-cyan bat-jsl-1 fi-bdw-samus

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

* Linux: CI_DRM_10505 -> Patchwork_20863

CI-20190529: 20190529
CI_DRM_10505: 7c36ed237585ed2f645439e62dafccac070d5e33 @ git://anongit.freedesktop.org/gfx-ci/linux
IGT_6181: e7a9ab2f21a67b1ab3f4093ec0bd775647308ba6 @ https://gitlab.freedesktop.org/drm/igt-gpu-tools.git
Patchwork_20863: d7ef8ec9f5aba6b0136c4fc31d6ce46c430038b3 @ git://anongit.freedesktop.org/gfx-ci/linux

== Linux commits ==

d7ef8ec9f5ab drm/i915/guc: Move and improve error message for missed CTB reply 79c6d42ce7c4 drm/i915/guc: Print error name on CTB send failure 5e017f9360bc drm/i915/guc: Print error name on CTB (de)registration failure f03ab1f83763 drm/i915/guc: Verify result from CTB (de)register action

== Logs ==

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