Skip to contentSkip to conversation

drm/xe/vsec: enforce CONFIG_INTEL_VSEC dependency

PATCH In review Arnd Bergmann 5 participants 7 messages Dec 17, 2024

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 drm/xe/vsec: enforce CONFIG_INTEL_VSEC dependency

From: Arnd Bergmann <[email protected]>

When INTEL_VSEC is in a loadable module, XE cannot be built-in any more:

x86_64-linux-ld: vmlinux.o: in function `xe_vsec_init':
(.text+0x19861bf): undefined reference to `intel_vsec_register'

This could be enforced using a 'depends on INTEL_VSEC || !INTEL_VSEC' style dependency to allow building with VSEC completely disabled. My impression here is that this was not actually intended, and that continuing to support that combination would lead to more build bugs.

Instead, make it a hard dependency as all other INTEL_VSEC users are, and remove the inline stub alternative. This leads to a dependency on CONFIG_X86_PLATFORM_DEVICES, so the 'select' has to be removed to avoid a circular dependency.

Fixes 0c45e76fcc62 ("drm/xe/vsec: Support BMG devices")
---
 drivers/gpu/drm/xe/Kconfig | 2 +-
 include/linux/intel_vsec.h | 7 -------
 2 files changed, 1 insertion(+), 8 deletions(-)
drivers/gpu/drm/xe/Kconfig +1 -1
index 6c5b665d9384..217b51468497 100644
@@ -2,6 +2,7 @@
 config DRM_XE
 	tristate "Intel Xe Graphics"
 	depends on DRM && PCI && MMU && (m || (y && KUNIT=y))
+	depends on INTEL_VSEC
 	select INTERVAL_TREE
 	# we need shmfs for the swappable backing store, and in particular
 	# the shmem_readpage() which depends upon tmpfs
@@ -28,7 +29,6 @@ config DRM_XE
 	select INPUT if ACPI
 	select ACPI_VIDEO if X86 && ACPI
 	select ACPI_BUTTON if ACPI
-	select X86_PLATFORM_DEVICES if X86 && ACPI
 	select ACPI_WMI if X86 && ACPI
 	select SYNC_FILE
 	select IOSF_MBI
include/linux/intel_vsec.h +0 -7
index b94beab64610..f2d55e686476 100644
@@ -138,13 +138,6 @@ static inline struct intel_vsec_device *auxdev_to_ivdev(struct auxiliary_device
 	return container_of(auxdev, struct intel_vsec_device, auxdev);
 }
 
-#if IS_ENABLED(CONFIG_INTEL_VSEC)
 void intel_vsec_register(struct pci_dev *pdev,
 			 struct intel_vsec_platform_info *info);
-#else
-static inline void intel_vsec_register(struct pci_dev *pdev,
-				       struct intel_vsec_platform_info *info)
-{
-}
-#endif
 #endif
Signature · 1 line
2.39.5
#1 lore raw

✗ CI.Patch_applied: failure for drm/xe/vsec: enforce CONFIG_INTEL_VSEC dependency

== Series Details ==

== Series Details ==

Series: drm/xe/vsec: enforce CONFIG_INTEL_VSEC dependency
URL : https://patchwork.freedesktop.org/series/142695/
State : failure

== Summary ==

=== Applying kernel patches on branch 'drm-tip' with base: ===
Base commit: e7c9466eaad2 drm-tip: 2024y-12m-17d-02h-09m-32s UTC integration manifest === git am output follows ===
error: patch failed: drivers/gpu/drm/xe/Kconfig:28
error: drivers/gpu/drm/xe/Kconfig: patch does not apply
hint: Use 'git am --show-current-patch=diff' to see the failed patch
Applying: drm/xe/vsec: enforce CONFIG_INTEL_VSEC dependency
Patch failed at 0001 drm/xe/vsec: enforce CONFIG_INTEL_VSEC dependency 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".

maintainer
#2 lore raw
In reply to Arnd Bergmann
Quoted 12 lines · Arnd Bergmann

From: Arnd Bergmann <[email protected]>

When INTEL_VSEC is in a loadable module, XE cannot be built-in any more:

x86_64-linux-ld: vmlinux.o: in function `xe_vsec_init':
(.text+0x19861bf): undefined reference to `intel_vsec_register'

This could be enforced using a 'depends on INTEL_VSEC || !INTEL_VSEC' style dependency to allow building with VSEC completely disabled. My impression here is that this was not actually intended, and that continuing to support that combination would lead to more build bugs.

Quoted 5 lines

Instead, make it a hard dependency as all other INTEL_VSEC users are, and remove the inline stub alternative. This leads to a dependency on CONFIG_X86_PLATFORM_DEVICES, so the 'select' has to be removed to avoid a circular dependency.

I really don't want us to hard lock this X86 dependency here. What if we add a new DRM_XE_DGFX_PMT_SUPPORT and that depends on INTEL_VSEC ?

and our if statement changes to
if (IS_ENABLED(DRM_XE_DGFX_PMT_SUPPORT)

We could even leave this enabled by default, but at least it is an easy path to someone willing to run experiments without depending on X86 I believe...

Cc Michael J. Ruhl <[email protected]>
Cc Lucas De Marchi <[email protected]>
Quoted 48 lines
Fixes 0c45e76fcc62 ("drm/xe/vsec: Support BMG devices")
---
 drivers/gpu/drm/xe/Kconfig | 2 +-
 include/linux/intel_vsec.h | 7 -------
 2 files changed, 1 insertion(+), 8 deletions(-)
drivers/gpu/drm/xe/Kconfig +1 -1
index 6c5b665d9384..217b51468497 100644
@@ -2,6 +2,7 @@
 config DRM_XE
 	tristate "Intel Xe Graphics"
 	depends on DRM && PCI && MMU && (m || (y && KUNIT=y))
+	depends on INTEL_VSEC
 	select INTERVAL_TREE
 	# we need shmfs for the swappable backing store, and in particular
 	# the shmem_readpage() which depends upon tmpfs
@@ -28,7 +29,6 @@ config DRM_XE
 	select INPUT if ACPI
 	select ACPI_VIDEO if X86 && ACPI
 	select ACPI_BUTTON if ACPI
-	select X86_PLATFORM_DEVICES if X86 && ACPI
 	select ACPI_WMI if X86 && ACPI
 	select SYNC_FILE
 	select IOSF_MBI
include/linux/intel_vsec.h +0 -7
index b94beab64610..f2d55e686476 100644
@@ -138,13 +138,6 @@ static inline struct intel_vsec_device *auxdev_to_ivdev(struct auxiliary_device
 	return container_of(auxdev, struct intel_vsec_device, auxdev);
 }
 
-#if IS_ENABLED(CONFIG_INTEL_VSEC)
 void intel_vsec_register(struct pci_dev *pdev,
 			 struct intel_vsec_platform_info *info);
-#else
-static inline void intel_vsec_register(struct pci_dev *pdev,
-				       struct intel_vsec_platform_info *info)
-{
-}
-#endif
 #endif
Signature · 1 line
2.39.5
#3 lore raw
Quoted 19 lines · Rodrigo Vivi
Quoted 12 lines · Arnd Bergmann

From: Arnd Bergmann <[email protected]>

When INTEL_VSEC is in a loadable module, XE cannot be built-in any more:

x86_64-linux-ld: vmlinux.o: in function `xe_vsec_init':
(.text+0x19861bf): undefined reference to `intel_vsec_register'

This could be enforced using a 'depends on INTEL_VSEC || !INTEL_VSEC' style dependency to allow building with VSEC completely disabled. My impression here is that this was not actually intended, and that continuing to support that combination would lead to more build bugs.

Quoted 5 lines

Instead, make it a hard dependency as all other INTEL_VSEC users are, and remove the inline stub alternative. This leads to a dependency on CONFIG_X86_PLATFORM_DEVICES, so the 'select' has to be removed to avoid a circular dependency.

Quoted 3 lines

I really don't want us to hard lock this X86 dependency here. What if we add a new DRM_XE_DGFX_PMT_SUPPORT and that depends on INTEL_VSEC ?

Yes, that should work if it gets phrased correctly. Something like

config DRM_XE_DGFX_PMT_SUPPORT

       bool "X86 PMT support"
       depends on DRM_XE && INTEL_VSEC
       depends on DRM_XE=m || INTEL_VSEC=y
       depends on X86 || COMPILE_TEST



     Arnd
maintainer
#4 lore raw
Quoted 24 lines · Arnd Bergmann
Quoted 19 lines · Rodrigo Vivi
Quoted 12 lines · Arnd Bergmann

From: Arnd Bergmann <[email protected]>

When INTEL_VSEC is in a loadable module, XE cannot be built-in any more:

x86_64-linux-ld: vmlinux.o: in function `xe_vsec_init':
(.text+0x19861bf): undefined reference to `intel_vsec_register'

This could be enforced using a 'depends on INTEL_VSEC || !INTEL_VSEC' style dependency to allow building with VSEC completely disabled. My impression here is that this was not actually intended, and that continuing to support that combination would lead to more build bugs.

Quoted 5 lines

Instead, make it a hard dependency as all other INTEL_VSEC users are, and remove the inline stub alternative. This leads to a dependency on CONFIG_X86_PLATFORM_DEVICES, so the 'select' has to be removed to avoid a circular dependency.

Quoted 3 lines

I really don't want us to hard lock this X86 dependency here. What if we add a new DRM_XE_DGFX_PMT_SUPPORT and that depends on INTEL_VSEC ?

Quoted 5 lines

Yes, that should work if it gets phrased correctly. Something like

config DRM_XE_DGFX_PMT_SUPPORT
bool "X86 PMT support"

I'd say bool "Enable PMT support for Intel DGFX"

the X86 PMT sounds more the cpu package pmt which is enabled out of Xe scope

hmm, I'm thinking we shouldn't also add
depends on CONFIG_INTEL_PMT_TELEMETRY

Dave, thoughts?

Cc David E. Box <[email protected]>
Quoted 3 lines
       depends on DRM_XE && INTEL_VSEC
       depends on DRM_XE=m || INTEL_VSEC=y
       depends on X86 || COMPILE_TEST

and also
default y

Quoted 4 lines

Arnd

#5 lore raw
In reply to Arnd Bergmann
Quoted 6 lines · Arnd Bergmann
Quoted 5 lines · Rodrigo Vivi
Quoted 4 lines · Arnd Bergmann

From: Arnd Bergmann <[email protected]>

When INTEL_VSEC is in a loadable module, XE cannot be built-in any more:

Quoted 7 lines
Quoted 7 lines
Quoted 7 lines

x86_64-linux-ld: vmlinux.o: in function `xe_vsec_init':
(.text+0x19861bf): undefined reference to `intel_vsec_register'

This could be enforced using a 'depends on INTEL_VSEC || !INTEL_VSEC' style dependency to allow building with VSEC completely disabled. My impression here is that this was not actually intended, and that continuing to support that combination would lead to more build bugs.

why? if xe is built-in, vsec needs to be built-in as well. If xe is a module, vsec can be either built-in or a module.

Quoted 11 lines
Quoted 10 lines
Quoted 6 lines

Instead, make it a hard dependency as all other INTEL_VSEC users are, and remove the inline stub alternative. This leads to a dependency on CONFIG_X86_PLATFORM_DEVICES, so the 'select' has to be removed to avoid a circular dependency.

I really don't want us to hard lock this X86 dependency here. What if we add a new DRM_XE_DGFX_PMT_SUPPORT and that depends on INTEL_VSEC ?

Quoted 8 lines

Yes, that should work if it gets phrased correctly. Something like

config DRM_XE_DGFX_PMT_SUPPORT

      bool "X86 PMT support"
      depends on DRM_XE && INTEL_VSEC
      depends on DRM_XE=m || INTEL_VSEC=y
      depends on X86 || COMPILE_TEST

that looks good to me.

thanks
Lucas De Marchi

#6 lore raw
Quoted 10 lines · Lucas De Marchi
Quoted 9 lines · Arnd Bergmann
Quoted 8 lines · Rodrigo Vivi
Quoted 7 lines · Arnd Bergmann

From: Arnd Bergmann <[email protected]>

When INTEL_VSEC is in a loadable module, XE cannot be built-in any more:

x86_64-linux-ld: vmlinux.o: in function `xe_vsec_init':
(.text+0x19861bf): undefined reference to `intel_vsec_register'

Quoted 7 lines
Quoted 4 lines
Quoted 4 lines
Quoted 4 lines

This could be enforced using a 'depends on INTEL_VSEC || !INTEL_VSEC' style dependency to allow building with VSEC completely disabled. My impression here is that this was not actually intended, and that continuing to support that combination would lead to more build bugs.

why? if xe is built-in, vsec needs to be built-in as well. If xe is a module, vsec can be either built-in or a module.

"depends on INTEL_VSEC" enforces that hard dependency. The difference with "depends on INTEL_VSEC || !INTEL_VSEC" is that it also allows XE to be either built-in or a module if INTEL_VSEC is turned off, as it would be the case on non-x86.

Arnd