Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

drm/xe: clean up fault injection usage

With the proper stubs in place in linux/fault-inject.h, we can remove a
bunch of conditional compilation for CONFIG_FAULT_INJECTION=n.

Link: https://lkml.kernel.org/r/20240813121237.2382534-3-jani.nikula@intel.com
Signed-off-by: Jani Nikula <jani.nikula@intel.com>
Reviewed-by: Thomas Hellström <thomas.hellstrom@linux.intel.com>
Reviewed-by: Himal Prasad Ghimiray <himal.prasad.ghimiray@intel.com>
Cc: Akinobu Mita <akinobu.mita@gmail.com>
Cc: Lucas De Marchi <lucas.demarchi@intel.com>
Cc: Rodrigo Vivi <rodrigo.vivi@intel.com>
Cc: Abhinav Kumar <quic_abhinavk@quicinc.com>
Cc: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
Cc: Rob Clark <robdclark@gmail.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>

authored by

Jani Nikula and committed by
Andrew Morton
ccbfd2df f161cdd9

+3 -14
+1 -6
drivers/gpu/drm/xe/xe_debugfs.c
··· 6 6 #include "xe_debugfs.h" 7 7 8 8 #include <linux/debugfs.h> 9 + #include <linux/fault-inject.h> 9 10 #include <linux/string_helpers.h> 10 11 11 12 #include <drm/drm_debugfs.h> ··· 27 26 #include "xe_vm.h" 28 27 #endif 29 28 30 - #ifdef CONFIG_FAULT_INJECTION 31 - #include <linux/fault-inject.h> /* XXX: fault-inject.h is broken */ 32 29 DECLARE_FAULT_ATTR(gt_reset_failure); 33 - #endif 34 30 35 31 static struct xe_device *node_to_xe(struct drm_info_node *node) 36 32 { ··· 212 214 for_each_gt(gt, xe, id) 213 215 xe_gt_debugfs_register(gt); 214 216 215 - #ifdef CONFIG_FAULT_INJECTION 216 217 fault_create_debugfs_attr("fail_gt_reset", root, &gt_reset_failure); 217 - #endif 218 - 219 218 }
+2 -8
drivers/gpu/drm/xe/xe_gt.h
··· 6 6 #ifndef _XE_GT_H_ 7 7 #define _XE_GT_H_ 8 8 9 + #include <linux/fault-inject.h> 10 + 9 11 #include <drm/drm_util.h> 10 12 11 13 #include "xe_device.h" ··· 21 19 22 20 #define CCS_MASK(gt) (((gt)->info.engine_mask & XE_HW_ENGINE_CCS_MASK) >> XE_HW_ENGINE_CCS0) 23 21 24 - #ifdef CONFIG_FAULT_INJECTION 25 - #include <linux/fault-inject.h> /* XXX: fault-inject.h is broken */ 26 22 extern struct fault_attr gt_reset_failure; 27 23 static inline bool xe_fault_inject_gt_reset(void) 28 24 { 29 25 return should_fail(&gt_reset_failure, 1); 30 26 } 31 - #else 32 - static inline bool xe_fault_inject_gt_reset(void) 33 - { 34 - return false; 35 - } 36 - #endif 37 27 38 28 struct xe_gt *xe_gt_alloc(struct xe_tile *tile); 39 29 int xe_gt_init_hwconfig(struct xe_gt *gt);