drm: Fix randconfig link failures
Subsystems (5)
cover drm: Fix randconfig link failures
Hi,
While tracking down spurious "orphan section" warnings on arm and arm64, I needed to fix several other issues that it seems other folks have tripped over before.
Here's the series that fixed everything for me...
-Kees
Arnd Bergmann (1):
drm/msm/a6xx: add CONFIG_QCOM_LLCC dependency
Kees Cook (2):
drm: Avoid circular dependencies for CONFIG_FB
drm/pl111: depend on CONFIG_VEXPRESS_CONFIG
drivers/gpu/drm/Kconfig | 2 +- drivers/gpu/drm/msm/Kconfig | 3 ++- drivers/gpu/drm/pl111/Kconfig | 2 +- 3 files changed, 4 insertions(+), 3 deletions(-)
Signature · 1 line
2.25.1
PATCH 1/3 drm: Avoid circular dependencies for CONFIG_FB
When cleaning up other drm config dependencies, it is too easy to create larger problems. Instead, mark CONFIG_FB as a "depends":
drivers/gpu/drm/Kconfig:74:error: recursive dependency detected!
--- drivers/gpu/drm/Kconfig | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/gpu/drm/Kconfig +1 -1
@@ -83,7 +83,7 @@ config DRM_KMS_HELPER config DRM_KMS_FB_HELPER bool depends on DRM_KMS_HELPER - select FB + depends on FB select FRAMEBUFFER_CONSOLE if !EXPERT select FRAMEBUFFER_CONSOLE_DETECT_PRIMARY if FRAMEBUFFER_CONSOLE select FB_SYS_FOPS
Signature · 1 line
2.25.1
Re: [PATCH 1/3] drm: Avoid circular dependencies for CONFIG_FB
Quoted 8 lines · Kees Cook
When cleaning up other drm config dependencies, it is too easy to create larger problems. Instead, mark
CONFIG_FBas a "depends":drivers/gpu/drm/Kconfig:74:error: recursive dependency detected!
I rebased this one for -next and applied all three patches to drm-misc-next.
-Daniel
Quoted 20 lines
--- drivers/gpu/drm/Kconfig | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)drivers/gpu/drm/Kconfig +1
-1@@ -83,7 +83,7 @@ config DRM_KMS_HELPER config DRM_KMS_FB_HELPER bool depends on DRM_KMS_HELPER - select FB + depends on FB select FRAMEBUFFER_CONSOLE if !EXPERT select FRAMEBUFFER_CONSOLE_DETECT_PRIMARY if FRAMEBUFFER_CONSOLE select FB_SYS_FOPSSignature · 1 line
2.25.1
Signature · 3 lines
Daniel Vetter Software Engineer, Intel Corporation http://blog.ffwll.ch
Re: [PATCH 1/3] drm: Avoid circular dependencies for CONFIG_FB
Quoted 5 lines · Daniel Vetter
Quoted 3 lines · Kees Cook
When cleaning up other drm config dependencies, it is too easy to create larger problems. Instead, mark
CONFIG_FBas a "depends":
Quoted 8 lines
Quoted 5 lines
drivers/gpu/drm/Kconfig:74:error: recursive dependency detected!
I rebased this one for -next and applied all three patches to drm-misc-next.
Patch 3 is not the right fix and I think breaks some platforms.
Rob
PATCH 2/3 drm/msm/a6xx: add CONFIG_QCOM_LLCC dependency
In reply to Kees CookFrom: Arnd Bergmann <[email protected]>
When LLCC support is in a loadable module, the adreno support cannot be built-in:
aarch64-linux-ld: drivers/gpu/drm/msm/adreno/a6xx_gpu.o: in function `a6xx_gpu_init':
a6xx_gpu.c:(.text+0xe0): undefined reference to `llcc_slice_getd'
a6xx_gpu.c:(.text+0xe0): relocation truncated to fit: R_AARCH64_CALL26 against undefined symbol `llcc_slice_getd'
aarch64-linux-ld: a6xx_gpu.c:(.text+0xec): undefined reference to llcc_slice_getd' a6xx_gpu.c:(.text+0xec): relocation truncated to fit: R_AARCH64_CALL26 against undefined symbol llcc_slice_getd'
aarch64-linux-ld: drivers/gpu/drm/msm/adreno/a6xx_gpu.o: in function `a6xx_destroy':
a6xx_gpu.c:(.text+0x274): undefined reference to `llcc_slice_putd'
a6xx_gpu.c:(.text+0x274): relocation truncated to fit: R_AARCH64_CALL26 against undefined symbol `llcc_slice_putd'
aarch64-linux-ld: a6xx_gpu.c:(.text+0x27c): undefined reference to `llcc_slice_putd'
Add a Kconfig dependency that disallows the broken configuration but allows all working ones.
--- drivers/gpu/drm/msm/Kconfig | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
drivers/gpu/drm/msm/Kconfig +2 -1
@@ -7,6 +7,8 @@ config DRM_MSM depends on IOMMU_SUPPORT depends on OF && COMMON_CLK depends on QCOM_OCMEM || QCOM_OCMEM=n + depends on QCOM_LLCC || QCOM_LLCC=n + depends on QCOM_COMMAND_DB || QCOM_COMMAND_DB=n select IOMMU_IO_PGTABLE select QCOM_MDT_LOADER if ARCH_QCOM select REGULATOR
@@ -15,7 +17,6 @@ config DRM_MSM select SHMEM select TMPFS select QCOM_SCM if ARCH_QCOM - select QCOM_COMMAND_DB if ARCH_QCOM select WANT_DEV_COREDUMP select SND_SOC_HDMI_CODEC if SND_SOC select SYNC_FILE
Signature · 1 line
2.25.1
PATCH 3/3 drm/pl111: depend on CONFIG_VEXPRESS_CONFIG
In reply to Kees CookAvoid randconfig build failures by requiring VEXPRESS_CONFIG:
aarch64-linux-gnu-ld: drivers/gpu/drm/pl111/pl111_versatile.o: in function `pl111_vexpress_clcd_init':
pl111_versatile.c:(.text+0x220): undefined reference to `devm_regmap_init_vexpress_config'
--- drivers/gpu/drm/pl111/Kconfig | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/gpu/drm/pl111/Kconfig +1 -1
@@ -2,7 +2,7 @@ config DRM_PL111 tristate "DRM Support for PL111 CLCD Controller" depends on DRM - depends on ARM || ARM64 || COMPILE_TEST + depends on VEXPRESS_CONFIG depends on COMMON_CLK select DRM_KMS_HELPER select DRM_KMS_CMA_HELPER
Signature · 1 line
2.25.1
Re: [PATCH 3/3] drm/pl111: depend on CONFIG_VEXPRESS_CONFIG
Quoted 5 lines · Kees Cook
Avoid randconfig build failures by requiring
VEXPRESS_CONFIG:aarch64-linux-gnu-ld:
drivers/gpu/drm/pl111/pl111_versatile.o: in function `pl111_vexpress_clcd_init':
pl111_versatile.c:(.text+0x220): undefined reference to `devm_regmap_init_vexpress_config'
pl111_vexpress_clcd_init() starts with:
if (!IS_ENABLED(CONFIG_VEXPRESS_CONFIG))
return -ENODEV;
Isn't that supposed to be enough to avoid an undefined reference?
Making the whole file depend on VEXPRESS_CONFIG is not right either. Not all platforms need it.
Quoted 23 lines
Fixes 826fc86b5903 ("drm: pl111: Move VExpress setup into versatile init")Signed-off-by Kees Cook <[email protected]>--- drivers/gpu/drm/pl111/Kconfig | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)drivers/gpu/drm/pl111/Kconfig +1
-2@@ -2,7 +2,7 @@ config DRM_PL111 tristate "DRM Support for PL111 CLCD Controller" depends on DRM - depends on ARM || ARM64 || COMPILE_TEST + depends on VEXPRESS_CONFIG depends on COMMON_CLK select DRM_KMS_HELPER select DRM_KMS_CMA_HELPER --2.25.1
Re: [PATCH 3/3] drm/pl111: depend on CONFIG_VEXPRESS_CONFIG
Quoted 10 lines · Rob Herring
Quoted 5 lines · Kees Cook
Avoid randconfig build failures by requiring
VEXPRESS_CONFIG:aarch64-linux-gnu-ld:
drivers/gpu/drm/pl111/pl111_versatile.o: in function `pl111_vexpress_clcd_init':
pl111_versatile.c:(.text+0x220): undefined reference to `devm_regmap_init_vexpress_config'
pl111_vexpress_clcd_init()starts with:
Quoted 7 lines
if (!IS_ENABLED(CONFIG_VEXPRESS_CONFIG))
return -ENODEV;Isn't that supposed to be enough to avoid an undefined reference?
Making the whole file depend on
VEXPRESS_CONFIGis not right either. Not all platforms need it.
It needs a compile-time status inline then for the functions we're using in pl111.
-Daniel
Quoted 24 lines
Quoted 24 lines
Fixes 826fc86b5903 ("drm: pl111: Move VExpress setup into versatile init")Signed-off-by Kees Cook <[email protected]>--- drivers/gpu/drm/pl111/Kconfig | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)drivers/gpu/drm/pl111/Kconfig +1
-2@@ -2,7 +2,7 @@ config DRM_PL111 tristate "DRM Support for PL111 CLCD Controller" depends on DRM - depends on ARM || ARM64 || COMPILE_TEST + depends on VEXPRESS_CONFIG depends on COMMON_CLK select DRM_KMS_HELPER select DRM_KMS_CMA_HELPER --2.25.1
Signature · 3 lines
Daniel Vetter Software Engineer, Intel Corporation http://blog.ffwll.ch
Re: [PATCH 3/3] drm/pl111: depend on CONFIG_VEXPRESS_CONFIG
Quoted 9 lines · Daniel Vetter
Quoted 8 lines · Rob Herring
Quoted 5 lines · Kees Cook
Avoid randconfig build failures by requiring
VEXPRESS_CONFIG:aarch64-linux-gnu-ld:
drivers/gpu/drm/pl111/pl111_versatile.o: in function `pl111_vexpress_clcd_init':
pl111_versatile.c:(.text+0x220): undefined reference to `devm_regmap_init_vexpress_config'
Quoted 6 lines
Quoted 6 lines
pl111_vexpress_clcd_init()starts with:if (!IS_ENABLED(CONFIG_VEXPRESS_CONFIG))
return -ENODEV;Isn't that supposed to be enough to avoid an undefined reference?
Ah! I missed that when reading the code. I see the problem now. It's because of:
CONFIG_VEXPRESS_CONFIG=mCONFIG_DRM_PL111=y
I think the right fix is:
drivers/gpu/drm/pl111/Kconfig +1 -0
@@ -3,6 +3,7 @@ config DRM_PL111 tristate "DRM Support for PL111 CLCD Controller" depends on DRM depends on ARM || ARM64 || COMPILE_TEST + depends on VEXPRESS_CONFIG=y || VEXPRESS_CONFIG=DRM depends on COMMON_CLK select DRM_KMS_HELPER select DRM_KMS_CMA_HELPER
I will go check the defconfigs Rob mentioned...
Quoted 5 lines
Quoted 2 lines
Making the whole file depend on
VEXPRESS_CONFIGis not right either. Not all platforms need it.It needs a compile-time status inline then for the functions we're using in pl111.
FYI, this is the config I was working from, which was throwing link errors:
https://lore.kernel.org/lkml/[email protected]/
Quoted 33 lines
-Daniel
Quoted 24 lines
Quoted 24 lines
Fixes 826fc86b5903 ("drm: pl111: Move VExpress setup into versatile init")Signed-off-by Kees Cook <[email protected]>--- drivers/gpu/drm/pl111/Kconfig | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)drivers/gpu/drm/pl111/Kconfig +1
-2@@ -2,7 +2,7 @@ config DRM_PL111 tristate "DRM Support for PL111 CLCD Controller" depends on DRM - depends on ARM || ARM64 || COMPILE_TEST + depends on VEXPRESS_CONFIG depends on COMMON_CLK select DRM_KMS_HELPER select DRM_KMS_CMA_HELPER --2.25.1
Signature · 3 lines
Daniel Vetter Software Engineer, Intel Corporation http://blog.ffwll.ch
Signature · 1 line
Kees Cook
Re: [PATCH 3/3] drm/pl111: depend on CONFIG_VEXPRESS_CONFIG
Quoted 30 lines · Kees Cook
Quoted 9 lines · Daniel Vetter
Quoted 8 lines · Rob Herring
Quoted 5 lines · Kees Cook
Avoid randconfig build failures by requiring
VEXPRESS_CONFIG:aarch64-linux-gnu-ld:
drivers/gpu/drm/pl111/pl111_versatile.o: in function `pl111_vexpress_clcd_init':
pl111_versatile.c:(.text+0x220): undefined reference to `devm_regmap_init_vexpress_config'Quoted 6 lines
Quoted 6 lines
pl111_vexpress_clcd_init()starts with:if (!IS_ENABLED(CONFIG_VEXPRESS_CONFIG))
return -ENODEV;Isn't that supposed to be enough to avoid an undefined reference?
Ah! I missed that when reading the code. I see the problem now. It's because of:
CONFIG_VEXPRESS_CONFIG=mCONFIG_DRM_PL111=yI think the right fix is:
drivers/gpu/drm/pl111/Kconfig +0
-0
drivers/gpu/drm/pl111/Kconfig config DRM_PL111 · line 6
Quoted 4 lines
drivers/gpu/drm/pl111/Kconfig +1
-0@@ -3,6 +3,7 @@ config DRM_PL111 tristate "DRM Support for PL111 CLCD Controller" depends on DRM depends on ARM || ARM64 || COMPILE_TEST + depends on VEXPRESS_CONFIG=y || VEXPRESS_CONFIG=DRM
Oops, no, I had this backwairds:
depends on !VEXPRESS_CONFIG || VEXPRESS_CONFIG=DRM
_that_ lets me build with:
# CONFIG_VEXPRESS_CONFIG is not setCONFIG_DRM_PL111=y
CONFIG_VEXPRESS_CONFIG=yCONFIG_DRM_PL111=y
CONFIG_VEXPRESS_CONFIG=mCONFIG_DRM_PL111=m
CONFIG_VEXPRESS_CONFIG=yCONFIG_DRM_PL111=m
and disallows:
CONFIG_VEXPRESS_CONFIG=mCONFIG_DRM_PL111=y
(this will force CONFIG_DRM_PL111=m)
-Kees
Quoted 51 lines
drivers/gpu/drm/pl111/Kconfig +0
-0depends on COMMON_CLK select DRM_KMS_HELPER select DRM_KMS_CMA_HELPERI will go check the defconfigs Rob mentioned...
Quoted 5 lines
Quoted 2 lines
Making the whole file depend on
VEXPRESS_CONFIGis not right either. Not all platforms need it.It needs a compile-time status inline then for the functions we're using in pl111.
FYI, this is the config I was working from, which was throwing link errors:
https://lore.kernel.org/lkml/[email protected]/Quoted 33 lines
-Daniel
Quoted 24 lines
Quoted 24 lines
Fixes 826fc86b5903 ("drm: pl111: Move VExpress setup into versatile init")Signed-off-by Kees Cook <[email protected]>--- drivers/gpu/drm/pl111/Kconfig | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)drivers/gpu/drm/pl111/Kconfig +1
-2@@ -2,7 +2,7 @@ config DRM_PL111 tristate "DRM Support for PL111 CLCD Controller" depends on DRM - depends on ARM || ARM64 || COMPILE_TEST + depends on VEXPRESS_CONFIG depends on COMMON_CLK select DRM_KMS_HELPER select DRM_KMS_CMA_HELPER --2.25.1
Signature · 3 lines
Daniel Vetter Software Engineer, Intel Corporation http://blog.ffwll.chSignature · 1 line
Kees Cook
Signature · 1 line
Kees Cook
Re: [PATCH 3/3] drm/pl111: depend on CONFIG_VEXPRESS_CONFIG
Quoted 39 lines · Kees Cook
Quoted 30 lines · Kees Cook
Quoted 9 lines · Daniel Vetter
Quoted 8 lines · Rob Herring
Quoted 5 lines · Kees Cook
Avoid randconfig build failures by requiring
VEXPRESS_CONFIG:aarch64-linux-gnu-ld:
drivers/gpu/drm/pl111/pl111_versatile.o: in function `pl111_vexpress_clcd_init':
pl111_versatile.c:(.text+0x220): undefined reference to `devm_regmap_init_vexpress_config'Quoted 6 lines
Quoted 6 lines
pl111_vexpress_clcd_init()starts with:if (!IS_ENABLED(CONFIG_VEXPRESS_CONFIG))
return -ENODEV;Isn't that supposed to be enough to avoid an undefined reference?
Ah! I missed that when reading the code. I see the problem now. It's because of:
CONFIG_VEXPRESS_CONFIG=mCONFIG_DRM_PL111=yI think the right fix is:
drivers/gpu/drm/pl111/Kconfig +0
-0drivers/gpu/drm/pl111/Kconfig config DRM_PL111 · line 6
Quoted 4 lines
drivers/gpu/drm/pl111/Kconfig +1
-0@@ -3,6 +3,7 @@ config DRM_PL111 tristate "DRM Support for PL111 CLCD Controller" depends on DRM depends on ARM || ARM64 || COMPILE_TEST + depends on VEXPRESS_CONFIG=y || VEXPRESS_CONFIG=DRMOops, no, I had this backwairds:
Quoted 1 line
depends on !VEXPRESS_CONFIG || VEXPRESS_CONFIG=DRM
Can you pls throw this into an incremental patch on top of drm-misc-next? It's a non-rebasing tree and all that (linux-next should have it next day too I guess).
Thanks, Daniel
Quoted 77 lines
_that_ lets me build with:
#
CONFIG_VEXPRESS_CONFIGis not setCONFIG_DRM_PL111=y
CONFIG_VEXPRESS_CONFIG=yCONFIG_DRM_PL111=y
CONFIG_VEXPRESS_CONFIG=mCONFIG_DRM_PL111=m
CONFIG_VEXPRESS_CONFIG=yCONFIG_DRM_PL111=mand disallows:
CONFIG_VEXPRESS_CONFIG=mCONFIG_DRM_PL111=y(this will force
CONFIG_DRM_PL111=m)-Kees
Quoted 49 lines
drivers/gpu/drm/pl111/Kconfig +0
-0depends on COMMON_CLK select DRM_KMS_HELPER select DRM_KMS_CMA_HELPERI will go check the defconfigs Rob mentioned...
Quoted 5 lines
Quoted 2 lines
Making the whole file depend on
VEXPRESS_CONFIGis not right either. Not all platforms need it.It needs a compile-time status inline then for the functions we're using in pl111.
FYI, this is the config I was working from, which was throwing link errors:
https://lore.kernel.org/lkml/[email protected]/Quoted 25 lines
-Daniel
Quoted 23 lines
Quoted 23 lines
Fixes 826fc86b5903 ("drm: pl111: Move VExpress setup into versatile init")Signed-off-by Kees Cook <[email protected]>--- drivers/gpu/drm/pl111/Kconfig | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)drivers/gpu/drm/pl111/Kconfig +1
-2@@ -2,7 +2,7 @@ config DRM_PL111 tristate "DRM Support for PL111 CLCD Controller" depends on DRM - depends on ARM || ARM64 || COMPILE_TEST + depends on VEXPRESS_CONFIG depends on COMMON_CLK select DRM_KMS_HELPER select DRM_KMS_CMA_HELPER --2.25.1
Quoted 8 lines
Quoted 1 line
Quoted 1 line
--
Daniel Vetter
Software Engineer, Intel Corporation
http://blog.ffwll.chQuoted 2 lines
--
Kees Cook--
Kees Cook
Signature · 3 lines
Daniel Vetter Software Engineer, Intel Corporation http://blog.ffwll.ch
Re: [PATCH 3/3] drm/pl111: depend on CONFIG_VEXPRESS_CONFIG
Quoted 40 lines · Daniel Vetter
Quoted 39 lines · Kees Cook
Quoted 30 lines · Kees Cook
Quoted 9 lines · Daniel Vetter
Quoted 8 lines · Rob Herring
Quoted 5 lines · Kees Cook
Avoid randconfig build failures by requiring
VEXPRESS_CONFIG:aarch64-linux-gnu-ld:
drivers/gpu/drm/pl111/pl111_versatile.o: in function `pl111_vexpress_clcd_init':
pl111_versatile.c:(.text+0x220): undefined reference to `devm_regmap_init_vexpress_config'Quoted 6 lines
Quoted 6 lines
pl111_vexpress_clcd_init()starts with:if (!IS_ENABLED(CONFIG_VEXPRESS_CONFIG))
return -ENODEV;Isn't that supposed to be enough to avoid an undefined reference?
Ah! I missed that when reading the code. I see the problem now. It's because of:
CONFIG_VEXPRESS_CONFIG=mCONFIG_DRM_PL111=yI think the right fix is:
drivers/gpu/drm/pl111/Kconfig +0
-0drivers/gpu/drm/pl111/Kconfig config DRM_PL111 · line 6
Quoted 4 lines
drivers/gpu/drm/pl111/Kconfig +1
-0@@ -3,6 +3,7 @@ config DRM_PL111 tristate "DRM Support for PL111 CLCD Controller" depends on DRM depends on ARM || ARM64 || COMPILE_TEST + depends on VEXPRESS_CONFIG=y || VEXPRESS_CONFIG=DRMOops, no, I had this backwairds:
Quoted 5 lines
Quoted 1 line
depends on !VEXPRESS_CONFIG || VEXPRESS_CONFIG=DRMCan you pls throw this into an incremental patch on top of drm-misc-next? It's a non-rebasing tree and all that (linux-next should have it next day too I guess).
Ah! Yes, sorry. I wasn't sure if you'd reverted it yet. One moment...
-Kees
Signature · 1 line
Kees Cook
Re: [PATCH 3/3] drm/pl111: depend on CONFIG_VEXPRESS_CONFIG
In reply to Rob HerringQuoted 10 lines · Rob Herring
Quoted 5 lines · Kees Cook
Avoid randconfig build failures by requiring
VEXPRESS_CONFIG:aarch64-linux-gnu-ld:
drivers/gpu/drm/pl111/pl111_versatile.o: in function `pl111_vexpress_clcd_init':
pl111_versatile.c:(.text+0x220): undefined reference to `devm_regmap_init_vexpress_config'
pl111_vexpress_clcd_init()starts with:
Quoted 7 lines
if (!IS_ENABLED(CONFIG_VEXPRESS_CONFIG))
return -ENODEV;Isn't that supposed to be enough to avoid an undefined reference?
Making the whole file depend on
VEXPRESS_CONFIGis not right either. Not all platforms need it.
Specifically, these defconfigs will break as they all use PL111 but don't need nor enable VEXPRESS_CONFIG:
arch/arm/configs/integrator_defconfig:CONFIG_DRM_PL111=y arch/arm/configs/lpc18xx_defconfig:CONFIG_DRM_PL111=y arch/arm/configs/lpc32xx_defconfig:CONFIG_DRM_PL111=y arch/arm/configs/nhk8815_defconfig:CONFIG_DRM_PL111=y arch/arm/configs/realview_defconfig:CONFIG_DRM_PL111=y arch/arm/configs/spear3xx_defconfig:CONFIG_DRM_PL111=y arch/arm/configs/versatile_defconfig:CONFIG_DRM_PL111=y
These defconfigs should all be failing with the same error, but don't from what I've tried nor have I seen any kernelci failures.
Rob