drm/i915/guc: Module load failure test for CT buffer creation
authorJohn Harrison <John.C.Harrison@Intel.com>
Thu, 8 Jul 2021 16:20:55 +0000 (09:20 -0700)
committerJohn Harrison <John.C.Harrison@Intel.com>
Tue, 13 Jul 2021 20:50:06 +0000 (13:50 -0700)
Add several module failure load inject points in the CT buffer creation
code path.

Signed-off-by: John Harrison <John.C.Harrison@Intel.com>
Signed-off-by: Matthew Brost <matthew.brost@intel.com>
Reviewed-by: Michal Wajdeczko <michal.wajdeczko@intel.com>
Signed-off-by: John Harrison <John.C.Harrison@Intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20210708162055.129996-8-matthew.brost@intel.com
drivers/gpu/drm/i915/gt/uc/intel_guc_ct.c

index ad33708..83ec60e 100644 (file)
@@ -175,6 +175,10 @@ static int ct_register_buffer(struct intel_guc_ct *ct, u32 type,
 {
        int err;
 
+       err = i915_inject_probe_error(guc_to_gt(ct_to_guc(ct))->i915, -ENXIO);
+       if (unlikely(err))
+               return err;
+
        err = guc_action_register_ct_buffer(ct_to_guc(ct), type,
                                            desc_addr, buff_addr, size);
        if (unlikely(err))
@@ -226,6 +230,10 @@ int intel_guc_ct_init(struct intel_guc_ct *ct)
        u32 *cmds;
        int err;
 
+       err = i915_inject_probe_error(guc_to_gt(guc)->i915, -ENXIO);
+       if (err)
+               return err;
+
        GEM_BUG_ON(ct->vma);
 
        blob_size = 2 * CTB_DESC_SIZE + CTB_H2G_BUFFER_SIZE + CTB_G2H_BUFFER_SIZE;