Skip to contentSkip to conversation

Don't fail on HuC early init errors

PATCH In review Michal Wajdeczko 3 participants 13 messages Aug 4, 2019 – Aug 5, 2019

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

cover Don't fail on HuC early init errors

Next step to ignore all HuC related errors

Michal Wajdeczko (4):
drm/i915/guc: Prefer intel_guc_is_submission_supported drm/i915/huc: Prefer intel_huc_is_supported drm/i915/uc: Remove redundant GuC support checks drm/i915/uc: Don't fail on HuC early init errors

 drivers/gpu/drm/i915/gt/uc/intel_guc.c |  8 ++++----
 drivers/gpu/drm/i915/gt/uc/intel_huc.c |  9 +++++++--
 drivers/gpu/drm/i915/gt/uc/intel_uc.c  | 19 +++++--------------
 3 files changed, 16 insertions(+), 20 deletions(-)
Signature · 6 lines
2.19.2

_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
#1 lore raw

PATCH 1/4 drm/i915/guc: Prefer intel_guc_is_submission_supported

No need to use intel_uc_supports_guc_submission(uc) as we can directly use intel_guc_is_submission_supported(guc)

Cc Daniele Ceraolo Spurio <[email protected]>
Cc Chris Wilson <[email protected]>
---
 drivers/gpu/drm/i915/gt/uc/intel_guc.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)
