Intel-XE Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: "Summers, Stuart" <stuart.summers@intel.com>
To: "intel-xe@lists.freedesktop.org" <intel-xe@lists.freedesktop.org>,
	"Vivi,  Rodrigo" <rodrigo.vivi@intel.com>
Cc: "Tauro, Riana" <riana.tauro@intel.com>,
	"Roper, Matthew D" <matthew.d.roper@intel.com>,
	lkp <lkp@intel.com>
Subject: Re: [PATCH] drm/xe: Fix build with DRM_XE=y and CONFIGFS_FS=m
Date: Fri, 16 Oct 2026 18:54:19 +0000	[thread overview]
Message-ID: <9e2da69b4a3dcf61baca5ed9cd7f8f4d206f8cd4.camel@intel.com> (raw)
In-Reply-To: <20261016172937.2980310-2-rodrigo.vivi@intel.com>

On Fri, 2026-10-16 at 13:29 -0400, Rodrigo Vivi wrote:
> 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>

Yeah the wrapper makes sense to me. I really wish we can just always
select this and get rid of the different enabled/disabled functions...
but I agree with the point Matt had made in the other review.

We probably haven't hit this because almost everyone will either have
configfs or not have it rather than building as a module... But the fix
makes sense to me.

Build tested the positive cases at least... For the negative cases, I'm
not sure how realistic it is to actually have CONFIGFS_FS set to 'n'
since a lot of the devices on a typical distribution are going to
select this by default. For example, this is what I see on a quick
grep:
drivers/iio/Kconfig:	select CONFIGFS_FS
drivers/block/null_blk/Kconfig:	select CONFIGFS_FS
drivers/gpio/Kconfig:	select CONFIGFS_FS
drivers/gpio/Kconfig:	select CONFIGFS_FS
drivers/gpio/Kconfig:	select CONFIGFS_FS
drivers/usb/gadget/Kconfig:	select CONFIGFS_FS
drivers/nvme/target/Kconfig:	select CONFIGFS_FS
drivers/acpi/Kconfig:	select CONFIGFS_FS
drivers/gpu/drm/vkms/Kconfig:	select CONFIGFS_FS
drivers/hwtracing/stm/Kconfig:	select CONFIGFS_FS
drivers/hwtracing/coresight/Kconfig:	select CONFIGFS_FS
drivers/pci/endpoint/functions/Kconfig:	select CONFIGFS_FS
drivers/pci/endpoint/functions/Kconfig:	select CONFIGFS_FS
drivers/pci/endpoint/functions/Kconfig:	select CONFIGFS_FS
drivers/pci/endpoint/Kconfig:	select CONFIGFS_FS
drivers/virt/coco/guest/Kconfig:	select CONFIGFS_FS
drivers/target/Kconfig:	select CONFIGFS_FS
kernel/Kconfig.kexec:	select CONFIGFS_FS
kernel/Kconfig.kexec:	  CRASH_DM_CRYPT cannot directly select
CONFIGFS_FS, because that
lib/Kconfig.debug:	select CONFIGFS_FS
net/9p/Kconfig:	select CONFIGFS_FS

So while I agree this is needed in the current implementation, I'd
still argue we should just select CONFIGFS_FS and not deal with the
extra complexity. Although maybe we do have some use case where someone
wants to bring up some basic display and graphics or pure compute in an
extremely minimal setup otherwise.

Anyway for this one:

Reviewed-by: Stuart Summers <stuart.summers@intel.com>

Thanks,
Stuart

> ---
>  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);


  parent reply	other threads:[~2026-10-16 18:54 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
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 ` Summers, Stuart [this message]
2026-10-16 19:18 ` [PATCH] " 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

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=9e2da69b4a3dcf61baca5ed9cd7f8f4d206f8cd4.camel@intel.com \
    --to=stuart.summers@intel.com \
    --cc=intel-xe@lists.freedesktop.org \
    --cc=lkp@intel.com \
    --cc=matthew.d.roper@intel.com \
    --cc=riana.tauro@intel.com \
    --cc=rodrigo.vivi@intel.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox