-
- Downloads
drm/xe: Use fault injection infrastructure to find issues at probe time
The kernel fault injection infrastructure is used to test proper error handling during probe. The return code of the functions using ALLOW_ERROR_INJECTION() can be conditionnally modified at runtime by tuning some debugfs entries. This requires CONFIG_FUNCTION_ERROR_INJECTION (among others). One way to use fault injection at probe time by making each of those functions fail one at a time is: FAILTYPE=fail_function DEVICE="0000:00:08.0" # depends on the system ERRNO=-12 # -ENOMEM, can depend on the function echo N > /sys/kernel/debug/$FAILTYPE/task-filter echo 100 > /sys/kernel/debug/$FAILTYPE/probability echo 0 > /sys/kernel/debug/$FAILTYPE/interval echo -1 > /sys/kernel/debug/$FAILTYPE/times echo 0 > /sys/kernel/debug/$FAILTYPE/space echo 1 > /sys/kernel/debug/$FAILTYPE/verbose modprobe xe echo $DEVICE > /sys/bus/pci/drivers/xe/unbind grep -oP "^.* \[xe\]" /sys/kernel/debug/$FAILTYPE/injectable | \ cut -d ' ' -f 1 | while read -r FUNCTION ; do echo "Injecting fault in $FUNCTION" echo "" > /sys/kernel/debug/$FAILTYPE/inject echo $FUNCTION > /sys/kernel/debug/$FAILTYPE/inject printf %#x $ERRNO > /sys/kernel/debug/$FAILTYPE/$FUNCTION/retval echo $DEVICE > /sys/bus/pci/drivers/xe/bind done rmmod xe It will also be integrated into IGT for systematic execution by CI. v2: Wrappers are not needed in the cases covered by this patch, so remove them and use ALLOW_ERROR_INJECTION() directly. v3: Document the use of fault injection at probe time in xe_pci_probe and refer to it where ALLOW_ERROR_INJECTION() is used. Signed-off-by:Francois Dugast <francois.dugast@intel.com> Cc: Lucas De Marchi <lucas.demarchi@intel.com> Cc: Matthew Brost <matthew.brost@intel.com> Cc: Rodrigo Vivi <rodrigo.vivi@intel.com> Cc: Michal Wajdeczko <michal.wajdeczko@intel.com> Cc: Jani Nikula <jani.nikula@intel.com> Reviewed-by:
Rodrigo Vivi <rodrigo.vivi@intel.com> Link: https://patchwork.freedesktop.org/patch/msgid/20240927151207.399354-1-francois.dugast@intel.com Signed-off-by:
Rodrigo Vivi <rodrigo.vivi@intel.com>
Showing
- drivers/gpu/drm/xe/xe_device.c 3 additions, 0 deletionsdrivers/gpu/drm/xe/xe_device.c
- drivers/gpu/drm/xe/xe_ggtt.c 2 additions, 0 deletionsdrivers/gpu/drm/xe/xe_ggtt.c
- drivers/gpu/drm/xe/xe_guc_ads.c 3 additions, 0 deletionsdrivers/gpu/drm/xe/xe_guc_ads.c
- drivers/gpu/drm/xe/xe_guc_ct.c 2 additions, 0 deletionsdrivers/gpu/drm/xe/xe_guc_ct.c
- drivers/gpu/drm/xe/xe_guc_log.c 3 additions, 0 deletionsdrivers/gpu/drm/xe/xe_guc_log.c
- drivers/gpu/drm/xe/xe_guc_relay.c 2 additions, 0 deletionsdrivers/gpu/drm/xe/xe_guc_relay.c
- drivers/gpu/drm/xe/xe_pci.c 19 additions, 0 deletionsdrivers/gpu/drm/xe/xe_pci.c
- drivers/gpu/drm/xe/xe_pm.c 2 additions, 0 deletionsdrivers/gpu/drm/xe/xe_pm.c
- drivers/gpu/drm/xe/xe_sriov.c 3 additions, 0 deletionsdrivers/gpu/drm/xe/xe_sriov.c
- drivers/gpu/drm/xe/xe_tile.c 3 additions, 0 deletionsdrivers/gpu/drm/xe/xe_tile.c
- drivers/gpu/drm/xe/xe_uc_fw.c 2 additions, 0 deletionsdrivers/gpu/drm/xe/xe_uc_fw.c
- drivers/gpu/drm/xe/xe_wa.c 2 additions, 0 deletionsdrivers/gpu/drm/xe/xe_wa.c
- drivers/gpu/drm/xe/xe_wopcm.c 3 additions, 0 deletionsdrivers/gpu/drm/xe/xe_wopcm.c
Loading
Please register or sign in to comment