drm/xe/vsec: fix CONFIG_INTEL_VSEC dependency
Subsystems (2)
PATCH 1/1 drm/xe/vsec: fix CONFIG_INTEL_VSEC dependency
From: Arnd Bergmann <[email protected]>
The XE driver can be built with or without VSEC support, but fails to link as built-in if vsec is in a loadable module:
x86_64-linux-ld: vmlinux.o: in function `xe_vsec_init':
(.text+0x1e83e16): undefined reference to `intel_vsec_register'
The normal fix for this is to add a 'depends on INTEL_VSEC || !INTEL_VSEC', forcing XE to be a loadable module as well, but that causes a circular dependency:
symbol DRM_XE depends on INTEL_VSEC symbol INTEL_VSEC depends on X86_PLATFORM_DEVICES symbol X86_PLATFORM_DEVICES is selected by DRM_XE
The problem here is selecting a symbol from another subsystem, so change that as well and rephrase the 'select' into the corresponding dependency. Since X86_PLATFORM_DEVICES is 'default y', there is no change to defconfig builds here.
--- drivers/gpu/drm/xe/Kconfig | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
drivers/gpu/drm/xe/Kconfig +2 -1
@@ -2,6 +2,8 @@ config DRM_XE tristate "Intel Xe Graphics" depends on DRM && PCI && (m || (y && KUNIT=y)) + depends on INTEL_VSEC || !INTEL_VSEC + depends on INTEL_PLATFORM_DEVICES || !(X86 && ACPI) select INTERVAL_TREE # we need shmfs for the swappable backing store, and in particular # the shmem_readpage() which depends upon tmpfs
@@ -29,7 +31,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
Signature · 1 line
2.39.5
Patchwork
CI✗ CI.Patch_applied: failure for drm/xe/vsec: fix CONFIG_INTEL_VSEC dependency
== Series Details ==
== Series Details ==
Series: drm/xe/vsec: fix CONFIG_INTEL_VSEC dependency
URL : https://patchwork.freedesktop.org/series/149427/
State : failure
== Summary ==
=== Applying kernel patches on branch 'drm-tip' with base: ===
Base commit: 5ed61f4a36b3 drm-tip: 2025y-05m-23d-13h-19m-23s UTC integration manifest === git am output follows ===
error: patch failed: drivers/gpu/drm/xe/Kconfig:2
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: fix CONFIG_INTEL_VSEC dependency
Patch failed at 0001 drm/xe/vsec: fix 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".
Quoted 35 lines · Arnd Bergmann
From: Arnd Bergmann <[email protected]>
The XE driver can be built with or without VSEC support, but fails to link as built-in if vsec is in a loadable module:
x86_64-linux-ld: vmlinux.o: in function `xe_vsec_init':
(.text+0x1e83e16): undefined reference to `intel_vsec_register'The normal fix for this is to add a 'depends on
INTEL_VSEC|| !INTEL_VSEC', forcing XE to be a loadable module as well, but that causes a circular dependency:symbol
DRM_XEdepends onINTEL_VSECsymbolINTEL_VSECdepends onX86_PLATFORM_DEVICESsymbolX86_PLATFORM_DEVICESis selected byDRM_XEThe problem here is selecting a symbol from another subsystem, so change that as well and rephrase the 'select' into the corresponding dependency. Since
X86_PLATFORM_DEVICESis 'default y', there is no change to defconfig builds here.Fixes 0c45e76fcc62 ("drm/xe/vsec: Support BMG devices")Signed-off-by Arnd Bergmann <[email protected]>---
drivers/gpu/drm/xe/Kconfig| 3 ++-1 file changed, 2 insertions(+), 1 deletion(-)drivers/gpu/drm/xe/Kconfig +0
-0@@ -2,6 +2,8 @@config
DRM_XEtristate "Intel Xe Graphics" depends on DRM && PCI && (m || (y && KUNIT=y))
drivers/gpu/drm/xe/Kconfig line 6
Quoted 2 lines
drivers/gpu/drm/xe/Kconfig +2
-0+ depends on INTEL_VSEC || !INTEL_VSEC + depends on INTEL_PLATFORM_DEVICES || !(X86 && ACPI)
^
Did you mean X86_PLATFORM_DEVICES here?
With that, Reviewed-by: Lucas De Marchi <[email protected]>
I see several drivers selectingX86_PLATFORM_DEVICES though. Maybe they should also be translated to dependencies instead?
$ git grep "select X86_PLATFORM_DEVICES" drivers/gpu/drm/amd/amdgpu/Kconfig: select X86_PLATFORM_DEVICES if ACPI && X86 drivers/gpu/drm/gma500/Kconfig: select X86_PLATFORM_DEVICES if ACPI drivers/gpu/drm/i915/Kconfig: select X86_PLATFORM_DEVICES if ACPI drivers/gpu/drm/nouveau/Kconfig: select X86_PLATFORM_DEVICES if ACPI && X86 drivers/gpu/drm/radeon/Kconfig: select X86_PLATFORM_DEVICES if ACPI && X86
thanks
Lucas De Marchi
Quoted 1 line · Lucas De Marchi
On Fri, May 23, 2025 at 02:10:46PM +0200, Arnd Bergmann wrote:
...
Quoted 4 lines
drivers/gpu/drm/xe/Kconfig line 6
Quoted 1 line
drivers/gpu/drm/xe/Kconfig +1
-0+ depends on INTEL_PLATFORM_DEVICES || !(X86 && ACPI)^Did you mean
X86_PLATFORM_DEVICEShere?
Why do we need to depend on the whole thingy (yes, it will be enabled at the end) if we only talking about Intel?
Quoted 5 lines
With that, Reviewed-by: Lucas De Marchi <[email protected]>
I see several drivers selecting
X86_PLATFORM_DEVICESthough. Maybe they should also be translated to dependencies instead?
I think so, selecting that sounds wrong.
Signature · 2 lines
With Best Regards, Andy Shevchenko
Quoted 9 lines · Andy Shevchenko
Quoted 1 line · Lucas De Marchi
On Fri, May 23, 2025 at 02:10:46PM +0200, Arnd Bergmann wrote:
...
Quoted 4 lines
drivers/gpu/drm/xe/Kconfig line 6
Quoted 1 line
drivers/gpu/drm/xe/Kconfig +1
-0+ depends on INTEL_PLATFORM_DEVICES || !(X86 && ACPI)^Did you mean
X86_PLATFORM_DEVICEShere?
Yes, my mistake.
Quoted 2 lines
Why do we need to depend on the whole thingy (yes, it will be enabled at the end) if we only talking about Intel?
I don't understand what you mean with 'the whole thing'. My change changed the existing 'select X86_PLATFORM_DEVICES if X86 && ACPI' into the corresponding dependency, in order to change it the least.
The dependency itself is needed because of
select ACPI_WMI if X86 && ACPI
and this in turn is needed for
select ACPI_VIDEO if X86 && ACPI
Quoted 7 lines
Quoted 5 lines
With that, Reviewed-by: Lucas De Marchi <[email protected]>
I see several drivers selecting
X86_PLATFORM_DEVICESthough. Maybe they should also be translated to dependencies instead?I think so, selecting that sounds wrong.
Agreed. Overall, what I'd really like to see is to remove all those 'select' of drivers from other subsystems. I think ACPI_VIDEO is at the center here, and changing all the 'select ACPI_VIDEO if ACPI' instances to
'depends on ACPI_VIDEO || !ACPI_VIDEO' would solve a lot of the recurring dependency loop problems in drivers/gpu/.
Actually doing it without regressions is going to be nontrivial though, because any change in this area is likely to trigger another dependency loop somewhere.
Arnd
Quoted 13 lines · Arnd Bergmann
Quoted 9 lines · Andy Shevchenko
Quoted 1 line · Lucas De Marchi
On Fri, May 23, 2025 at 02:10:46PM +0200, Arnd Bergmann wrote:
...
Quoted 4 lines
drivers/gpu/drm/xe/Kconfig line 6
Quoted 1 line
drivers/gpu/drm/xe/Kconfig +1
-0+ depends on INTEL_PLATFORM_DEVICES || !(X86 && ACPI)^Did you mean
X86_PLATFORM_DEVICEShere?Yes, my mistake.
Quoted 7 lines
Quoted 2 lines
Why do we need to depend on the whole thingy (yes, it will be enabled at the end) if we only talking about Intel?
I don't understand what you mean with 'the whole thing'. My change changed the existing 'select
X86_PLATFORM_DEVICESif X86 && ACPI' into the corresponding dependency, in order to change it the least.
It used to be (for only one or two releases) X86_PLATFORM_DRIVERS_INTEL, but it doesn't look closer to the mistake above, which I was thinking of. So, Lucas is right.
Quoted 10 lines
The dependency itself is needed because of
select ACPI_WMI if X86 && ACPIand this in turn is needed for
select ACPI_VIDEO if X86 && ACPIQuoted 2 lines
Quoted 2 lines
With that, Reviewed-by: Lucas De Marchi <[email protected]>
Quoted 8 lines
Quoted 5 lines
Quoted 3 lines
I see several drivers selecting
X86_PLATFORM_DEVICESthough. Maybe they should also be translated to dependencies instead?I think so, selecting that sounds wrong.
Agreed. Overall, what I'd really like to see is to remove all those 'select' of drivers from other subsystems.
Let's start from some low-hanging fruits?
Quoted 9 lines
I think
ACPI_VIDEOis at the center here, and changing all the 'selectACPI_VIDEOif ACPI' instances to
'depends onACPI_VIDEO|| !ACPI_VIDEO' would solve a lot of the recurring dependency loop problems indrivers/gpu/.Actually doing it without regressions is going to be nontrivial though, because any change in this area is likely to trigger another dependency loop somewhere.
True and I agree this requires more comprehensive testing.
Signature · 2 lines
With Best Regards, Andy Shevchenko
Quoted 35 lines · Arnd Bergmann
Quoted 9 lines · Andy Shevchenko
Quoted 1 line · Lucas De Marchi
On Fri, May 23, 2025 at 02:10:46PM +0200, Arnd Bergmann wrote:
...
Quoted 4 lines
drivers/gpu/drm/xe/Kconfig line 6
Quoted 1 line
drivers/gpu/drm/xe/Kconfig +1
-0+ depends on INTEL_PLATFORM_DEVICES || !(X86 && ACPI)^Did you mean
X86_PLATFORM_DEVICEShere?Yes, my mistake.
Quoted 2 lines
Why do we need to depend on the whole thingy (yes, it will be enabled at the end) if we only talking about Intel?
I don't understand what you mean with 'the whole thing'. My change changed the existing 'select
X86_PLATFORM_DEVICESif X86 && ACPI' into the corresponding dependency, in order to change it the least.The dependency itself is needed because of
select ACPI_WMI if X86 && ACPIand this in turn is needed for
select ACPI_VIDEO if X86 && ACPIQuoted 6 lines
Quoted 5 lines
With that, Reviewed-by: Lucas De Marchi <[email protected]>
I see several drivers selecting
X86_PLATFORM_DEVICESthough. Maybe they should also be translated to dependencies instead?
Quoted 7 lines
Quoted 1 line
I think so, selecting that sounds wrong.
Agreed. Overall, what I'd really like to see is to remove all those 'select' of drivers from other subsystems. I think
ACPI_VIDEOis at the center here, and changing all the 'selectACPI_VIDEOif ACPI' instances to
'depends onACPI_VIDEO|| !ACPI_VIDEO' would solve a lot of
Maybe you meant 'depends on ACPI_VIDEO || !ACPI' ?
Quoted 7 lines
the recurring dependency loop problems in
drivers/gpu/.Actually doing it without regressions is going to be nontrivial though, because any change in this area is likely to trigger another dependency loop somewhere.
Arnd
Quoted 4 lines · Christopher Snowhill
Quoted 3 lines · Arnd Bergmann
Quoted 2 lines · Andy Shevchenko
Quoted 1 line · Lucas De Marchi
On Fri, May 23, 2025 at 02:10:46PM +0200, Arnd Bergmann wrote:
...
Quoted 5 lines
Quoted 3 lines
I think
ACPI_VIDEOis at the center here, and changing all the 'selectACPI_VIDEOif ACPI' instances to
'depends onACPI_VIDEO|| !ACPI_VIDEO' would solve a lot ofMaybe you meant 'depends on
ACPI_VIDEO|| !ACPI' ?
I believe not. The depends on FOO || FOO=n is idiomatic in Kconfig.
Quoted 5 lines
Quoted 5 lines
the recurring dependency loop problems in
drivers/gpu/.Actually doing it without regressions is going to be nontrivial though, because any change in this area is likely to trigger another dependency loop somewhere.
Signature · 2 lines
With Best Regards, Andy Shevchenko
Quoted 11 lines · Andy Shevchenko
Quoted 8 lines · Christopher Snowhill
Quoted 5 lines · Arnd Bergmann
Quoted 1 line · Andy Shevchenko
On Tue, May 27, 2025 at 03:55:46PM -0500, Lucas De Marchi wrote:
I think
ACPI_VIDEOis at the center here, and changing all the 'selectACPI_VIDEOif ACPI' instances to
'depends onACPI_VIDEO|| !ACPI_VIDEO' would solve a lot ofMaybe you meant 'depends on
ACPI_VIDEO|| !ACPI' ?I believe not. The depends on FOO || FOO=n is idiomatic in
Kconfig.
It depends on what we want here. 'ACPI_VIDEO || !ACPI' would be the direct equivalent of the existing 'select ACPI_VIDEO if ACPI', while 'ACPI_VIDEO || !ACPI_VIDEO' would allow building with ACPI=y and ACPI_VIDEO=n, which is not possible today. I'd probably start with the version that Christopher suggested to have a lower regression risk.
Arnd