Skip to contentSkip to conversation

drm/i915/uc: Add few more load failure checkpoints

PATCH In review Michal Wajdeczko 4 participants 16 messages Jan 31, 2018 – Feb 1, 2018

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

PATCH 1/5 drm/i915/uc: Add few more load failure checkpoints

Additional load failure checkpoints added into uC initialization sequence should help us verify correctness of error handling.

---
 drivers/gpu/drm/i915/intel_uc.c | 11 +++++++++++
 1 file changed, 11 insertions(+)
drivers/gpu/drm/i915/intel_uc.c +11 -0
index e3f3509..2f80cab 100644
@@ -287,6 +287,9 @@ int intel_uc_init(struct drm_i915_private *dev_priv)
 	if (!HAS_GUC(dev_priv))
 		return -ENODEV;
 
+	if (i915_inject_load_failure())
+		return -ENODEV;
+
 	ret = intel_guc_init(guc);
 	if (ret)
 		return ret;
@@ -330,6 +333,11 @@ int intel_uc_init_hw(struct drm_i915_private *dev_priv)
 	if (!USES_GUC(dev_priv))
 		return 0;
 
+	if (i915_inject_load_failure()) {
+		ret = -ECANCELED;
+		goto err_out;
+	}
+
 	GEM_BUG_ON(!HAS_GUC(dev_priv));
 
 	guc_disable_communication(guc);
@@ -371,6 +379,9 @@ int intel_uc_init_hw(struct drm_i915_private *dev_priv)
 				 "retry %d more time(s)\n", ret, attempts);
 	}
 
+	if (i915_inject_load_failure())
+		ret = -ECANCELED;
+
 	/* Did we succeded or run out of retries? */
 	if (ret)
 		goto err_log_capture;
Signature · 6 lines
1.9.1

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

PATCH 2/5 drm/i915/guc: Don't forget to free GuC error log

We're freeing GuC error log in uc_fini_hw() that matches corresponding uc_init_hw() but we missed the point that this log object is copied on error path and in case of failure in uc_init_hw() we will leak this object as uc_fini_hw() is never called.

If we free this log object as part of the late uC cleanup, where we also release other firmware objects, we can avoid this BUG:

[70841.001413] BUG drm_i915_gem_object (Tainted: G     U  W       ): Objects remaining in drm_i915_gem_object on __kmem_cache_shutdown()
[70841.001436] INFO: Slab 0x00000000c94e41af objects=21 used=1 fp=0x000000001d60c40a flags=0x8000000000008100
[70841.001466] Call Trace:
[70841.001471]  dump_stack+0x5e/0x8e
[70841.001476]  slab_err+0x99/0xb0
[70841.001483]  ? __slab_alloc.isra.24.constprop.29+0x62/0x70
[70841.001491]  ? __kmalloc+0x1f5/0x320
[70841.001497]  __kmem_cache_shutdown+0x18b/0x400
[70841.001505]  shutdown_cache+0x13/0x1c0
[70841.001511]  kmem_cache_destroy+0x1c2/0x240
[70841.001517]  ? __mutex_unlock_slowpath+0x38/0x270
[70841.001559]  i915_gem_load_cleanup+0xbc/0x130 [i915]
[70841.001595]  i915_driver_cleanup_early+0x11/0x60 [i915]
[70841.001630]  i915_driver_load+0x708/0x1720 [i915]
[70841.001638]  ? trace_hardirqs_on_caller+0xe2/0x1c0
[70841.001673]  i915_pci_probe+0x2d/0x90 [i915]
[70841.001680]  pci_device_probe+0x9c/0x120
[70841.001687]  driver_probe_device+0x2a9/0x490
[70841.001694]  __driver_attach+0xd9/0xe0
[70841.001700]  ? driver_probe_device+0x490/0x490
[70841.001705]  bus_for_each_dev+0x57/0x90
[70841.001712]  bus_add_driver+0x1eb/0x260
[70841.001717]  ? 0xffffffffa0685000
[70841.001723]  driver_register+0x52/0xc0
[70841.001728]  ? 0xffffffffa0685000
[70841.001733]  do_one_initcall+0x39/0x170
[70841.001739]  ? rcu_read_lock_sched_held+0x6f/0x80
[70841.001746]  ? kmem_cache_alloc_trace+0x27b/0x2e0
[70841.001753]  do_init_module+0x56/0x1ec
[70841.001759]  load_module+0x219e/0x2550
[70841.001766]  ? vfs_read+0x121/0x140
[70841.001774]  ? SyS_finit_module+0xa5/0xe0
[70841.001779]  SyS_finit_module+0xa5/0xe0
[70841.001788]  entry_SYSCALL_64_fastpath+0x22/0x8f
[70841.001806] INFO: Object 0x00000000eab7ed96 @offset=6208
[70841.001850] INFO: Allocated in i915_gem_object_create.part.32+0x1f/0x260 [i915] age=38 cpu=0 pid=2708
[70841.001861] 	kmem_cache_alloc+0x23d/0x2d0
[70841.001897] 	i915_gem_object_create.part.32+0x1f/0x260 [i915]
[70841.001937] 	intel_guc_allocate_vma+0x15/0x100 [i915]
[70841.001977] 	intel_guc_log_create+0x34/0x1c0 [i915]
[70841.002014] 	intel_guc_init+0x5a/0x100 [i915]
[70841.002051] 	intel_uc_init+0x3e/0xb0 [i915]
[70841.002089] 	i915_gem_init+0x18e/0x540 [i915]
[70841.002123] 	i915_driver_load+0xa7a/0x1720 [i915]
[70841.002159] 	i915_pci_probe+0x2d/0x90 [i915]
[70841.002165] 	pci_device_probe+0x9c/0x120
[70841.002171] 	driver_probe_device+0x2a9/0x490
[70841.002177] 	__driver_attach+0xd9/0xe0
[70841.002182] 	bus_for_each_dev+0x57/0x90
[70841.002188] 	bus_add_driver+0x1eb/0x260
[70841.002193] 	driver_register+0x52/0xc0
[70841.002198] 	do_one_initcall+0x39/0x170
[70841.002462] kmem_cache_destroy drm_i915_gem_object: Slab cache still has objects
[70841.002491] Call Trace:
[70841.002497]  dump_stack+0x5e/0x8e
[70841.002503]  kmem_cache_destroy+0x1e0/0x240
[70841.002509]  ? __mutex_unlock_slowpath+0x38/0x270
[70841.002551]  i915_gem_load_cleanup+0xbc/0x130 [i915]
[70841.002586]  i915_driver_cleanup_early+0x11/0x60 [i915]
[70841.002621]  i915_driver_load+0x708/0x1720 [i915]
[70841.002629]  ? trace_hardirqs_on_caller+0xe2/0x1c0
[70841.002664]  i915_pci_probe+0x2d/0x90 [i915]
[70841.002671]  pci_device_probe+0x9c/0x120
[70841.002678]  driver_probe_device+0x2a9/0x490
[70841.002684]  __driver_attach+0xd9/0xe0
[70841.002690]  ? driver_probe_device+0x490/0x490
[70841.002696]  bus_for_each_dev+0x57/0x90
[70841.002702]  bus_add_driver+0x1eb/0x260
[70841.002708]  ? 0xffffffffa0685000
[70841.002713]  driver_register+0x52/0xc0
[70841.002719]  ? 0xffffffffa0685000
[70841.002724]  do_one_initcall+0x39/0x170
[70841.002731]  ? rcu_read_lock_sched_held+0x6f/0x80
[70841.002737]  ? kmem_cache_alloc_trace+0x27b/0x2e0
[70841.002745]  do_init_module+0x56/0x1ec
[70841.002751]  load_module+0x219e/0x2550
[70841.002758]  ? vfs_read+0x121/0x140
[70841.002766]  ? SyS_finit_module+0xa5/0xe0
[70841.002772]  SyS_finit_module+0xa5/0xe0
[70841.002781]  entry_SYSCALL_64_fastpath+0x22/0x8f
Cc Chris Wilson <[email protected]>
Cc Sagar Arun Kamble <[email protected]>
Cc Michal Winiarski <[email protected]>
Cc Joonas Lahtinen <[email protected]>
---
 drivers/gpu/drm/i915/intel_uc.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)
