Intel-XE Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Lucas De Marchi <lucas.demarchi@intel.com>
To: intel-xe <intel-xe@lists.freedesktop.org>
Cc: Lucas De Marchi <lucas.demarchi@intel.com>,
	Francois Dugast <francois.dugast@intel.com>,
	Riana Tauro <riana.tauro@intel.com>,
	Rodrigo Vivi <rodrigo.vivi@intel.com>
Subject: [PATCH v4 3/3] drm/xe: Allow to inject error in early probe
Date: Thu, 13 Mar 2025 13:41:01 -0700	[thread overview]
Message-ID: <20250313-fix-survivability-v4-3-5e90efdede99@intel.com> (raw)
In-Reply-To: <20250313-fix-survivability-v4-0-5e90efdede99@intel.com>

Allow to test if driver behaves correctly when xe_pcode_probe_early()
fails. Note that this is not sufficient for testing survivability mode
as it's still required to read the hw to check for errors, which doesn't
happen on an injected failure.

To complete the early probe coverage, allow injection in the other
functions as well: xe_mmio_probe_early() and xe_device_probe_early().

Reviewed-by: Francois Dugast <francois.dugast@intel.com>
Signed-off-by: Lucas De Marchi <lucas.demarchi@intel.com>
---
 drivers/gpu/drm/xe/xe_device.c | 1 +
 drivers/gpu/drm/xe/xe_mmio.c   | 1 +
 drivers/gpu/drm/xe/xe_pcode.c  | 2 ++
 3 files changed, 4 insertions(+)

diff --git a/drivers/gpu/drm/xe/xe_device.c b/drivers/gpu/drm/xe/xe_device.c
index 0e8805f93468d..1ffb7d1f6be66 100644
--- a/drivers/gpu/drm/xe/xe_device.c
+++ b/drivers/gpu/drm/xe/xe_device.c
@@ -735,6 +735,7 @@ int xe_device_probe_early(struct xe_device *xe)
 
 	return 0;
 }
+ALLOW_ERROR_INJECTION(xe_device_probe_early, ERRNO); /* See xe_pci_probe() */
 
 static int probe_has_flat_ccs(struct xe_device *xe)
 {
diff --git a/drivers/gpu/drm/xe/xe_mmio.c b/drivers/gpu/drm/xe/xe_mmio.c
index 13e06a956ceb0..096c38cc51c83 100644
--- a/drivers/gpu/drm/xe/xe_mmio.c
+++ b/drivers/gpu/drm/xe/xe_mmio.c
@@ -138,6 +138,7 @@ int xe_mmio_probe_early(struct xe_device *xe)
 
 	return devm_add_action_or_reset(xe->drm.dev, mmio_fini, xe);
 }
+ALLOW_ERROR_INJECTION(xe_mmio_probe_early, ERRNO); /* See xe_pci_probe() */
 
 /**
  * xe_mmio_init() - Initialize an MMIO instance
diff --git a/drivers/gpu/drm/xe/xe_pcode.c b/drivers/gpu/drm/xe/xe_pcode.c
index 9333ce776a6e5..cf955b3ed52cd 100644
--- a/drivers/gpu/drm/xe/xe_pcode.c
+++ b/drivers/gpu/drm/xe/xe_pcode.c
@@ -7,6 +7,7 @@
 
 #include <linux/delay.h>
 #include <linux/errno.h>
+#include <linux/error-injection.h>
 
 #include <drm/drm_managed.h>
 
@@ -323,3 +324,4 @@ int xe_pcode_probe_early(struct xe_device *xe)
 {
 	return xe_pcode_ready(xe, false);
 }
+ALLOW_ERROR_INJECTION(xe_pcode_probe_early, ERRNO); /* See xe_pci_probe */

-- 
2.48.1


  parent reply	other threads:[~2025-03-13 20:41 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-03-13 20:40 [PATCH v4 0/3] drm/xe: Fix survivability Lucas De Marchi
2025-03-13 20:40 ` [PATCH v4 1/3] drm/xe: Move survivability back to xe Lucas De Marchi
2025-03-17  5:24   ` Riana Tauro
2025-03-13 20:41 ` [PATCH v4 2/3] drm/xe: Set survivability mode before heci init Lucas De Marchi
2025-03-13 20:41 ` Lucas De Marchi [this message]
2025-03-13 20:48 ` ✓ CI.Patch_applied: success for drm/xe: Fix survivability (rev4) Patchwork
2025-03-13 20:48 ` ✓ CI.checkpatch: " Patchwork
2025-03-13 20:49 ` ✓ CI.KUnit: " Patchwork
2025-03-13 21:06 ` ✓ CI.Build: " Patchwork
2025-03-13 21:08 ` ✓ CI.Hooks: " Patchwork
2025-03-13 21:10 ` ✓ CI.checksparse: " Patchwork
2025-03-14 12:07 ` ✓ Xe.CI.BAT: " Patchwork
2025-03-14 12:47 ` ✓ CI.Patch_applied: success for drm/xe: Fix survivability (rev6) Patchwork
2025-03-14 12:48 ` ✓ CI.checkpatch: " Patchwork
2025-03-14 12:49 ` ✓ CI.KUnit: " Patchwork
2025-03-14 13:19 ` ✓ CI.Build: " Patchwork
2025-03-14 13:21 ` ✓ CI.Hooks: " Patchwork
2025-03-14 13:23 ` ✓ CI.checksparse: " Patchwork
2025-03-14 13:44 ` ✓ Xe.CI.BAT: " Patchwork
2025-03-14 20:45 ` ✓ Xe.CI.Full: " Patchwork
2025-03-18 15:50 ` [PATCH v4 0/3] drm/xe: Fix survivability Raag Jadav

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20250313-fix-survivability-v4-3-5e90efdede99@intel.com \
    --to=lucas.demarchi@intel.com \
    --cc=francois.dugast@intel.com \
    --cc=intel-xe@lists.freedesktop.org \
    --cc=riana.tauro@intel.com \
    --cc=rodrigo.vivi@intel.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox