Skip to content

Commit 99e9152

Browse files
lucasdemarchiThomas Hellström
authored andcommitted
drm/xe: Fix build without debugfs
When CONFIG_DEBUG_FS is off, drivers/gpu/drm/xe/xe_gt_debugfs.o is not built and build fails on some setups with: ld: drivers/gpu/drm/xe/xe_gt.o: in function `xe_fault_inject_gt_reset': drivers/gpu/drm/xe/xe_gt.h:27:(.text+0x1659): undefined reference to `gt_reset_failure' ld: drivers/gpu/drm/xe/xe_gt.h:27:(.text+0x1c16): undefined reference to `gt_reset_failure' collect2: error: ld returned 1 exit status Do not use the gt_reset_failure attribute if debugfs is not enabled. Fixes: 8f3013e ("drm/xe: Introduce fault injection for gt reset") Cc: Himal Prasad Ghimiray <[email protected]> Acked-by: Randy Dunlap <[email protected]> Tested-by: Randy Dunlap <[email protected]> Reviewed-by: Himal Prasad Ghimiray <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Lucas De Marchi <[email protected]> (cherry picked from commit 4d3bbe9) Signed-off-by: Thomas Hellström <[email protected]>
1 parent 5c244ee commit 99e9152

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

drivers/gpu/drm/xe/xe_gt.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424
extern struct fault_attr gt_reset_failure;
2525
static inline bool xe_fault_inject_gt_reset(void)
2626
{
27-
return should_fail(&gt_reset_failure, 1);
27+
return IS_ENABLED(CONFIG_DEBUG_FS) && should_fail(&gt_reset_failure, 1);
2828
}
2929

3030
struct xe_gt *xe_gt_alloc(struct xe_tile *tile);

0 commit comments

Comments
 (0)