drm/xe/ras: Use fault-inject to trigger cold-reset wedge

Use the fault-inject framework to trigger the cold-reset
wedge path (punit_error_handler()) for testing the
wedge/recovery flow.

Usage:
  echo 100 > .../wedge_cold_reset/probability
  echo 1   > .../wedge_cold_reset/times

Signed-off-by: Mallesh Koujalagi <mallesh.koujalagi@intel.com>
Reviewed-by: Raag Jadav <raag.jadav@intel.com>
Link: https://patch.msgid.link/20260805071152.1225416-10-mallesh.koujalagi@intel.com
Signed-off-by: Rodrigo Vivi <rodrigo.vivi@intel.com>
This commit is contained in:
Mallesh Koujalagi 2026-08-05 12:41:57 +05:30 committed by Rodrigo Vivi
parent 9b00f61536
commit f29c2bd7ea
No known key found for this signature in database
GPG Key ID: FA625F640EEB13CA
3 changed files with 13 additions and 0 deletions

View File

@ -43,6 +43,7 @@
DECLARE_FAULT_ATTR(gt_reset_failure);
DECLARE_FAULT_ATTR(inject_csc_hw_error);
DECLARE_FAULT_ATTR(wedge_cold_reset);
static bool csc_hw_error_available(struct xe_device *xe)
{
@ -63,6 +64,8 @@ static struct {
{ .name = "inject_csc_hw_error",
.attr = &inject_csc_hw_error,
.is_visible = csc_hw_error_available },
{ .name = "wedge_cold_reset",
.attr = &wedge_cold_reset },
};
/*
@ -77,6 +80,7 @@ bool xe_fault_##name(void) \
FAULT_ACTION(gt_reset, gt_reset_failure)
FAULT_ACTION(csc_hw_error, inject_csc_hw_error)
FAULT_ACTION(wedge_cold_reset, wedge_cold_reset)
static void xe_fault_inject_debugfs_register(struct xe_device *xe,
struct dentry *root)

View File

@ -13,10 +13,12 @@ struct xe_device;
#ifdef CONFIG_DEBUG_FS
bool xe_fault_gt_reset(void);
bool xe_fault_csc_hw_error(void);
bool xe_fault_wedge_cold_reset(void);
void xe_debugfs_register(struct xe_device *xe);
#else
static inline bool xe_fault_gt_reset(void) { return false; }
static inline bool xe_fault_csc_hw_error(void) { return false; }
static inline bool xe_fault_wedge_cold_reset(void) { return false; }
static inline void xe_debugfs_register(struct xe_device *xe) { }
#endif

View File

@ -3,6 +3,7 @@
* Copyright © 2026 Intel Corporation
*/
#include "xe_debugfs.h"
#include "xe_device.h"
#include "xe_drm_ras.h"
#include "xe_pm.h"
@ -477,6 +478,12 @@ enum xe_ras_recovery_action xe_ras_process_errors(struct xe_device *xe)
size_t rlen;
int ret;
if (xe_fault_wedge_cold_reset()) {
xe_err(xe, "[RAS]: cold-reset wedge injected\n");
punit_error_handler(xe);
return XE_RAS_RECOVERY_ACTION_DISCONNECT;
}
if (!xe->info.has_sysctrl)
return XE_RAS_RECOVERY_ACTION_RESET;