Intel-XE Archive on lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] drm/xe: Fix build with DRM_XE=y and CONFIGFS_FS=m
@ 2026-10-16 17:29 Rodrigo Vivi
  2026-10-16 17:39 ` ✓ CI.KUnit: success for " Patchwork
                   ` (6 more replies)
  0 siblings, 7 replies; 15+ messages in thread
From: Rodrigo Vivi @ 2026-10-16 17:29 UTC (permalink / raw)
  To: intel-xe; +Cc: Rodrigo Vivi, Riana Tauro, Stuart Summers, kernel test robot

When xe is built-in but configfs is a module, xe_configfs.o ends up in
xe-m and is never linked, while xe_configfs.h still declares the real
functions because IS_ENABLED(CONFIG_CONFIGFS_FS) is true. This results
in undefined references to all xe_configfs_* symbols at link time.

Adding a "depends on CONFIGFS_FS || !CONFIGFS_FS" to DRM_XE is not an
option, as it creates a recursive Kconfig dependency through INPUT and
USB_GADGET. Instead, add a hidden DRM_XE_CONFIGFS symbol that is only
enabled when configfs is reachable from xe, and use it both to build
xe_configfs.o and to select the real or stub interface in the header.

Cc: Riana Tauro <riana.tauro@intel.com>
Cc: Stuart Summers <stuart.summers@intel.com>
Fixes: 16280ded45fb ("drm/xe: Add configfs to enable survivability mode")
Reported-by: kernel test robot <lkp@intel.com>
Closes: https://lore.kernel.org/oe-kbuild-all/202610160935.Qk4ZxBxY-lkp@intel.com/
Assisted-by: LLM
Signed-off-by: Rodrigo Vivi <rodrigo.vivi@intel.com>
---
 drivers/gpu/drm/xe/Kconfig       | 6 ++++++
 drivers/gpu/drm/xe/Makefile      | 2 +-
 drivers/gpu/drm/xe/xe_configfs.h | 2 +-
 3 files changed, 8 insertions(+), 2 deletions(-)

diff --git a/drivers/gpu/drm/xe/Kconfig b/drivers/gpu/drm/xe/Kconfig
index 0d87251c5d7c..9479340b5808 100644
--- a/drivers/gpu/drm/xe/Kconfig
+++ b/drivers/gpu/drm/xe/Kconfig
@@ -116,6 +116,12 @@ config DRM_XE_COMPRESS_DUMP
 
 	  If in doubt say "Y".
 
+config DRM_XE_CONFIGFS
+	bool
+	depends on DRM_XE
+	# configfs needs to be reachable from xe: built-in, or both modules
+	default y if CONFIGFS_FS = y || (CONFIGFS_FS = m && DRM_XE = m)
+
 config DRM_XE_FORCE_PROBE
 	string "Force probe xe for selected Intel hardware IDs"
 	depends on DRM_XE
diff --git a/drivers/gpu/drm/xe/Makefile b/drivers/gpu/drm/xe/Makefile
index 10930c924070..588091c529e8 100644
--- a/drivers/gpu/drm/xe/Makefile
+++ b/drivers/gpu/drm/xe/Makefile
@@ -166,7 +166,7 @@ xe-$(CONFIG_DRM_GPUSVM) += xe_userptr.o
 xe-$(CONFIG_HWMON) += xe_hwmon.o
 
 xe-$(CONFIG_PERF_EVENTS) += xe_pmu.o
-xe-$(CONFIG_CONFIGFS_FS) += xe_configfs.o
+xe-$(CONFIG_DRM_XE_CONFIGFS) += xe_configfs.o
 
 # graphics virtualization (SR-IOV) support
 xe-y += \
diff --git a/drivers/gpu/drm/xe/xe_configfs.h b/drivers/gpu/drm/xe/xe_configfs.h
index 10a00d6bbf8f..063e73fe01d5 100644
--- a/drivers/gpu/drm/xe/xe_configfs.h
+++ b/drivers/gpu/drm/xe/xe_configfs.h
@@ -14,7 +14,7 @@
 
 struct pci_dev;
 
-#if IS_ENABLED(CONFIG_CONFIGFS_FS)
+#if IS_ENABLED(CONFIG_DRM_XE_CONFIGFS)
 int xe_configfs_init(void);
 void xe_configfs_exit(void);
 void xe_configfs_check_device(struct pci_dev *pdev);
-- 
2.55.0


^ permalink raw reply related	[flat|nested] 15+ messages in thread

end of thread, other threads:[~2026-10-19 22:55 UTC | newest]

Thread overview: 15+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-10-16 17:29 [PATCH] drm/xe: Fix build with DRM_XE=y and CONFIGFS_FS=m Rodrigo Vivi
2026-10-16 17:39 ` ✓ CI.KUnit: success for " Patchwork
2026-10-16 18:20 ` ✓ Xe.CI.BAT: " Patchwork
2026-10-16 18:54 ` [PATCH] " Summers, Stuart
2026-10-16 19:18 ` Matt Roper
2026-10-16 19:32   ` Rodrigo Vivi
2026-10-19 15:21     ` Jani Nikula
2026-10-19 15:25       ` Matt Roper
2026-10-19 16:53         ` Jani Nikula
2026-10-19 17:06           ` Matt Roper
2026-10-19 21:58             ` Rodrigo Vivi
2026-10-19 22:55               ` Matt Roper
2026-10-16 19:44 ` ✓ CI.KUnit: success for drm/xe: Fix build with DRM_XE=y and CONFIGFS_FS=m (rev2) Patchwork
2026-10-16 20:25 ` ✓ Xe.CI.BAT: " Patchwork
2026-10-17  2:10 ` ✓ Xe.CI.FULL: " Patchwork

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox