drm/xe: Fix build without CONFIG_FAULT_INJECTION
Subsystems (2)
Rodrigo Vivi
maintainerPATCH 1/1 drm/xe: Fix build without CONFIG_FAULT_INJECTION
Ideally this header could be included without the CONFIG_FAULT_INJECTION and it would take care itself for the includes it needs.
So, let's temporary workaround this by moving this below and including only when CONFIG_FAULT_INJECTION is selected to avoid build breakages.
Another solution would be us including the linux/types.h as well, but this creates unnecessary cases.
Reference: https://lore.kernel.org/all/[email protected]/
--- drivers/gpu/drm/xe/xe_debugfs.c | 2 +- drivers/gpu/drm/xe/xe_gt.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-)
drivers/gpu/drm/xe/xe_debugfs.c +1 -1
@@ -5,7 +5,6 @@#include "xe_debugfs.h" -#include <linux/fault-inject.h> #include <linux/string_helpers.h> #include <drm/drm_debugfs.h>
@@ -22,6 +21,7 @@#endif #ifdef CONFIG_FAULT_INJECTION +#include <linux/fault-inject.h> /* XXX: fault-inject.h is broken */ DECLARE_FAULT_ATTR (gt_reset_failure);#endif
drivers/gpu/drm/xe/xe_gt.h +1 -1
@@ -7,7 +7,6 @@#define _XE_GT_H_#include <drm/drm_util.h> -#include <linux/fault-inject.h> #include "xe_device_types.h" #include "xe_hw_engine.h"
@@ -20,6 +19,7 @@#define CCS_MASK (gt) (((gt)->info.engine_mask & XE_HW_ENGINE_CCS_MASK) >> XE_HW_ENGINE_CCS0)#ifdef CONFIG_FAULT_INJECTION +#include <linux/fault-inject.h> /* XXX: fault-inject.h is broken */ extern struct fault_attr gt_reset_failure;static inline bool xe_fault_inject_gt_reset (void ) {
Signature · 1 line
2.43.0
Quoted 8 lines · Rodrigo Vivi
Ideally this header could be included without the
CONFIG_FAULT_INJECTIONand it would take care itself for the includes it needs.
So, let's temporary workaround this by moving this below and including only whenCONFIG_FAULT_INJECTIONis selected to avoid build breakages.Another solution would be us including the
linux/types.has well, but this creates unnecessary cases.
Quoted 6 lines
Reference: https://lore.kernel.org/all/[email protected]/
Cc Himal Prasad Ghimiray <[email protected]>Cc Oded Gabbay <[email protected]>Cc Thomas Hellström <[email protected]>Cc Lucas De Marchi <[email protected]>Signed-off-by Rodrigo Vivi <[email protected]>
LGTM.
Quoted 45 lines
--- drivers/gpu/drm/xe/xe_debugfs.c | 2 +- drivers/gpu/drm/xe/xe_gt.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-)drivers/gpu/drm/xe/xe_debugfs.c +1
-1@@ -5,7 +5,6 @@#include "xe_debugfs.h" -#include <linux/fault-inject.h> #include <linux/string_helpers.h> #include <drm/drm_debugfs.h> @@ -22,6 +21,7 @@#endif #ifdef CONFIG_FAULT_INJECTION +#include <linux/fault-inject.h> /* XXX: fault-inject.h is broken */ DECLARE_FAULT_ATTR (gt_reset_failure);#endif drivers/gpu/drm/xe/xe_gt.h +1
-1@@ -7,7 +7,6 @@#define _XE_GT_H_#include <drm/drm_util.h> -#include <linux/fault-inject.h> #include "xe_device_types.h" #include "xe_hw_engine.h" @@ -20,6 +19,7 @@#define CCS_MASK (gt) (((gt)->info.engine_mask & XE_HW_ENGINE_CCS_MASK) >> XE_HW_ENGINE_CCS0)#ifdef CONFIG_FAULT_INJECTION +#include <linux/fault-inject.h> /* XXX: fault-inject.h is broken */ extern struct fault_attr gt_reset_failure;static inline bool xe_fault_inject_gt_reset (void ) {
Quoted 17 lines · Thomas Hellström
Quoted 8 lines · Rodrigo Vivi
Ideally this header could be included without the
CONFIG_FAULT_INJECTIONand it would take care itself for the includes it needs.
So, let's temporary workaround this by moving this below and including only whenCONFIG_FAULT_INJECTIONis selected to avoid build breakages.Another solution would be us including the
linux/types.has well, but this creates unnecessary cases.Quoted 6 lines
Reference: https://lore.kernel.org/all/[email protected]/
Cc Himal Prasad Ghimiray <[email protected]>Cc Oded Gabbay <[email protected]>Cc Thomas Hellström <[email protected]>Cc Lucas De Marchi <[email protected]>Signed-off-by Rodrigo Vivi <[email protected]>
Quoted 3 lines
LGTM.
Reviewed-by Thomas Hellström <[email protected]>
Hmm, msm/msm_drv.c doesn't seem to need to do this. Anyway maybe ok for a temporary fix...
Rodrigo Vivi
maintainerQuoted 18 lines · Ashutosh
Quoted 17 lines · Thomas Hellström
Quoted 14 lines · Rodrigo Vivi
Ideally this header could be included without the
CONFIG_FAULT_INJECTIONand it would take care itself for the includes it needs.
So, let's temporary workaround this by moving this below and including only whenCONFIG_FAULT_INJECTIONis selected to avoid build breakages.Another solution would be us including the
linux/types.has well, but this creates unnecessary cases.Reference: https://lore.kernel.org/all/[email protected]/
Cc Himal Prasad Ghimiray <[email protected]>Cc Oded Gabbay <[email protected]>Cc Thomas Hellström <[email protected]>Cc Lucas De Marchi <[email protected]>Signed-off-by Rodrigo Vivi <[email protected]>
Quoted 5 lines
Quoted 3 lines
LGTM.
Reviewed-by Thomas Hellström <[email protected]>Hmm,
msm/msm_drv.cdoesn't seem to need to do this.
because it also imports the types.h:
drivers/gpu/drm/msm/msm_drv.h:#include <linux/types.h>
Quoted 2 lines
Anyway maybe ok for a
temporary fix...
yes, it is a temporary hammer.
But maybe we don't need this if Andrew acks to get this through drm-xe-next -> drm-next:
https://lore.kernel.org/all/a5o2opdfsfnbptrrbvillogft2uqp73w4icu3mdmmwtvoqmdr2@y2fbrc6t4aew/
Patchwork
CI✗ Fi.CI.BUILD: failure for drm/xe: Fix build without CONFIG_FAULT_INJECTION
In reply to Rodrigo Vivi== Series Details ==
== Series Details ==
Series: drm/xe: Fix build without CONFIG_FAULT_INJECTION
URL : https://patchwork.freedesktop.org/series/127911/
State : failure
== Summary ==
Error: patch https://patchwork.freedesktop.org/api/1.0/series/127911/revisions/1/mbox/ not applied
Applying: drm/xe: Fix build without CONFIG_FAULT_INJECTION
error: sha1 information is lacking or useless (drivers/gpu/drm/xe/xe_debugfs.c).
error: could not build fake ancestor
hint: Use 'git am --show-current-patch=diff' to see the failed patch
Patch failed at 0001 drm/xe: Fix build without CONFIG_FAULT_INJECTION
When you have resolved this problem, run "git am --continue".
If you prefer to skip this patch, run "git am --skip" instead.
To restore the original branch and stop patching, run "git am --abort".
Build failed, no error log produced