drivers/gpu/drm/i915/intel_uc.c +4 -2
index 2f80cab..3a13cbb 100644
@@ -27,6 +27,8 @@
 #include "intel_guc.h"
 #include "i915_drv.h"
 
+static void guc_free_load_err_log(struct intel_guc *guc);
+
 /* Reset GuC providing us with fresh state for both GuC and HuC.
  */
 static int __intel_uc_reset_hw(struct drm_i915_private *dev_priv)
@@ -183,6 +185,8 @@ void intel_uc_fini_fw(struct drm_i915_private *dev_priv)
 
 	if (USES_HUC(dev_priv))
 		intel_uc_fw_fini(&dev_priv->huc.fw);
+
+	guc_free_load_err_log(&dev_priv->guc);
 }
 
 /**
@@ -439,8 +443,6 @@ void intel_uc_fini_hw(struct drm_i915_private *dev_priv)
 {
 	struct intel_guc *guc = &dev_priv->guc;
 
-	guc_free_load_err_log(guc);
-
 	if (!USES_GUC(dev_priv))
 		return;
 
Signature · 6 lines
1.9.1

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

Re: [PATCH 2/5] drm/i915/guc: Don't forget to free GuC error log

Quoted 93 lines · Michal Wajdeczko

We're freeing GuC error log in uc_fini_hw() that matches corresponding uc_init_hw() but we missed the point that this log object is copied on error path and in case of failure in uc_init_hw() we will leak this object as uc_fini_hw() is never called.

If we free this log object as part of the late uC cleanup, where we also release other firmware objects, we can avoid this BUG:

[70841.001413] BUG drm_i915_gem_object (Tainted: G     U  W       ): Objects remaining in drm_i915_gem_object on __kmem_cache_shutdown()
[70841.001436] INFO: Slab 0x00000000c94e41af objects=21 used=1 fp=0x000000001d60c40a flags=0x8000000000008100
[70841.001466] Call Trace:
[70841.001471]  dump_stack+0x5e/0x8e
[70841.001476]  slab_err+0x99/0xb0
[70841.001483]  ? __slab_alloc.isra.24.constprop.29+0x62/0x70
[70841.001491]  ? __kmalloc+0x1f5/0x320
[70841.001497]  __kmem_cache_shutdown+0x18b/0x400
[70841.001505]  shutdown_cache+0x13/0x1c0
[70841.001511]  kmem_cache_destroy+0x1c2/0x240
[70841.001517]  ? __mutex_unlock_slowpath+0x38/0x270
[70841.001559]  i915_gem_load_cleanup+0xbc/0x130 [i915]
[70841.001595]  i915_driver_cleanup_early+0x11/0x60 [i915]
[70841.001630]  i915_driver_load+0x708/0x1720 [i915]
[70841.001638]  ? trace_hardirqs_on_caller+0xe2/0x1c0
[70841.001673]  i915_pci_probe+0x2d/0x90 [i915]
[70841.001680]  pci_device_probe+0x9c/0x120
[70841.001687]  driver_probe_device+0x2a9/0x490
[70841.001694]  __driver_attach+0xd9/0xe0
[70841.001700]  ? driver_probe_device+0x490/0x490
[70841.001705]  bus_for_each_dev+0x57/0x90
[70841.001712]  bus_add_driver+0x1eb/0x260
[70841.001717]  ? 0xffffffffa0685000
[70841.001723]  driver_register+0x52/0xc0
[70841.001728]  ? 0xffffffffa0685000
[70841.001733]  do_one_initcall+0x39/0x170
[70841.001739]  ? rcu_read_lock_sched_held+0x6f/0x80
[70841.001746]  ? kmem_cache_alloc_trace+0x27b/0x2e0
[70841.001753]  do_init_module+0x56/0x1ec
[70841.001759]  load_module+0x219e/0x2550
[70841.001766]  ? vfs_read+0x121/0x140
[70841.001774]  ? SyS_finit_module+0xa5/0xe0
[70841.001779]  SyS_finit_module+0xa5/0xe0
[70841.001788]  entry_SYSCALL_64_fastpath+0x22/0x8f
[70841.001806] INFO: Object 0x00000000eab7ed96 @offset=6208
[70841.001850] INFO: Allocated in i915_gem_object_create.part.32+0x1f/0x260 [i915] age=38 cpu=0 pid=2708
[70841.001861] 	kmem_cache_alloc+0x23d/0x2d0
[70841.001897] 	i915_gem_object_create.part.32+0x1f/0x260 [i915]
[70841.001937] 	intel_guc_allocate_vma+0x15/0x100 [i915]
[70841.001977] 	intel_guc_log_create+0x34/0x1c0 [i915]
[70841.002014] 	intel_guc_init+0x5a/0x100 [i915]
[70841.002051] 	intel_uc_init+0x3e/0xb0 [i915]
[70841.002089] 	i915_gem_init+0x18e/0x540 [i915]
[70841.002123] 	i915_driver_load+0xa7a/0x1720 [i915]
[70841.002159] 	i915_pci_probe+0x2d/0x90 [i915]
[70841.002165] 	pci_device_probe+0x9c/0x120
[70841.002171] 	driver_probe_device+0x2a9/0x490
[70841.002177] 	__driver_attach+0xd9/0xe0
[70841.002182] 	bus_for_each_dev+0x57/0x90
[70841.002188] 	bus_add_driver+0x1eb/0x260
[70841.002193] 	driver_register+0x52/0xc0
[70841.002198] 	do_one_initcall+0x39/0x170
[70841.002462] kmem_cache_destroy drm_i915_gem_object: Slab cache still has objects
[70841.002491] Call Trace:
[70841.002497]  dump_stack+0x5e/0x8e
[70841.002503]  kmem_cache_destroy+0x1e0/0x240
[70841.002509]  ? __mutex_unlock_slowpath+0x38/0x270
[70841.002551]  i915_gem_load_cleanup+0xbc/0x130 [i915]
[70841.002586]  i915_driver_cleanup_early+0x11/0x60 [i915]
[70841.002621]  i915_driver_load+0x708/0x1720 [i915]
[70841.002629]  ? trace_hardirqs_on_caller+0xe2/0x1c0
[70841.002664]  i915_pci_probe+0x2d/0x90 [i915]
[70841.002671]  pci_device_probe+0x9c/0x120
[70841.002678]  driver_probe_device+0x2a9/0x490
[70841.002684]  __driver_attach+0xd9/0xe0
[70841.002690]  ? driver_probe_device+0x490/0x490
[70841.002696]  bus_for_each_dev+0x57/0x90
[70841.002702]  bus_add_driver+0x1eb/0x260
[70841.002708]  ? 0xffffffffa0685000
[70841.002713]  driver_register+0x52/0xc0
[70841.002719]  ? 0xffffffffa0685000
[70841.002724]  do_one_initcall+0x39/0x170
[70841.002731]  ? rcu_read_lock_sched_held+0x6f/0x80
[70841.002737]  ? kmem_cache_alloc_trace+0x27b/0x2e0
[70841.002745]  do_init_module+0x56/0x1ec
[70841.002751]  load_module+0x219e/0x2550
[70841.002758]  ? vfs_read+0x121/0x140
[70841.002766]  ? SyS_finit_module+0xa5/0xe0
[70841.002772]  SyS_finit_module+0xa5/0xe0
[70841.002781]  entry_SYSCALL_64_fastpath+0x22/0x8f
Quoted 5 lines
Cc Chris Wilson <[email protected]>
Cc Sagar Arun Kamble <[email protected]>
Cc Michal Winiarski <[email protected]>
Cc Joonas Lahtinen <[email protected]>
Quoted 35 lines
---
  drivers/gpu/drm/i915/intel_uc.c | 6 ++++--
  1 file changed, 4 insertions(+), 2 deletions(-)
drivers/gpu/drm/i915/intel_uc.c +4 -2
index 2f80cab..3a13cbb 100644
@@ -27,6 +27,8 @@
  #include "intel_guc.h"
  #include "i915_drv.h"
 
+static void guc_free_load_err_log(struct intel_guc *guc);
+
  /* Reset GuC providing us with fresh state for both GuC and HuC.
   */
  static int __intel_uc_reset_hw(struct drm_i915_private *dev_priv)
@@ -183,6 +185,8 @@ void intel_uc_fini_fw(struct drm_i915_private *dev_priv)
 
  	if (USES_HUC(dev_priv))
  		intel_uc_fw_fini(&dev_priv->huc.fw);
+
+	guc_free_load_err_log(&dev_priv->guc);
  }
 
  /**
@@ -439,8 +443,6 @@ void intel_uc_fini_hw(struct drm_i915_private *dev_priv)
  {
  	struct intel_guc *guc = &dev_priv->guc;
 
-	guc_free_load_err_log(guc);
-
  	if (!USES_GUC(dev_priv))
  		return;
 
Signature · 7 lines
Thanks,
Sagar

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

PATCH 3/5 drm/i915/guc: Use correct error code for GuC initialization failure

In reply to Michal Wajdeczko

Since commit 6ca9a2beb5 ("drm/i915: Unwind i915_gem_init() failure") we believed that we correctly handle all errors encountered during GuC initialization, including special one that indicates request to run driver with disabled GPU submission (-EIO).

Unfortunately since commit 121981fafe ("drm/i915/guc: Combine enable_guc_loading|submission modparams") we stopped using that error code to avoid unwanted fallback to execlist submission mode.

In result any GuC initialization failure was treated as non-recoverable error leading to driver load abort, so we could not even read related GuC error log to investigate cause of the problem.

Fix that by always returning -EIO on uC hardware related failure.

Cc Chris Wilson <[email protected]>
Cc Michal Winiarski <[email protected]>
Cc Daniele Ceraolo Spurio <[email protected]>
Cc Sagar Arun Kamble <[email protected]>
---
 drivers/gpu/drm/i915/intel_uc.c | 5 +----
 1 file changed, 1 insertion(+), 4 deletions(-)
drivers/gpu/drm/i915/intel_uc.c +1 -4
index 3a13cbb..1547e16 100644
@@ -432,11 +432,8 @@ int intel_uc_init_hw(struct drm_i915_private *dev_priv)
 	 * Note that there is no fallback as either user explicitly asked for
 	 * the GuC or driver default option was to run with the GuC enabled.
 	 */
-	if (GEM_WARN_ON(ret == -EIO))
-		ret = -EINVAL;
-
 	dev_err(dev_priv->drm.dev, "GuC initialization failed %d\n", ret);
-	return ret;
+	return -EIO; /* We want to disable GPU submission but keep KMS alive */
 }
 
 void intel_uc_fini_hw(struct drm_i915_private *dev_priv)
Signature · 6 lines
1.9.1

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

Re: [PATCH 3/5] drm/i915/guc: Use correct error code for GuC initialization failure

Quoted 29 lines · Michal Wajdeczko

Since commit 6ca9a2beb5 ("drm/i915: Unwind i915_gem_init() failure") we believed that we correctly handle all errors encountered during GuC initialization, including special one that indicates request to run driver with disabled GPU submission (-EIO).

Unfortunately since commit 121981fafe ("drm/i915/guc: Combine enable_guc_loading|submission modparams") we stopped using that error code to avoid unwanted fallback to execlist submission mode.

In result any GuC initialization failure was treated as non-recoverable error leading to driver load abort, so we could not even read related GuC error log to investigate cause of the problem.

Fix that by always returning -EIO on uC hardware related failure.

Cc Chris Wilson <[email protected]>
Cc Michal Winiarski <[email protected]>
Cc Daniele Ceraolo Spurio <[email protected]>
Cc Sagar Arun Kamble <[email protected]>
---
  drivers/gpu/drm/i915/intel_uc.c | 5 +----
  1 file changed, 1 insertion(+), 4 deletions(-)
drivers/gpu/drm/i915/intel_uc.c +0 -0
index 3a13cbb..1547e16 100644

drivers/gpu/drm/i915/intel_uc.c int intel_uc_init_hw(struct drm_i915_private *dev_priv) · line 437

Quoted 10 lines
drivers/gpu/drm/i915/intel_uc.c +1 -4
@@ -432,11 +432,8 @@ int intel_uc_init_hw(struct drm_i915_private *dev_priv)
  	 * Note that there is no fallback as either user explicitly asked for
  	 * the GuC or driver default option was to run with the GuC enabled.
  	 */
-	if (GEM_WARN_ON(ret == -EIO))
-		ret = -EINVAL;
-
  	dev_err(dev_priv->drm.dev, "GuC initialization failed %d\n", ret);
-	return ret;
+	return -EIO; /* We want to disable GPU submission but keep KMS alive */
  }

We'll need to avoid uc_fini_hw/ in unload path since GPU will be marked wedged after this?

Quoted 2 lines
drivers/gpu/drm/i915/intel_uc.c +0 -0
  void intel_uc_fini_hw(struct drm_i915_private *dev_priv)
Signature · 7 lines
Thanks,
Sagar

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

Re: [PATCH 3/5] drm/i915/guc: Use correct error code for GuC initialization failure

Quoting Sagar Arun Kamble (2018-02-01 11:48:54)

Quoted 36 lines · Michal Wajdeczko
Quoted 33 lines

Since commit 6ca9a2beb5 ("drm/i915: Unwind i915_gem_init() failure") we believed that we correctly handle all errors encountered during GuC initialization, including special one that indicates request to run driver with disabled GPU submission (-EIO).

Unfortunately since commit 121981fafe ("drm/i915/guc: Combine enable_guc_loading|submission modparams") we stopped using that error code to avoid unwanted fallback to execlist submission mode.

In result any GuC initialization failure was treated as non-recoverable error leading to driver load abort, so we could not even read related GuC error log to investigate cause of the problem.

Fix that by always returning -EIO on uC hardware related failure.

Cc Chris Wilson <[email protected]>
Cc Michal Winiarski <[email protected]>
Cc Daniele Ceraolo Spurio <[email protected]>
Cc Sagar Arun Kamble <[email protected]>
---
  drivers/gpu/drm/i915/intel_uc.c | 5 +----
  1 file changed, 1 insertion(+), 4 deletions(-)
drivers/gpu/drm/i915/intel_uc.c +0 -1
index 3a13cbb..1547e16 100644
@@ -432,11 +432,8 @@ int intel_uc_init_hw(struct drm_i915_private *dev_priv)
       * Note that there is no fallback as either user explicitly asked for
       * the GuC or driver default option was to run with the GuC enabled.
       */
-     if (GEM_WARN_ON(ret == -EIO))
Quoted 8 lines

drivers/gpu/drm/i915/intel_uc.c int intel_uc_init_hw(struct drm_i915_private *dev_priv) · line 437

Quoted 6 lines
drivers/gpu/drm/i915/intel_uc.c +1 -3
-             ret = -EINVAL;
-
      dev_err(dev_priv->drm.dev, "GuC initialization failed %d\n", ret);
-     return ret;
+     return -EIO; /* We want to disable GPU submission but keep KMS alive */
  }

We'll need to avoid uc_fini_hw/ in unload path since GPU will be marked wedged after this?

We should be avoiding uc_fini_hw in unload because we haven't completed uc_init_hw. Such failure should already be handled?
-Chris
_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

#6 lore raw

Re: [PATCH 3/5] drm/i915/guc: Use correct error code for GuC initialization failure

Quoted 48 lines · Chris Wilson

Quoting Sagar Arun Kamble (2018-02-01 11:48:54)

Quoted 47 lines · Michal Wajdeczko
Quoted 10 lines

Since commit 6ca9a2beb5 ("drm/i915: Unwind i915_gem_init() failure") we believed that we correctly handle all errors encountered during GuC initialization, including special one that indicates request to run driver with disabled GPU submission (-EIO).

Unfortunately since commit 121981fafe ("drm/i915/guc: Combine enable_guc_loading|submission modparams") we stopped using that error code to avoid unwanted fallback to execlist submission mode.

In result any GuC initialization failure was treated as

non-recoverable

Quoted 10 lines

error leading to driver load abort, so we could not even read related GuC error log to investigate cause of the problem.

Fix that by always returning -EIO on uC hardware related failure.

Cc Chris Wilson <[email protected]>
Cc Michal Winiarski <[email protected]>
Cc Daniele Ceraolo Spurio <[email protected]>
Cc Sagar Arun Kamble <[email protected]>

Review

Quoted 5 lines
---
  drivers/gpu/drm/i915/intel_uc.c | 5 +----
  1 file changed, 1 insertion(+), 4 deletions(-)
(quoted diff) +0 -0

b/drivers/gpu/drm/i915/intel_uc.c

drivers/gpu/drm/i915/intel_uc.c int intel_uc_init_hw(struct drm_i915_private

Quoted 4 lines

index 3a13cbb..1547e16 100644

drivers/gpu/drm/i915/intel_uc.c +0 -0
@@ -432,11 +432,8 @@ int intel_uc_init_hw(struct drm_i915_private  

*dev_priv)

drivers/gpu/drm/i915/intel_uc.c int intel_uc_init_hw(struct drm_i915_private · line 432

Quoted 1 line
drivers/gpu/drm/i915/intel_uc.c +0 -0
       * Note that there is no fallback as either user explicitly  

asked for

drivers/gpu/drm/i915/intel_uc.c int intel_uc_init_hw(struct drm_i915_private · line 433

Quoted 1 line
drivers/gpu/drm/i915/intel_uc.c +0 -0
       * the GuC or driver default option was to run with the GuC  

enabled.

drivers/gpu/drm/i915/intel_uc.c int intel_uc_init_hw(struct drm_i915_private *dev_priv)

Quoted 5 lines
drivers/gpu/drm/i915/intel_uc.c +0 -3
       */
-     if (GEM_WARN_ON(ret == -EIO))
-             ret = -EINVAL;
-
      dev_err(dev_priv->drm.dev, "GuC initialization failed %d\n",  

ret);

Quoted 2 lines
drivers/gpu/drm/i915/intel_uc.c +1 -1
-     return ret;
+     return -EIO; /* We want to disable GPU submission but keep KMS  
Quoted 7 lines
Quoted 4 lines

alive */

drivers/gpu/drm/i915/intel_uc.c int intel_uc_init_hw(struct drm_i915_private · line 437

Quoted 1 line
drivers/gpu/drm/i915/intel_uc.c +0 -0
  }

We'll need to avoid uc_fini_hw/ in unload path since GPU will be marked wedged after this?

We should be avoiding uc_fini_hw in unload because we haven't completed uc_init_hw. Such failure should already be handled?

It's even worst. In case of uc_init_hw() failure we always call uc_fini() and uc_fini_misc() regardless of EIO, and then in case of running in wedged more we will try to call them again in unload path ...

While it is easy to postpone uc_fini[_misc] calls to unload stage, it is tricky to avoid calling uc_fini_hw there without adding extra check (earlier there was discussion that we should not have any conditions in _fini functions)

Any ideas how to solve that ?

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

#7 lore raw

Re: [PATCH 3/5] drm/i915/guc: Use correct error code for GuC initialization failure

Quoted 62 lines · Michal Wajdeczko
Quoted 48 lines · Chris Wilson

Quoting Sagar Arun Kamble (2018-02-01 11:48:54)

Quoted 47 lines · Michal Wajdeczko
Quoted 10 lines

Since commit 6ca9a2beb5 ("drm/i915: Unwind i915_gem_init() failure") we believed that we correctly handle all errors encountered during GuC initialization, including special one that indicates request to run driver with disabled GPU submission (-EIO).

Unfortunately since commit 121981fafe ("drm/i915/guc: Combine enable_guc_loading|submission modparams") we stopped using that error code to avoid unwanted fallback to execlist submission mode.

In result any GuC initialization failure was treated as

non-recoverable

Quoted 10 lines

error leading to driver load abort, so we could not even read related GuC error log to investigate cause of the problem.

Fix that by always returning -EIO on uC hardware related failure.

Cc Chris Wilson <[email protected]>
Cc Michal Winiarski <[email protected]>
Cc Daniele Ceraolo Spurio <[email protected]>
Cc Sagar Arun Kamble <[email protected]>

Review

Quoted 5 lines

---
   drivers/gpu/drm/i915/intel_uc.c | 5 +----

   1 file changed, 1 insertion(+), 4 deletions(-)
(quoted diff) +0 -0

b/drivers/gpu/drm/i915/intel_uc.c

drivers/gpu/drm/i915/intel_uc.c int intel_uc_init_hw(struct drm_i915_private

Quoted 4 lines

index 3a13cbb..1547e16 100644

drivers/gpu/drm/i915/intel_uc.c +0 -0
@@ -432,11 +432,8 @@ int intel_uc_init_hw(struct drm_i915_private 

*dev_priv)

drivers/gpu/drm/i915/intel_uc.c int intel_uc_init_hw(struct drm_i915_private · line 432

Quoted 1 line
drivers/gpu/drm/i915/intel_uc.c +0 -0
         * Note that there is no fallback as either user explicitly 

asked for

drivers/gpu/drm/i915/intel_uc.c int intel_uc_init_hw(struct drm_i915_private · line 433

Quoted 1 line
drivers/gpu/drm/i915/intel_uc.c +0 -0
         * the GuC or driver default option was to run with the GuC 

enabled.

drivers/gpu/drm/i915/intel_uc.c int intel_uc_init_hw(struct drm_i915_private *dev_priv)

Quoted 5 lines
drivers/gpu/drm/i915/intel_uc.c +0 -3
         */
-     if (GEM_WARN_ON(ret == -EIO))
-             ret = -EINVAL;
-
        dev_err(dev_priv->drm.dev, "GuC initialization failed %d\n", 

ret);

Quoted 2 lines
drivers/gpu/drm/i915/intel_uc.c +1 -1
-     return ret;
+     return -EIO; /* We want to disable GPU submission but keep 
Quoted 7 lines
Quoted 4 lines

KMS alive */

drivers/gpu/drm/i915/intel_uc.c int intel_uc_init_hw(struct drm_i915_private · line 437

Quoted 1 line
drivers/gpu/drm/i915/intel_uc.c +0 -0
    }

We'll need to avoid uc_fini_hw/ in unload path since GPU will be marked wedged after this?

We should be avoiding uc_fini_hw in unload because we haven't completed uc_init_hw. Such failure should already be handled?

It's even worst. In case of uc_init_hw() failure we always call uc_fini() and uc_fini_misc() regardless of EIO, and then in case of running in wedged more we will try to call them again in unload path ...

Quoted 7 lines

While it is easy to postpone uc_fini[_misc] calls to unload stage, it is tricky to avoid calling uc_fini_hw there without adding extra check (earlier there was discussion that we should not have any conditions in _fini functions)

Any ideas how to solve that ?

Earlier we could rely on status of enable_guc_loading/submission. Now I think we need to have status per uc, uc_misc, uc_hw as many internal steps can't rely on like pointer check.

Quoted 1 line

Michal

Signature · 7 lines
Thanks,
Sagar

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

PATCH 4/5 drm/i915/guc: Don't try to create log runtime if there is no log

In reply to Michal Wajdeczko

In case of GuC initialization failure we may continue with driver load, but we wrongly assume that GuC is fully functional. This leads to the BUG as we attempt to access non-existing log vma.

[26386.121085] BUG: unable to handle kernel NULL pointer dereference at 00000000000000a0
[26386.121225] IP: guc_log_runtime_create+0x23/0xe0 [i915]
[26386.121763] Call Trace:
[26386.121870]  guc_log_late_setup+0xfd/0x140 [i915]
[26386.121969]  i915_driver_load+0x7ab/0x1730 [i915]
[26386.122069]  i915_pci_probe+0x2d/0x90 [i915]
[26386.122089]  pci_device_probe+0x9c/0x120
[26386.122107]  driver_probe_device+0x2a9/0x490
[26386.122126]  __driver_attach+0xd9/0xe0
[26386.122143]  ? driver_probe_device+0x490/0x490
[26386.122158]  bus_for_each_dev+0x57/0x90
[26386.122175]  bus_add_driver+0x1eb/0x260
[26386.122190]  ? 0xffffffffa069a000
[26386.122206]  driver_register+0x52/0xc0
[26386.122220]  ? 0xffffffffa069a000
[26386.122234]  do_one_initcall+0x39/0x170
[26386.122252]  ? kmem_cache_alloc_trace+0x1fd/0x2e0
[26386.122273]  do_init_module+0x56/0x1ec
[26386.122289]  load_module+0x219e/0x2550
[26386.122309]  ? vfs_read+0x121/0x140
[26386.122331]  ? SyS_finit_module+0xa5/0xe0
[26386.122346]  SyS_finit_module+0xa5/0xe0
[26386.122371]  entry_SYSCALL_64_fastpath+0x22/0x8f
Cc Chris Wilson <[email protected]>
Cc Michal Winiarski <[email protected]>
Cc Daniele Ceraolo Spurio <[email protected]>
Cc Sagar Arun Kamble <[email protected]>
---
 drivers/gpu/drm/i915/intel_guc_log.c | 3 +++
 1 file changed, 3 insertions(+)
drivers/gpu/drm/i915/intel_guc_log.c +3 -0
index 3fbe93a..fdb1895 100644
@@ -395,6 +395,9 @@ static int guc_log_runtime_create(struct intel_guc *guc)
 	void *vaddr;
 	int ret;
 
+	if (!guc->log.vma)
+		return -ENODEV;
+
 	lockdep_assert_held(&dev_priv->drm.struct_mutex);
 
 	GEM_BUG_ON(guc_log_has_runtime(guc));
Signature · 6 lines
1.9.1

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

Re: [PATCH 4/5] drm/i915/guc: Don't try to create log runtime if there is no log

Quoted 28 lines · Michal Wajdeczko

In case of GuC initialization failure we may continue with driver load, but we wrongly assume that GuC is fully functional. This leads to the BUG as we attempt to access non-existing log vma.

[26386.121085] BUG: unable to handle kernel NULL pointer dereference at 00000000000000a0
[26386.121225] IP: guc_log_runtime_create+0x23/0xe0 [i915]
[26386.121763] Call Trace:
[26386.121870]  guc_log_late_setup+0xfd/0x140 [i915]
[26386.121969]  i915_driver_load+0x7ab/0x1730 [i915]
[26386.122069]  i915_pci_probe+0x2d/0x90 [i915]
[26386.122089]  pci_device_probe+0x9c/0x120
[26386.122107]  driver_probe_device+0x2a9/0x490
[26386.122126]  __driver_attach+0xd9/0xe0
[26386.122143]  ? driver_probe_device+0x490/0x490
[26386.122158]  bus_for_each_dev+0x57/0x90
[26386.122175]  bus_add_driver+0x1eb/0x260
[26386.122190]  ? 0xffffffffa069a000
[26386.122206]  driver_register+0x52/0xc0
[26386.122220]  ? 0xffffffffa069a000
[26386.122234]  do_one_initcall+0x39/0x170
[26386.122252]  ? kmem_cache_alloc_trace+0x1fd/0x2e0
[26386.122273]  do_init_module+0x56/0x1ec
[26386.122289]  load_module+0x219e/0x2550
[26386.122309]  ? vfs_read+0x121/0x140
[26386.122331]  ? SyS_finit_module+0xa5/0xe0
[26386.122346]  SyS_finit_module+0xa5/0xe0
[26386.122371]  entry_SYSCALL_64_fastpath+0x22/0x8f
Quoted 5 lines
Cc Chris Wilson <[email protected]>
Cc Michal Winiarski <[email protected]>
Cc Daniele Ceraolo Spurio <[email protected]>
Cc Sagar Arun Kamble <[email protected]>
Quoted 18 lines
---
  drivers/gpu/drm/i915/intel_guc_log.c | 3 +++
  1 file changed, 3 insertions(+)
drivers/gpu/drm/i915/intel_guc_log.c +3 -0
index 3fbe93a..fdb1895 100644
@@ -395,6 +395,9 @@ static int guc_log_runtime_create(struct intel_guc *guc)
  	void *vaddr;
  	int ret;
 
+	if (!guc->log.vma)
+		return -ENODEV;
+
  	lockdep_assert_held(&dev_priv->drm.struct_mutex);
 
  	GEM_BUG_ON(guc_log_has_runtime(guc));
Signature · 7 lines
Thanks,
Sagar

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

Re: [PATCH 4/5] drm/i915/guc: Don't try to create log runtime if there is no log

In reply to Michal Wajdeczko

Quoting Michal Wajdeczko (2018-01-31 17:32:39)

Quoted 42 lines

In case of GuC initialization failure we may continue with driver load, but we wrongly assume that GuC is fully functional. This leads to the BUG as we attempt to access non-existing log vma.

[26386.121085] BUG: unable to handle kernel NULL pointer dereference at 00000000000000a0
[26386.121225] IP: guc_log_runtime_create+0x23/0xe0 [i915]
[26386.121763] Call Trace:
[26386.121870]  guc_log_late_setup+0xfd/0x140 [i915]
[26386.121969]  i915_driver_load+0x7ab/0x1730 [i915]
[26386.122069]  i915_pci_probe+0x2d/0x90 [i915]
[26386.122089]  pci_device_probe+0x9c/0x120
[26386.122107]  driver_probe_device+0x2a9/0x490
[26386.122126]  __driver_attach+0xd9/0xe0
[26386.122143]  ? driver_probe_device+0x490/0x490
[26386.122158]  bus_for_each_dev+0x57/0x90
[26386.122175]  bus_add_driver+0x1eb/0x260
[26386.122190]  ? 0xffffffffa069a000
[26386.122206]  driver_register+0x52/0xc0
[26386.122220]  ? 0xffffffffa069a000
[26386.122234]  do_one_initcall+0x39/0x170
[26386.122252]  ? kmem_cache_alloc_trace+0x1fd/0x2e0
[26386.122273]  do_init_module+0x56/0x1ec
[26386.122289]  load_module+0x219e/0x2550
[26386.122309]  ? vfs_read+0x121/0x140
[26386.122331]  ? SyS_finit_module+0xa5/0xe0
[26386.122346]  SyS_finit_module+0xa5/0xe0
[26386.122371]  entry_SYSCALL_64_fastpath+0x22/0x8f
Cc Chris Wilson <[email protected]>
Cc Michal Winiarski <[email protected]>
Cc Daniele Ceraolo Spurio <[email protected]>
Cc Sagar Arun Kamble <[email protected]>
---
 drivers/gpu/drm/i915/intel_guc_log.c | 3 +++
 1 file changed, 3 insertions(+)
drivers/gpu/drm/i915/intel_guc_log.c +0 -0
index 3fbe93a..fdb1895 100644

drivers/gpu/drm/i915/intel_guc_log.c static int guc_log_runtime_create(struct intel_guc *guc) · line 401

Quoted 7 lines
drivers/gpu/drm/i915/intel_guc_log.c +3 -0
@@ -395,6 +395,9 @@ static int guc_log_runtime_create(struct intel_guc *guc)
        void *vaddr;
        int ret;
 
+       if (!guc->log.vma)
+               return -ENODEV;
+
        lockdep_assert_held(&dev_priv->drm.struct_mutex);

We like to keep the caller precondition guards at the start of the function, so I reversed this pair of lines.

I've pushed the two BUG fixes that Sagar reviewed. The fault injection is a good idea, but I've left it alone while there is a question on a couple of the patches. Thanks for the patches and review, looking forward to the next series :)
-Chris
_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

#11 lore raw

PATCH 5/5 HAX: Enable GuC for CI

In reply to Michal Wajdeczko
---
 drivers/gpu/drm/i915/i915_params.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/gpu/drm/i915/i915_params.h +1 -1
index 5ac8882..0a63f59 100644
@@ -47,7 +47,7 @@
 	param(int, disable_power_well, -1) \
 	param(int, enable_ips, 1) \
 	param(int, invert_brightness, 0) \
-	param(int, enable_guc, 0) \
+	param(int, enable_guc, -1) \
 	param(int, guc_log_level, 0) \
 	param(char *, guc_firmware_path, NULL) \
 	param(char *, huc_firmware_path, NULL) \
Signature · 6 lines
1.9.1

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

✗ Fi.CI.BAT: failure for series starting with [1/5] drm/i915/uc: Add few more load failure checkpoints

In reply to Michal Wajdeczko
== Series Details ==

== Series Details ==

Series: series starting with [1/5] drm/i915/uc: Add few more load failure checkpoints
URL : https://patchwork.freedesktop.org/series/37425/
State : failure

== Summary ==

Series 37425v1 series starting with [1/5] drm/i915/uc: Add few more load failure checkpoints
https://patchwork.freedesktop.org/api/1.0/series/37425/revisions/1/mbox/

Test core_auth:

        Subgroup basic-auth:
                pass       -> SKIP       (fi-skl-gvtdvm)
Test core_prop_blob:
        Subgroup basic:
                pass       -> SKIP       (fi-skl-gvtdvm)
Test debugfs_test:
        Subgroup read_all_entries:
                pass       -> SKIP       (fi-skl-gvtdvm)
Test drv_getparams_basic:
        Subgroup basic-eu-total:
                pass       -> SKIP       (fi-skl-gvtdvm)
        Subgroup basic-subslice-total:
                pass       -> SKIP       (fi-skl-gvtdvm)
Test drv_hangman:
        Subgroup error-state-basic:
                pass       -> SKIP       (fi-skl-gvtdvm)
Test gem_basic:
        Subgroup bad-close:
                pass       -> SKIP       (fi-skl-gvtdvm)
        Subgroup create-close:
                pass       -> SKIP       (fi-skl-gvtdvm)
        Subgroup create-fd-close:
                pass       -> SKIP       (fi-skl-gvtdvm)
Test gem_busy:
        Subgroup basic-busy-default:
                pass       -> SKIP       (fi-skl-gvtdvm)
        Subgroup basic-hang-default:
                pass       -> SKIP       (fi-skl-gvtdvm) fdo#104108 +3
Test gem_close_race:
        Subgroup basic-process:
                pass       -> SKIP       (fi-skl-gvtdvm)
        Subgroup basic-threads:
                pass       -> SKIP       (fi-skl-gvtdvm)
Test gem_cpu_reloc:
        Subgroup basic:
                pass       -> SKIP       (fi-skl-gvtdvm)
Test gem_cs_tlb:
        Subgroup basic-default:
                pass       -> SKIP       (fi-skl-gvtdvm)
Test gem_ctx_create:
        Subgroup basic:
                pass       -> SKIP       (fi-skl-gvtdvm)
        Subgroup basic-files:
                pass       -> SKIP       (fi-skl-gvtdvm)
Test gem_ctx_exec:
        Subgroup basic:
                pass       -> SKIP       (fi-skl-gvtdvm)
Test gem_ctx_param:
        Subgroup basic:
                pass       -> SKIP       (fi-skl-gvtdvm)
        Subgroup basic-default:
                pass       -> SKIP       (fi-skl-gvtdvm)
Test gem_ctx_switch:
        Subgroup basic-default:
                pass       -> SKIP       (fi-skl-gvtdvm)
        Subgroup basic-default-heavy:
                pass       -> SKIP       (fi-skl-gvtdvm)
Test gem_exec_basic:
        Subgroup basic-blt:
                pass       -> SKIP       (fi-skl-gvtdvm)
        Subgroup basic-bsd:
                pass       -> SKIP       (fi-skl-gvtdvm)
        Subgroup basic-bsd1:
                pass       -> SKIP       (fi-skl-gvtdvm)
        Subgroup basic-bsd2:
                pass       -> SKIP       (fi-skl-gvtdvm)
        Subgroup basic-default:
                pass       -> SKIP       (fi-skl-gvtdvm)
        Subgroup basic-render:
                pass       -> SKIP       (fi-skl-gvtdvm)
        Subgroup basic-vebox:
                pass       -> SKIP       (fi-skl-gvtdvm)
        Subgroup gtt-blt:
                pass       -> SKIP       (fi-skl-gvtdvm)
        Subgroup gtt-bsd:
                pass       -> SKIP       (fi-skl-gvtdvm)
        Subgroup gtt-bsd1:
                pass       -> SKIP       (fi-skl-gvtdvm)
        Subgroup gtt-bsd2:
                pass       -> SKIP       (fi-skl-gvtdvm)
        Subgroup gtt-default:
                pass       -> SKIP       (fi-skl-gvtdvm)
        Subgroup gtt-render:
                pass       -> SKIP       (fi-skl-gvtdvm)
        Subgroup gtt-vebox:
                pass       -> SKIP       (fi-skl-gvtdvm)
        Subgroup readonly-blt:
                pass       -> SKIP       (fi-skl-gvtdvm)
        Subgroup readonly-bsd:
                pass       -> SKIP       (fi-skl-gvtdvm)
        Subgroup readonly-bsd1:
                pass       -> SKIP       (fi-skl-gvtdvm)
        Subgroup readonly-bsd2:
                pass       -> SKIP       (fi-skl-gvtdvm)
        Subgroup readonly-default:
                pass       -> SKIP       (fi-skl-gvtdvm)

WARNING: Long output truncated

ae93f9b9acf3e9cdbb2be1b68a97c3cc6db66fad drm-tip: 2018y-01m-31d-16h-31m-38s UTC integration manifest 8f4dbd51e218 HAX: Enable GuC for CI
2c3f53721546 drm/i915/guc: Don't try to create log runtime if there is no log 7d73ec81b603 drm/i915/guc: Use correct error code for GuC initialization failure c484a76baebc drm/i915/guc: Don't forget to free GuC error log
095bb2376c30 drm/i915/uc: Add few more load failure checkpoints

== Logs ==

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

#13 lore raw
In reply to Michal Wajdeczko
Quoted 24 lines · Michal Wajdeczko

Additional load failure checkpoints added into uC initialization sequence should help us verify correctness of error handling.

---
  drivers/gpu/drm/i915/intel_uc.c | 11 +++++++++++
  1 file changed, 11 insertions(+)
drivers/gpu/drm/i915/intel_uc.c +3 -0
index e3f3509..2f80cab 100644
@@ -287,6 +287,9 @@ int intel_uc_init(struct drm_i915_private *dev_priv)
  	if (!HAS_GUC(dev_priv))
  		return -ENODEV;
 
+	if (i915_inject_load_failure())
+		return -ENODEV;
+
  	ret = intel_guc_init(guc);
  	if (ret)
  		return ret;

drivers/gpu/drm/i915/intel_uc.c int intel_uc_init_hw(struct drm_i915_private *dev_priv) · line 337

Quoted 5 lines
drivers/gpu/drm/i915/intel_uc.c +2 -0
@@ -330,6 +333,11 @@ int intel_uc_init_hw(struct drm_i915_private *dev_priv)
  	if (!USES_GUC(dev_priv))
  		return 0;
 
+	if (i915_inject_load_failure()) {
+		ret = -ECANCELED;

In patch 3 we will be returning -EIO always from this function so just goto here and below?

Quoted 16 lines
drivers/gpu/drm/i915/intel_uc.c +6 -0
+		goto err_out;
+	}
+
  	GEM_BUG_ON(!HAS_GUC(dev_priv));
 
  	guc_disable_communication(guc);
@@ -371,6 +379,9 @@ int intel_uc_init_hw(struct drm_i915_private *dev_priv)
  				 "retry %d more time(s)\n", ret, attempts);
  	}
 
+	if (i915_inject_load_failure())
+		ret = -ECANCELED;
+
  	/* Did we succeded or run out of retries? */
  	if (ret)
  		goto err_log_capture;
Signature · 7 lines
Thanks,
Sagar

_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
#14 lore raw
Quoted 24 lines · Sagar Arun Kamble
Quoted 21 lines · Michal Wajdeczko

Additional load failure checkpoints added into uC initialization sequence should help us verify correctness of error handling.

---
  drivers/gpu/drm/i915/intel_uc.c | 11 +++++++++++
  1 file changed, 11 insertions(+)
drivers/gpu/drm/i915/intel_uc.c +2 -0
index e3f3509..2f80cab 100644
@@ -287,6 +287,9 @@ int intel_uc_init(struct drm_i915_private *dev_priv)
  	if (!HAS_GUC(dev_priv))
  		return -ENODEV;
  +	if (i915_inject_load_failure())
+		return -ENODEV;
+
  	ret = intel_guc_init(guc);
  	if (ret)
Quoted 8 lines

drivers/gpu/drm/i915/intel_uc.c int intel_uc_init_hw(struct drm_i915_private · line 337

Quoted 7 lines
drivers/gpu/drm/i915/intel_uc.c +1 -0
  		return ret;
@@ -330,6 +333,11 @@ int intel_uc_init_hw(struct drm_i915_private  
 *dev_priv)
  	if (!USES_GUC(dev_priv))
  		return 0;
  +	if (i915_inject_load_failure()) {
+		ret = -ECANCELED;

In patch 3 we will be returning -EIO always from this function so just goto here

"ret" will be uninitialized, but it is used there

Quoted 1 line

and below?

well, I wanted to include path that captures GuC log ...

Quoted 7 lines
Quoted 7 lines
drivers/gpu/drm/i915/intel_uc.c +3 -0
+		goto err_out;
+	}
+
  	GEM_BUG_ON(!HAS_GUC(dev_priv));
    	guc_disable_communication(guc);
@@ -371,6 +379,9 @@ int intel_uc_init_hw(struct drm_i915_private  
 *dev_priv)
Quoted 8 lines

drivers/gpu/drm/i915/intel_uc.c int intel_uc_init_hw(struct drm_i915_private *dev_priv) · line 387

Quoted 8 lines
drivers/gpu/drm/i915/intel_uc.c +2 -0
  				 "retry %d more time(s)\n", ret, attempts);
  	}
  +	if (i915_inject_load_failure())
+		ret = -ECANCELED;
+
  	/* Did we succeded or run out of retries? */
  	if (ret)
  		goto err_log_capture;

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

Reviewed-by
#15 lore raw

Thanks for clarification.

Quoted 10 lines · Michal Wajdeczko
Quoted 8 lines · Sagar Arun Kamble
Quoted 5 lines · Michal Wajdeczko

Additional load failure checkpoints added into uC initialization sequence should help us verify correctness of error handling.

Quoted 47 lines
Quoted 17 lines
Quoted 17 lines

---
  drivers/gpu/drm/i915/intel_uc.c | 11 +++++++++++

  1 file changed, 11 insertions(+)
drivers/gpu/drm/i915/intel_uc.c +2 -0
index e3f3509..2f80cab 100644
@@ -287,6 +287,9 @@ int intel_uc_init(struct drm_i915_private 
 *dev_priv)
       if (!HAS_GUC(dev_priv))
           return -ENODEV;
   +    if (i915_inject_load_failure())
+        return -ENODEV;
+
       ret = intel_guc_init(guc);
       if (ret)
Quoted 8 lines

drivers/gpu/drm/i915/intel_uc.c int intel_uc_init_hw(struct drm_i915_private · line 337

Quoted 7 lines

          return ret;

drivers/gpu/drm/i915/intel_uc.c +1 -0
@@ -330,6 +333,11 @@ int intel_uc_init_hw(struct drm_i915_private 
 *dev_priv)
       if (!USES_GUC(dev_priv))
           return 0;
   +    if (i915_inject_load_failure()) {
+        ret = -ECANCELED;

In patch 3 we will be returning -EIO always from this function so just goto here

"ret" will be uninitialized, but it is used there

Quoted 1 line

and below?

well, I wanted to include path that captures GuC log ...

Quoted 15 lines
Quoted 15 lines
drivers/gpu/drm/i915/intel_uc.c +5 -0
+        goto err_out;
+    }
+
       GEM_BUG_ON(!HAS_GUC(dev_priv));
         guc_disable_communication(guc);
@@ -371,6 +379,9 @@ int intel_uc_init_hw(struct drm_i915_private 
 *dev_priv)
                    "retry %d more time(s)\n", ret, attempts);
       }
   +    if (i915_inject_load_failure())
+        ret = -ECANCELED;
+
       /* Did we succeded or run out of retries? */
       if (ret)

          goto err_log_capture;

Signature · 7 lines
Thanks,
Sagar

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