drivers/gpu/drm/i915/gt/uc/intel_guc.c +4 -4
index 0ee8139885a5..f9c33062249f 100644
@@ -145,7 +145,7 @@ static u32 guc_ctl_feature_flags(struct intel_guc *guc)
 {
 	u32 flags = 0;
 
-	if (!intel_uc_supports_guc_submission(&guc_to_gt(guc)->uc))
+	if (!intel_guc_is_submission_supported(guc))
 		flags |= GUC_CTL_DISABLE_SCHEDULER;
 
 	return flags;
@@ -155,7 +155,7 @@ static u32 guc_ctl_ctxinfo_flags(struct intel_guc *guc)
 {
 	u32 flags = 0;
 
-	if (intel_uc_supports_guc_submission(&guc_to_gt(guc)->uc)) {
+	if (intel_guc_is_submission_supported(guc)) {
 		u32 ctxnum, base;
 
 		base = intel_guc_ggtt_offset(guc, guc->stage_desc_pool);
@@ -291,7 +291,7 @@ int intel_guc_init(struct intel_guc *guc)
 	if (ret)
 		goto err_ads;
 
-	if (intel_uc_supports_guc_submission(&gt->uc)) {
+	if (intel_guc_is_submission_supported(guc)) {
 		/*
 		 * This is stuff we need to have available at fw load time
 		 * if we are planning to enable submission later
@@ -330,7 +330,7 @@ void intel_guc_fini(struct intel_guc *guc)
 
 	i915_ggtt_disable_guc(gt->ggtt);
 
-	if (intel_uc_supports_guc_submission(&gt->uc))
+	if (intel_guc_is_submission_supported(guc))
 		intel_guc_submission_fini(guc);
 
 	intel_guc_ct_fini(&guc->ct);
Signature · 6 lines
2.19.2

_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
Reviewed-by on v1 1/4
#2 lore raw

Re: [PATCH 1/4] drm/i915/guc: Prefer intel_guc_is_submission_supported

Quoting Michal Wajdeczko (2019-08-04 20:50:49)

Quoted 6 lines

No need to use intel_uc_supports_guc_submission(uc) as we can directly use intel_guc_is_submission_supported(guc)

Cc Daniele Ceraolo Spurio <[email protected]>
Cc Chris Wilson <[email protected]>

-Chris
_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

#3 lore raw

PATCH 2/4 drm/i915/huc: Prefer intel_huc_is_supported

In reply to Michal Wajdeczko

No need to dance with intel_uc_supports_huc(uc) as we can directly use intel_huc_is_supported(huc)

Cc Daniele Ceraolo Spurio <[email protected]>
Cc Chris Wilson <[email protected]>
---
 drivers/gpu/drm/i915/gt/uc/intel_huc.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/gpu/drm/i915/gt/uc/intel_huc.c +1 -1
index ef54053c5ef9..66b2d5fdb317 100644
@@ -187,7 +187,7 @@ int intel_huc_check_status(struct intel_huc *huc)
 	intel_wakeref_t wakeref;
 	u32 status = 0;
 
-	if (!intel_uc_supports_huc(&gt->uc))
+	if (!intel_huc_is_supported(huc))
 		return -ENODEV;
 
 	with_intel_runtime_pm(&gt->i915->runtime_pm, wakeref)
Signature · 6 lines
2.19.2

_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
Reviewed-by on v1 2/4
#4 lore raw

Re: [PATCH 2/4] drm/i915/huc: Prefer intel_huc_is_supported

Quoting Michal Wajdeczko (2019-08-04 20:50:50)

Quoted 6 lines

No need to dance with intel_uc_supports_huc(uc) as we can directly use intel_huc_is_supported(huc)

Cc Daniele Ceraolo Spurio <[email protected]>
Cc Chris Wilson <[email protected]>

-Chris
_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

#5 lore raw

PATCH 3/4 drm/i915/uc: Remove redundant GuC support checks

In reply to Michal Wajdeczko

Since commit db81bc6eb9c0 ("drm/i915/uc: Consider enable_guc modparam during fw selection") we have started using firmware status as main indicator of the GuC support. No need to use same checks twice.

Cc Daniele Ceraolo Spurio <[email protected]>
Cc Chris Wilson <[email protected]>
---
 drivers/gpu/drm/i915/gt/uc/intel_uc.c | 11 +----------
 1 file changed, 1 insertion(+), 10 deletions(-)
drivers/gpu/drm/i915/gt/uc/intel_uc.c +1 -10
index fe526698eee2..1ddd252419ec 100644
@@ -306,9 +306,6 @@ int intel_uc_init(struct intel_uc *uc)
 	if (!intel_uc_supports_guc(uc))
 		return 0;
 
-	if (!intel_uc_fw_supported(&guc->fw))
-		return -ENODEV;
-
 	/* XXX: GuC submission is unavailable for now */
 	GEM_BUG_ON(intel_uc_supports_guc_submission(uc));
 
@@ -336,8 +333,6 @@ void intel_uc_fini(struct intel_uc *uc)
 	if (!intel_uc_supports_guc(uc))
 		return;
 
-	GEM_BUG_ON(!intel_uc_fw_supported(&guc->fw));
-
 	if (intel_uc_supports_huc(uc))
 		intel_huc_fini(&uc->huc);
 
@@ -351,7 +346,7 @@ static int __uc_sanitize(struct intel_uc *uc)
 	struct intel_guc *guc = &uc->guc;
 	struct intel_huc *huc = &uc->huc;
 
-	GEM_BUG_ON(!intel_uc_fw_supported(&guc->fw));
+	GEM_BUG_ON(!intel_uc_supports_guc(uc));
 
 	intel_huc_sanitize(huc);
 	intel_guc_sanitize(guc);
@@ -429,8 +424,6 @@ int intel_uc_init_hw(struct intel_uc *uc)
 	if (!intel_uc_supports_guc(uc))
 		return 0;
 
-	GEM_BUG_ON(!intel_uc_fw_supported(&guc->fw));
-
 	ret = uc_init_wopcm(uc);
 	if (ret)
 		goto err_out;
@@ -530,8 +523,6 @@ void intel_uc_fini_hw(struct intel_uc *uc)
 	if (!intel_guc_is_running(guc))
 		return;
 
-	GEM_BUG_ON(!intel_uc_fw_supported(&guc->fw));
-
 	if (intel_uc_supports_guc_submission(uc))
 		intel_guc_submission_disable(guc);
 
Signature · 6 lines
2.19.2

_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
Reviewed-by on v1 3/4
#6 lore raw

Re: [PATCH 3/4] drm/i915/uc: Remove redundant GuC support checks

Quoting Michal Wajdeczko (2019-08-04 20:50:51)

Quoted 8 lines

Since commit db81bc6eb9c0 ("drm/i915/uc: Consider enable_guc modparam during fw selection") we have started using firmware status as main indicator of the GuC support. No need to use same checks twice.

Cc Daniele Ceraolo Spurio <[email protected]>
Cc Chris Wilson <[email protected]>

-Chris
_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

#7 lore raw

PATCH 4/4 drm/i915/uc: Don't fail on HuC early init errors

In reply to Michal Wajdeczko

Since commit 301efe96f777 ("drm/i915/uc: Don't fail on HuC firmware failure") we can continue driver load after error during HuC firmware load or authentication, but we could still fail on any error during early HuC initialization. Change that by ignoring HuC related errors until hardware initialization phase where we can decide about next steps.

Cc Daniele Ceraolo Spurio <[email protected]>
Cc Chris Wilson <[email protected]>
---
 drivers/gpu/drm/i915/gt/uc/intel_huc.c | 7 ++++++-
 drivers/gpu/drm/i915/gt/uc/intel_uc.c  | 8 ++++----
 2 files changed, 10 insertions(+), 5 deletions(-)
drivers/gpu/drm/i915/gt/uc/intel_huc.c +6 -1
index 66b2d5fdb317..faaf8ad5ba89 100644
@@ -52,6 +52,11 @@ static int intel_huc_rsa_data_create(struct intel_huc *huc)
 	struct i915_vma *vma;
 	size_t copied;
 	void *vaddr;
+	int err;
+
+	err = i915_inject_load_error(gt->i915, -ENXIO);
+	if (err)
+		return err;
 
 	/*
 	 * HuC firmware will sit above GUC_GGTT_TOP and will not map
@@ -115,8 +120,8 @@ int intel_huc_init(struct intel_huc *huc)
 
 void intel_huc_fini(struct intel_huc *huc)
 {
-	intel_uc_fw_fini(&huc->fw);
 	intel_huc_rsa_data_destroy(huc);
+	intel_uc_fw_fini(&huc->fw);
 }
 
 /**
drivers/gpu/drm/i915/gt/uc/intel_uc.c +4 -4
index 1ddd252419ec..e87b7904ab7a 100644
@@ -316,14 +316,14 @@ int intel_uc_init(struct intel_uc *uc)
 	if (intel_uc_supports_huc(uc)) {
 		ret = intel_huc_init(huc);
 		if (ret)
-			goto err_guc;
+			goto out_huc;
 	}
 
 	return 0;
 
-err_guc:
-	intel_guc_fini(guc);
-	return ret;
+out_huc:
+	intel_uc_fw_cleanup_fetch(&huc->fw);
+	return 0;
 }
 
 void intel_uc_fini(struct intel_uc *uc)
Signature · 6 lines
2.19.2

_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
Reviewed-by on v1 4/4
#8 lore raw

Re: [PATCH 4/4] drm/i915/uc: Don't fail on HuC early init errors

Quoting Michal Wajdeczko (2019-08-04 20:50:52)

Quoted 10 lines

Since commit 301efe96f777 ("drm/i915/uc: Don't fail on HuC firmware failure") we can continue driver load after error during HuC firmware load or authentication, but we could still fail on any error during early HuC initialization. Change that by ignoring HuC related errors until hardware initialization phase where we can decide about next steps.

Cc Daniele Ceraolo Spurio <[email protected]>
Cc Chris Wilson <[email protected]>

So we just leave the HuC uninitialised and HUC_STATUS should then report no authentication. (We do scrub that at some point just in case the million resets did not?)

-Chris
_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

#9 lore raw

Re: [PATCH 4/4] drm/i915/uc: Don't fail on HuC early init errors

Quoted 3 lines · Chris Wilson

So we just leave the HuC uninitialised and HUC_STATUS should then report no authentication. (We do scrub that at some point just in case the million resets did not?)

Bspec says that it's RO from the host and it will be 0 out of reset
_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

#10 lore raw

✗ Fi.CI.BAT: failure for Don't fail on HuC early init errors

In reply to Michal Wajdeczko
== Series Details ==

== Series Details ==

Series: Don't fail on HuC early init errors
URL : https://patchwork.freedesktop.org/series/64668/
State : failure

== Summary ==

CI Bug Log - changes from CI_DRM_6624 -> Patchwork_13866
====================================================

Summary
-------

**FAILURE**

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

If you think the reported changes have nothing to do with the changes introduced in Patchwork_13866, 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_13866/

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

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

### IGT changes ###

#### Possible regressions ####

* igt@runner@aborted:
- fi-cml-u2: NOTRUN -> [FAIL][1]
[1]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_13866/fi-cml-u2/igt@[email protected]

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

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

### IGT changes ###

#### Issues hit ####

* igt@i915_selftest@live_hangcheck:
- fi-cml-u2: [PASS][2] -> [INCOMPLETE][3] ([fdo#110566])
[2]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6624/fi-cml-u2/igt@i915_selftest@live_hangcheck.html
[3]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_13866/fi-cml-u2/igt@i915_selftest@live_hangcheck.html

* igt@kms_chamelium@hdmi-hpd-fast:
- fi-kbl-7500u: [PASS][4] -> [FAIL][5] ([fdo#109485])
[4]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6624/fi-kbl-7500u/igt@[email protected]
[5]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_13866/fi-kbl-7500u/igt@[email protected]

#### Possible fixes ####

* igt@i915_module_load@reload:
- fi-blb-e6850: [INCOMPLETE][6] ([fdo#107718]) -> [PASS][7]
[6]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6624/fi-blb-e6850/igt@[email protected]
[7]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_13866/fi-blb-e6850/igt@[email protected]

* igt@i915_selftest@live_execlists:
- fi-skl-gvtdvm: [DMESG-FAIL][8] ([fdo#111108]) -> [PASS][9]
[8]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6624/fi-skl-gvtdvm/igt@i915_selftest@live_execlists.html
[9]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_13866/fi-skl-gvtdvm/igt@i915_selftest@live_execlists.html

* igt@kms_chamelium@hdmi-hpd-fast:
- fi-icl-u2: [FAIL][10] ([fdo#109483]) -> [PASS][11]
[10]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6624/fi-icl-u2/igt@[email protected]
[11]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_13866/fi-icl-u2/igt@[email protected]

* igt@kms_frontbuffer_tracking@basic:
- fi-icl-u2: [FAIL][12] ([fdo#103167]) -> [PASS][13]
[12]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6624/fi-icl-u2/igt@[email protected]
[13]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_13866/fi-icl-u2/igt@[email protected]

[fdo#103167]: https://bugs.freedesktop.org/show_bug.cgi?id=103167
[fdo#107718]: https://bugs.freedesktop.org/show_bug.cgi?id=107718
[fdo#109483]: https://bugs.freedesktop.org/show_bug.cgi?id=109483
[fdo#109485]: https://bugs.freedesktop.org/show_bug.cgi?id=109485
[fdo#110566]: https://bugs.freedesktop.org/show_bug.cgi?id=110566
[fdo#111108]: https://bugs.freedesktop.org/show_bug.cgi?id=111108

Participating hosts (55 -> 45)
------------------------------

Missing (10): fi-kbl-soraka fi-ilk-m540 fi-hsw-4200u fi-hsw-peppy fi-byt-squawks fi-bsw-cyan fi-pnv-d510 fi-icl-y fi-byt-clapper fi-bdw-samus

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

* CI: CI-20190529 -> None
* Linux: CI_DRM_6624 -> Patchwork_13866

CI-20190529: 20190529
CI_DRM_6624: 2bb7df95d4e058e61d9de39f1b97404592708d24 @ git://anongit.freedesktop.org/gfx-ci/linux
IGT_5120: b3138fbea79d5d7935e53530b90efe3e816236f4 @ git://anongit.freedesktop.org/xorg/app/intel-gpu-tools
Patchwork_13866: 24721ffd71eaf3bab0236318d53b49419bed5454 @ git://anongit.freedesktop.org/gfx-ci/linux

== Linux commits ==

24721ffd71ea drm/i915/uc: Don't fail on HuC early init errors 8ce238830fc6 drm/i915/uc: Remove redundant GuC support checks 7627d5a6eb80 drm/i915/huc: Prefer intel_huc_is_supported 326254b19fd1 drm/i915/guc: Prefer intel_guc_is_submission_supported

== Logs ==

For more details see: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_13866/
_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

#11 lore raw

Re: ✗ Fi.CI.BAT: failure for Don't fail on HuC early init errors

Quoted 33 lines · Patchwork

== Series Details ==

Series: Don't fail on HuC early init errors
URL : https://patchwork.freedesktop.org/series/64668/
State : failure

== Summary ==

CI Bug Log - changes from CI_DRM_6624 -> Patchwork_13866
====================================================

Summary
-------

**FAILURE**

Serious unknown changes coming with Patchwork_13866 absolutely need to
be
verified manually.
If you think the reported changes have nothing to do with the changes
introduced in Patchwork_13866, 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_13866/

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

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

Quoted 9 lines

### IGT changes ###

#### Possible regressions ####

* igt@runner@aborted:
- fi-cml-u2: NOTRUN -> [FAIL][1]
[1]:
https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_13866/fi-cml-u2/igt@[email protected]

hmm, looks unrelated (this CML is not using guc/huc at all)

<7>[    9.344398] [drm:intel_uc_init_early [i915]] enable_guc=0 (guc:no submission:no huc:no)
...
<4>[  486.270801] ------------[ cut here ]------------
<4>[  486.270843] list_add corruption. prev->next should be next (ffff8883c0fe17d8), but was ffff8883cb29c5a8. (prev=ffff8883cb29c5a8).
...
<4>[  486.270889] Call Trace:
<4>[  486.270945]  __i915_request_commit+0x35c/0x6a0 [i915]
<4>[  486.270991]  ? __i915_request_create+0x22c/0x4d0 [i915]
<4>[  486.271030]  __engine_park+0x64/0x200 [i915]
<4>[  486.271067]  __intel_wakeref_put_last+0x14/0x60 [i915]
<4>[  486.271104]  __igt_reset_engine+0x2be/0x490 [i915]
<4>[  486.271111]  ? __trace_bprintk+0x57/0x80
<4>[  486.271160]  __i915_subtests+0xb8/0x210 [i915]
<4>[  486.271205]  ? __i915_live_teardown+0x70/0x70 [i915]
<4>[  486.271248]  ? __intel_gt_live_setup+0x10/0x10 [i915]
<4>[  486.271287]  intel_hangcheck_live_selftests+0xa5/0x100 [i915]
<4>[  486.271332]  __run_selftests+0x112/0x170 [i915]
<4>[  486.271376]  i915_live_selftests+0x2c/0x60 [i915]
<4>[  486.271410]  i915_pci_probe+0x93/0x1b0 [i915]
<4>[  486.271414]  ? _raw_spin_unlock_irqrestore+0x39/0x60
<4>[  486.271419]  pci_device_probe+0x9e/0x120
<4>[  486.271423]  really_probe+0xea/0x3d0
<4>[  486.271426]  driver_probe_device+0x10b/0x120
<4>[  486.271429]  device_driver_attach+0x4a/0x50
<4>[  486.271431]  __driver_attach+0x97/0x130
<4>[  486.271434]  ? device_driver_attach+0x50/0x50
<4>[  486.271436]  bus_for_each_dev+0x74/0xc0
<4>[  486.271440]  bus_add_driver+0x13f/0x210
<4>[  486.271442]  ? 0xffffffffa0822000
<4>[  486.271444]  driver_register+0x56/0xe0
<4>[  486.271446]  ? 0xffffffffa0822000
<4>[  486.271449]  do_one_initcall+0x58/0x300
<4>[  486.271452]  ? do_init_module+0x1d/0x1f6
<4>[  486.271455]  ? rcu_read_lock_sched_held+0x6f/0x80
<4>[  486.271458]  ? kmem_cache_alloc_trace+0x2d1/0x300
<4>[  486.271462]  do_init_module+0x56/0x1f6
<4>[  486.271465]  load_module+0x25bd/0x2a40
<4>[  486.271477]  ? __se_sys_finit_module+0xd3/0xf0
<4>[  486.271479]  __se_sys_finit_module+0xd3/0xf0
<4>[  486.271487]  do_syscall_64+0x55/0x1c0

_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

#12 lore raw

Re: ✗ Fi.CI.BAT: failure for Don't fail on HuC early init errors

Quoting Michal Wajdeczko (2019-08-04 21:27:38)

Quoted 8 lines
Quoted 5 lines · Patchwork

* igt@runner@aborted:
- fi-cml-u2: NOTRUN -> [FAIL][1]
[1]:
https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_13866/fi-cml-u2/igt@[email protected]

Quoted 8 lines

hmm, looks unrelated (this CML is not using guc/huc at all)

<7>[    9.344398] [drm:intel_uc_init_early [i915]] enable_guc=0 (guc:no  
submission:no huc:no)
...
<4>[  486.270801] ------------[ cut here ]------------
<4>[  486.270843] list_add corruption. prev->next should be next  

(ffff8883c0fe17d8), but was ffff8883cb29c5a8. (prev=ffff8883cb29c5a8).

That really needs the timeline patches, if only for the lockdep markup. But I think it's
drm/i915: Protect request retirement with timeline->mutex
judging from the probable race.
-Chris
_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx