Skip to content

Commit 676da6b

Browse files
committed
drm/xe: Allow to inject error in early probe
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> Link: https://patchwork.freedesktop.org/patch/msgid/20250314-fix-survivability-v5-3-fdb3559ea965@intel.com Signed-off-by: Lucas De Marchi <lucas.demarchi@intel.com>
1 parent 14efa73 commit 676da6b

File tree

3 files changed

+4
-0
lines changed

3 files changed

+4
-0
lines changed

drivers/gpu/drm/xe/xe_device.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -735,6 +735,7 @@ int xe_device_probe_early(struct xe_device *xe)
735735

736736
return 0;
737737
}
738+
ALLOW_ERROR_INJECTION(xe_device_probe_early, ERRNO); /* See xe_pci_probe() */
738739

739740
static int probe_has_flat_ccs(struct xe_device *xe)
740741
{

drivers/gpu/drm/xe/xe_mmio.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -138,6 +138,7 @@ int xe_mmio_probe_early(struct xe_device *xe)
138138

139139
return devm_add_action_or_reset(xe->drm.dev, mmio_fini, xe);
140140
}
141+
ALLOW_ERROR_INJECTION(xe_mmio_probe_early, ERRNO); /* See xe_pci_probe() */
141142

142143
/**
143144
* xe_mmio_init() - Initialize an MMIO instance

drivers/gpu/drm/xe/xe_pcode.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77

88
#include <linux/delay.h>
99
#include <linux/errno.h>
10+
#include <linux/error-injection.h>
1011

1112
#include <drm/drm_managed.h>
1213

@@ -323,3 +324,4 @@ int xe_pcode_probe_early(struct xe_device *xe)
323324
{
324325
return xe_pcode_ready(xe, false);
325326
}
327+
ALLOW_ERROR_INJECTION(xe_pcode_probe_early, ERRNO); /* See xe_pci_probe */

0 commit comments

Comments
 (0)