On Thu, 01 Feb 2018 12:43:29 +0100, Sagar Arun Kamble <[email protected]> wrote:



On 1/31/2018 11:02 PM, Michal Wajdeczko wrote:
Additional load failure checkpoints added into uC initialization
sequence should help us verify correctness of error handling.

Signed-off-by: Michal Wajdeczko <[email protected]>
Cc: Chris Wilson <[email protected]>
---
  drivers/gpu/drm/i915/intel_uc.c | 11 +++++++++++
  1 file changed, 11 insertions(+)

diff --git a/drivers/gpu/drm/i915/intel_uc.c b/drivers/gpu/drm/i915/intel_uc.c
index e3f3509..2f80cab 100644
--- a/drivers/gpu/drm/i915/intel_uc.c
+++ b/drivers/gpu/drm/i915/intel_uc.c
@@ -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;
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

and below?

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

+               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;
_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

Reply via email to