All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 0/3] drm: Fix randconfig link failures
@ 2021-06-02 21:52 ` Kees Cook
  0 siblings, 0 replies; 26+ messages in thread
From: Kees Cook @ 2021-06-02 21:52 UTC (permalink / raw)
  To: Dave Airlie
  Cc: Kees Cook, Maarten Lankhorst, Maxime Ripard, Thomas Zimmermann,
	David Airlie, Daniel Vetter, Arnd Bergmann, kernel test robot,
	Sai Prakash Ranjan, Emma Anholt, Rob Clark, Sean Paul,
	Sharat Masetty, Rob Herring, Linus Walleij, Sam Ravnborg,
	linux-kernel, dri-devel, linux-arm-msm, freedreno

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

-- 
2.25.1


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

* [PATCH 0/3] drm: Fix randconfig link failures
@ 2021-06-02 21:52 ` Kees Cook
  0 siblings, 0 replies; 26+ messages in thread
From: Kees Cook @ 2021-06-02 21:52 UTC (permalink / raw)
  To: Dave Airlie
  Cc: Arnd Bergmann, Sai Prakash Ranjan, Emma Anholt, David Airlie,
	Sam Ravnborg, Sharat Masetty, linux-kernel, kernel test robot,
	dri-devel, Thomas Zimmermann, linux-arm-msm, freedreno,
	Sean Paul, Kees Cook

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

-- 
2.25.1


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

* [PATCH 1/3] drm: Avoid circular dependencies for CONFIG_FB
  2021-06-02 21:52 ` Kees Cook
@ 2021-06-02 21:52   ` Kees Cook
  -1 siblings, 0 replies; 26+ messages in thread
From: Kees Cook @ 2021-06-02 21:52 UTC (permalink / raw)
  To: Dave Airlie
  Cc: Kees Cook, Arnd Bergmann, Maarten Lankhorst, Maxime Ripard,
	Thomas Zimmermann, David Airlie, Daniel Vetter,
	kernel test robot, Sai Prakash Ranjan, Emma Anholt, Rob Clark,
	Sean Paul, Sharat Masetty, Rob Herring, Linus Walleij,
	Sam Ravnborg, linux-kernel, dri-devel, linux-arm-msm, freedreno

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!

Suggested-by: Arnd Bergmann <arnd@kernel.org>
Link: https://lore.kernel.org/lkml/CAK8P3a3jUQs6c5tESSNMbqfuymewj9FhqRizyHcfOXf8Rgy-nA@mail.gmail.com/
Signed-off-by: Kees Cook <keescook@chromium.org>
---
 drivers/gpu/drm/Kconfig | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/Kconfig b/drivers/gpu/drm/Kconfig
index 3c16bd1afd87..90891284ccec 100644
--- a/drivers/gpu/drm/Kconfig
+++ b/drivers/gpu/drm/Kconfig
@@ -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
-- 
2.25.1


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

* [PATCH 1/3] drm: Avoid circular dependencies for CONFIG_FB
@ 2021-06-02 21:52   ` Kees Cook
  0 siblings, 0 replies; 26+ messages in thread
From: Kees Cook @ 2021-06-02 21:52 UTC (permalink / raw)
  To: Dave Airlie
  Cc: Arnd Bergmann, Sai Prakash Ranjan, Kees Cook, Emma Anholt,
	David Airlie, Sam Ravnborg, Sharat Masetty, linux-kernel,
	dri-devel, Thomas Zimmermann, linux-arm-msm, freedreno,
	Sean Paul, kernel test robot

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!

Suggested-by: Arnd Bergmann <arnd@kernel.org>
Link: https://lore.kernel.org/lkml/CAK8P3a3jUQs6c5tESSNMbqfuymewj9FhqRizyHcfOXf8Rgy-nA@mail.gmail.com/
Signed-off-by: Kees Cook <keescook@chromium.org>
---
 drivers/gpu/drm/Kconfig | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/Kconfig b/drivers/gpu/drm/Kconfig
index 3c16bd1afd87..90891284ccec 100644
--- a/drivers/gpu/drm/Kconfig
+++ b/drivers/gpu/drm/Kconfig
@@ -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
-- 
2.25.1


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

* [PATCH 2/3] drm/msm/a6xx: add CONFIG_QCOM_LLCC dependency
  2021-06-02 21:52 ` Kees Cook
@ 2021-06-02 21:52   ` Kees Cook
  -1 siblings, 0 replies; 26+ messages in thread
From: Kees Cook @ 2021-06-02 21:52 UTC (permalink / raw)
  To: Dave Airlie
  Cc: Kees Cook, Arnd Bergmann, kernel test robot, Sai Prakash Ranjan,
	Maarten Lankhorst, Maxime Ripard, Thomas Zimmermann,
	David Airlie, Daniel Vetter, Arnd Bergmann, Emma Anholt,
	Rob Clark, Sean Paul, Sharat Masetty, Rob Herring, Linus Walleij,
	Sam Ravnborg, linux-kernel, dri-devel, linux-arm-msm, freedreno

From: Arnd Bergmann <arnd@arndb.de>

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.

Fixes: 474dadb8b0d5 ("drm/msm/a6xx: Add support for using system cache(LLC)")
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Reported-by: kernel test robot <lkp@intel.com>
Reviewed-by: Sai Prakash Ranjan <saiprakash.ranjan@codeaurora.org>
Signed-off-by: Kees Cook <keescook@chromium.org>
Link: https://lore.kernel.org/r/20210103140407.3917405-1-arnd@kernel.org
---
 drivers/gpu/drm/msm/Kconfig | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/msm/Kconfig b/drivers/gpu/drm/msm/Kconfig
index 10f693ea89d3..52536e7adb95 100644
--- a/drivers/gpu/drm/msm/Kconfig
+++ b/drivers/gpu/drm/msm/Kconfig
@@ -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
-- 
2.25.1


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

* [PATCH 2/3] drm/msm/a6xx: add CONFIG_QCOM_LLCC dependency
@ 2021-06-02 21:52   ` Kees Cook
  0 siblings, 0 replies; 26+ messages in thread
From: Kees Cook @ 2021-06-02 21:52 UTC (permalink / raw)
  To: Dave Airlie
  Cc: Arnd Bergmann, Sai Prakash Ranjan, Kees Cook, Arnd Bergmann,
	Emma Anholt, David Airlie, Sam Ravnborg, Sharat Masetty,
	linux-kernel, dri-devel, Thomas Zimmermann, linux-arm-msm,
	freedreno, Sean Paul, kernel test robot

From: Arnd Bergmann <arnd@arndb.de>

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.

Fixes: 474dadb8b0d5 ("drm/msm/a6xx: Add support for using system cache(LLC)")
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Reported-by: kernel test robot <lkp@intel.com>
Reviewed-by: Sai Prakash Ranjan <saiprakash.ranjan@codeaurora.org>
Signed-off-by: Kees Cook <keescook@chromium.org>
Link: https://lore.kernel.org/r/20210103140407.3917405-1-arnd@kernel.org
---
 drivers/gpu/drm/msm/Kconfig | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/msm/Kconfig b/drivers/gpu/drm/msm/Kconfig
index 10f693ea89d3..52536e7adb95 100644
--- a/drivers/gpu/drm/msm/Kconfig
+++ b/drivers/gpu/drm/msm/Kconfig
@@ -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
-- 
2.25.1


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

* [PATCH 3/3] drm/pl111: depend on CONFIG_VEXPRESS_CONFIG
  2021-06-02 21:52 ` Kees Cook
@ 2021-06-02 21:52   ` Kees Cook
  -1 siblings, 0 replies; 26+ messages in thread
From: Kees Cook @ 2021-06-02 21:52 UTC (permalink / raw)
  To: Dave Airlie
  Cc: Kees Cook, Maarten Lankhorst, Maxime Ripard, Thomas Zimmermann,
	David Airlie, Daniel Vetter, Arnd Bergmann, kernel test robot,
	Sai Prakash Ranjan, Emma Anholt, Rob Clark, Sean Paul,
	Sharat Masetty, Rob Herring, Linus Walleij, Sam Ravnborg,
	linux-kernel, dri-devel, linux-arm-msm, freedreno

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'

Fixes: 826fc86b5903 ("drm: pl111: Move VExpress setup into versatile init")
Signed-off-by: Kees Cook <keescook@chromium.org>
---
 drivers/gpu/drm/pl111/Kconfig | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/pl111/Kconfig b/drivers/gpu/drm/pl111/Kconfig
index 80f6748055e3..c5210a5bef1b 100644
--- a/drivers/gpu/drm/pl111/Kconfig
+++ b/drivers/gpu/drm/pl111/Kconfig
@@ -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


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

* [PATCH 3/3] drm/pl111: depend on CONFIG_VEXPRESS_CONFIG
@ 2021-06-02 21:52   ` Kees Cook
  0 siblings, 0 replies; 26+ messages in thread
From: Kees Cook @ 2021-06-02 21:52 UTC (permalink / raw)
  To: Dave Airlie
  Cc: Arnd Bergmann, Sai Prakash Ranjan, Emma Anholt, David Airlie,
	Sam Ravnborg, Sharat Masetty, linux-kernel, kernel test robot,
	dri-devel, Thomas Zimmermann, linux-arm-msm, freedreno,
	Sean Paul, 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'

Fixes: 826fc86b5903 ("drm: pl111: Move VExpress setup into versatile init")
Signed-off-by: Kees Cook <keescook@chromium.org>
---
 drivers/gpu/drm/pl111/Kconfig | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/pl111/Kconfig b/drivers/gpu/drm/pl111/Kconfig
index 80f6748055e3..c5210a5bef1b 100644
--- a/drivers/gpu/drm/pl111/Kconfig
+++ b/drivers/gpu/drm/pl111/Kconfig
@@ -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


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

* Re: [PATCH 1/3] drm: Avoid circular dependencies for CONFIG_FB
  2021-06-02 21:52   ` Kees Cook
@ 2021-06-03  8:48     ` Daniel Vetter
  -1 siblings, 0 replies; 26+ messages in thread
From: Daniel Vetter @ 2021-06-03  8:48 UTC (permalink / raw)
  To: Kees Cook
  Cc: Dave Airlie, Arnd Bergmann, Maarten Lankhorst, Maxime Ripard,
	Thomas Zimmermann, David Airlie, Daniel Vetter,
	kernel test robot, Sai Prakash Ranjan, Emma Anholt, Rob Clark,
	Sean Paul, Sharat Masetty, Rob Herring, Linus Walleij,
	Sam Ravnborg, linux-kernel, dri-devel, linux-arm-msm, freedreno

On Wed, Jun 02, 2021 at 02:52:50PM -0700, Kees Cook wrote:
> 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!
> 
> Suggested-by: Arnd Bergmann <arnd@kernel.org>
> Link: https://lore.kernel.org/lkml/CAK8P3a3jUQs6c5tESSNMbqfuymewj9FhqRizyHcfOXf8Rgy-nA@mail.gmail.com/
> Signed-off-by: Kees Cook <keescook@chromium.org>

I rebased this one for -next and applied all three patches to
drm-misc-next.
-Daniel

> ---
>  drivers/gpu/drm/Kconfig | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/gpu/drm/Kconfig b/drivers/gpu/drm/Kconfig
> index 3c16bd1afd87..90891284ccec 100644
> --- a/drivers/gpu/drm/Kconfig
> +++ b/drivers/gpu/drm/Kconfig
> @@ -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
> -- 
> 2.25.1
> 

-- 
Daniel Vetter
Software Engineer, Intel Corporation
http://blog.ffwll.ch

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

* Re: [PATCH 1/3] drm: Avoid circular dependencies for CONFIG_FB
@ 2021-06-03  8:48     ` Daniel Vetter
  0 siblings, 0 replies; 26+ messages in thread
From: Daniel Vetter @ 2021-06-03  8:48 UTC (permalink / raw)
  To: Kees Cook
  Cc: Arnd Bergmann, Sai Prakash Ranjan, Emma Anholt, David Airlie,
	Sam Ravnborg, Sharat Masetty, linux-kernel, dri-devel,
	Thomas Zimmermann, linux-arm-msm, Dave Airlie, freedreno,
	Sean Paul, kernel test robot

On Wed, Jun 02, 2021 at 02:52:50PM -0700, Kees Cook wrote:
> 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!
> 
> Suggested-by: Arnd Bergmann <arnd@kernel.org>
> Link: https://lore.kernel.org/lkml/CAK8P3a3jUQs6c5tESSNMbqfuymewj9FhqRizyHcfOXf8Rgy-nA@mail.gmail.com/
> Signed-off-by: Kees Cook <keescook@chromium.org>

I rebased this one for -next and applied all three patches to
drm-misc-next.
-Daniel

> ---
>  drivers/gpu/drm/Kconfig | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/gpu/drm/Kconfig b/drivers/gpu/drm/Kconfig
> index 3c16bd1afd87..90891284ccec 100644
> --- a/drivers/gpu/drm/Kconfig
> +++ b/drivers/gpu/drm/Kconfig
> @@ -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
> -- 
> 2.25.1
> 

-- 
Daniel Vetter
Software Engineer, Intel Corporation
http://blog.ffwll.ch

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

* Re: [PATCH 3/3] drm/pl111: depend on CONFIG_VEXPRESS_CONFIG
  2021-06-02 21:52   ` Kees Cook
@ 2021-06-03 18:42     ` Rob Herring
  -1 siblings, 0 replies; 26+ messages in thread
From: Rob Herring @ 2021-06-03 18:42 UTC (permalink / raw)
  To: Kees Cook
  Cc: Dave Airlie, Maarten Lankhorst, Maxime Ripard, Thomas Zimmermann,
	David Airlie, Daniel Vetter, Arnd Bergmann, kernel test robot,
	Sai Prakash Ranjan, Emma Anholt, Rob Clark, Sean Paul,
	Sharat Masetty, Linus Walleij, Sam Ravnborg, linux-kernel,
	dri-devel, linux-arm-msm, freedreno

On Wed, Jun 2, 2021 at 4:53 PM Kees Cook <keescook@chromium.org> wrote:
>
> 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.

>
> Fixes: 826fc86b5903 ("drm: pl111: Move VExpress setup into versatile init")
> Signed-off-by: Kees Cook <keescook@chromium.org>
> ---
>  drivers/gpu/drm/pl111/Kconfig | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/gpu/drm/pl111/Kconfig b/drivers/gpu/drm/pl111/Kconfig
> index 80f6748055e3..c5210a5bef1b 100644
> --- a/drivers/gpu/drm/pl111/Kconfig
> +++ b/drivers/gpu/drm/pl111/Kconfig
> @@ -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
>

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

* Re: [PATCH 3/3] drm/pl111: depend on CONFIG_VEXPRESS_CONFIG
@ 2021-06-03 18:42     ` Rob Herring
  0 siblings, 0 replies; 26+ messages in thread
From: Rob Herring @ 2021-06-03 18:42 UTC (permalink / raw)
  To: Kees Cook
  Cc: Arnd Bergmann, Sai Prakash Ranjan, Thomas Zimmermann,
	Emma Anholt, David Airlie, Sam Ravnborg, Sharat Masetty,
	linux-kernel, dri-devel, linux-arm-msm, Dave Airlie, freedreno,
	Sean Paul, kernel test robot

On Wed, Jun 2, 2021 at 4:53 PM Kees Cook <keescook@chromium.org> wrote:
>
> 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.

>
> Fixes: 826fc86b5903 ("drm: pl111: Move VExpress setup into versatile init")
> Signed-off-by: Kees Cook <keescook@chromium.org>
> ---
>  drivers/gpu/drm/pl111/Kconfig | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/gpu/drm/pl111/Kconfig b/drivers/gpu/drm/pl111/Kconfig
> index 80f6748055e3..c5210a5bef1b 100644
> --- a/drivers/gpu/drm/pl111/Kconfig
> +++ b/drivers/gpu/drm/pl111/Kconfig
> @@ -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
>

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

* Re: [PATCH 1/3] drm: Avoid circular dependencies for CONFIG_FB
  2021-06-03  8:48     ` Daniel Vetter
@ 2021-06-03 18:48       ` Rob Herring
  -1 siblings, 0 replies; 26+ messages in thread
From: Rob Herring @ 2021-06-03 18:48 UTC (permalink / raw)
  To: Kees Cook, Daniel Vetter
  Cc: Dave Airlie, Arnd Bergmann, Maarten Lankhorst, Maxime Ripard,
	Thomas Zimmermann, David Airlie, kernel test robot,
	Sai Prakash Ranjan, Emma Anholt, Rob Clark, Sean Paul,
	Sharat Masetty, Linus Walleij, Sam Ravnborg, linux-kernel,
	dri-devel, linux-arm-msm, freedreno

On Thu, Jun 3, 2021 at 3:48 AM Daniel Vetter <daniel@ffwll.ch> wrote:
>
> On Wed, Jun 02, 2021 at 02:52:50PM -0700, Kees Cook wrote:
> > 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!
> >
> > Suggested-by: Arnd Bergmann <arnd@kernel.org>
> > Link: https://lore.kernel.org/lkml/CAK8P3a3jUQs6c5tESSNMbqfuymewj9FhqRizyHcfOXf8Rgy-nA@mail.gmail.com/
> > Signed-off-by: Kees Cook <keescook@chromium.org>
>
> 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

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

* Re: [PATCH 1/3] drm: Avoid circular dependencies for CONFIG_FB
@ 2021-06-03 18:48       ` Rob Herring
  0 siblings, 0 replies; 26+ messages in thread
From: Rob Herring @ 2021-06-03 18:48 UTC (permalink / raw)
  To: Kees Cook, Daniel Vetter
  Cc: Arnd Bergmann, Sai Prakash Ranjan, kernel test robot,
	Emma Anholt, David Airlie, Sam Ravnborg, Sharat Masetty,
	linux-kernel, dri-devel, Thomas Zimmermann, linux-arm-msm,
	Dave Airlie, freedreno, Sean Paul

On Thu, Jun 3, 2021 at 3:48 AM Daniel Vetter <daniel@ffwll.ch> wrote:
>
> On Wed, Jun 02, 2021 at 02:52:50PM -0700, Kees Cook wrote:
> > 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!
> >
> > Suggested-by: Arnd Bergmann <arnd@kernel.org>
> > Link: https://lore.kernel.org/lkml/CAK8P3a3jUQs6c5tESSNMbqfuymewj9FhqRizyHcfOXf8Rgy-nA@mail.gmail.com/
> > Signed-off-by: Kees Cook <keescook@chromium.org>
>
> 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

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

* Re: [PATCH 3/3] drm/pl111: depend on CONFIG_VEXPRESS_CONFIG
  2021-06-03 18:42     ` Rob Herring
@ 2021-06-03 19:19       ` Daniel Vetter
  -1 siblings, 0 replies; 26+ messages in thread
From: Daniel Vetter @ 2021-06-03 19:19 UTC (permalink / raw)
  To: Rob Herring
  Cc: Kees Cook, Dave Airlie, Maarten Lankhorst, Maxime Ripard,
	Thomas Zimmermann, David Airlie, Arnd Bergmann,
	kernel test robot, Sai Prakash Ranjan, Emma Anholt, Rob Clark,
	Sean Paul, Sharat Masetty, Linus Walleij, Sam Ravnborg,
	Linux Kernel Mailing List, dri-devel, linux-arm-msm, freedreno

On Thu, Jun 3, 2021 at 8:43 PM Rob Herring <robh@kernel.org> wrote:
>
> On Wed, Jun 2, 2021 at 4:53 PM Kees Cook <keescook@chromium.org> wrote:
> >
> > 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.

It needs a compile-time status inline then for the functions we're
using in pl111.
-Daniel

>
> >
> > Fixes: 826fc86b5903 ("drm: pl111: Move VExpress setup into versatile init")
> > Signed-off-by: Kees Cook <keescook@chromium.org>
> > ---
> >  drivers/gpu/drm/pl111/Kconfig | 2 +-
> >  1 file changed, 1 insertion(+), 1 deletion(-)
> >
> > diff --git a/drivers/gpu/drm/pl111/Kconfig b/drivers/gpu/drm/pl111/Kconfig
> > index 80f6748055e3..c5210a5bef1b 100644
> > --- a/drivers/gpu/drm/pl111/Kconfig
> > +++ b/drivers/gpu/drm/pl111/Kconfig
> > @@ -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
> >



-- 
Daniel Vetter
Software Engineer, Intel Corporation
http://blog.ffwll.ch

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

* Re: [PATCH 3/3] drm/pl111: depend on CONFIG_VEXPRESS_CONFIG
@ 2021-06-03 19:19       ` Daniel Vetter
  0 siblings, 0 replies; 26+ messages in thread
From: Daniel Vetter @ 2021-06-03 19:19 UTC (permalink / raw)
  To: Rob Herring
  Cc: Arnd Bergmann, Sai Prakash Ranjan, Kees Cook, Emma Anholt,
	David Airlie, Sam Ravnborg, Sharat Masetty,
	Linux Kernel Mailing List, dri-devel, Thomas Zimmermann,
	linux-arm-msm, Dave Airlie, freedreno, Sean Paul,
	kernel test robot

On Thu, Jun 3, 2021 at 8:43 PM Rob Herring <robh@kernel.org> wrote:
>
> On Wed, Jun 2, 2021 at 4:53 PM Kees Cook <keescook@chromium.org> wrote:
> >
> > 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.

It needs a compile-time status inline then for the functions we're
using in pl111.
-Daniel

>
> >
> > Fixes: 826fc86b5903 ("drm: pl111: Move VExpress setup into versatile init")
> > Signed-off-by: Kees Cook <keescook@chromium.org>
> > ---
> >  drivers/gpu/drm/pl111/Kconfig | 2 +-
> >  1 file changed, 1 insertion(+), 1 deletion(-)
> >
> > diff --git a/drivers/gpu/drm/pl111/Kconfig b/drivers/gpu/drm/pl111/Kconfig
> > index 80f6748055e3..c5210a5bef1b 100644
> > --- a/drivers/gpu/drm/pl111/Kconfig
> > +++ b/drivers/gpu/drm/pl111/Kconfig
> > @@ -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
> >



-- 
Daniel Vetter
Software Engineer, Intel Corporation
http://blog.ffwll.ch

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

* Re: [PATCH 3/3] drm/pl111: depend on CONFIG_VEXPRESS_CONFIG
  2021-06-03 18:42     ` Rob Herring
@ 2021-06-03 19:54       ` Rob Herring
  -1 siblings, 0 replies; 26+ messages in thread
From: Rob Herring @ 2021-06-03 19:54 UTC (permalink / raw)
  To: Kees Cook
  Cc: Dave Airlie, Maarten Lankhorst, Maxime Ripard, Thomas Zimmermann,
	David Airlie, Daniel Vetter, Arnd Bergmann, kernel test robot,
	Sai Prakash Ranjan, Emma Anholt, Rob Clark, Sean Paul,
	Linus Walleij, Sam Ravnborg, linux-kernel, dri-devel,
	linux-arm-msm, freedreno

On Thu, Jun 3, 2021 at 1:42 PM Rob Herring <robh@kernel.org> wrote:
>
> On Wed, Jun 2, 2021 at 4:53 PM Kees Cook <keescook@chromium.org> wrote:
> >
> > 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.

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

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

* Re: [PATCH 3/3] drm/pl111: depend on CONFIG_VEXPRESS_CONFIG
@ 2021-06-03 19:54       ` Rob Herring
  0 siblings, 0 replies; 26+ messages in thread
From: Rob Herring @ 2021-06-03 19:54 UTC (permalink / raw)
  To: Kees Cook
  Cc: Arnd Bergmann, Sai Prakash Ranjan, Thomas Zimmermann,
	Emma Anholt, David Airlie, Sam Ravnborg, linux-kernel, dri-devel,
	linux-arm-msm, Dave Airlie, freedreno, Sean Paul,
	kernel test robot

On Thu, Jun 3, 2021 at 1:42 PM Rob Herring <robh@kernel.org> wrote:
>
> On Wed, Jun 2, 2021 at 4:53 PM Kees Cook <keescook@chromium.org> wrote:
> >
> > 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.

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

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

* Re: [PATCH 3/3] drm/pl111: depend on CONFIG_VEXPRESS_CONFIG
  2021-06-03 19:19       ` Daniel Vetter
@ 2021-06-03 21:19         ` Kees Cook
  -1 siblings, 0 replies; 26+ messages in thread
From: Kees Cook @ 2021-06-03 21:19 UTC (permalink / raw)
  To: Daniel Vetter
  Cc: Rob Herring, Dave Airlie, Maarten Lankhorst, Maxime Ripard,
	Thomas Zimmermann, David Airlie, Arnd Bergmann,
	kernel test robot, Sai Prakash Ranjan, Emma Anholt, Rob Clark,
	Sean Paul, Sharat Masetty, Linus Walleij, Sam Ravnborg,
	Linux Kernel Mailing List, dri-devel, linux-arm-msm, freedreno

On Thu, Jun 03, 2021 at 09:19:42PM +0200, Daniel Vetter wrote:
> On Thu, Jun 3, 2021 at 8:43 PM Rob Herring <robh@kernel.org> wrote:
> >
> > On Wed, Jun 2, 2021 at 4:53 PM Kees Cook <keescook@chromium.org> wrote:
> > >
> > > 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?

Ah! I missed that when reading the code. I see the problem now. It's
because of:

CONFIG_VEXPRESS_CONFIG=m
CONFIG_DRM_PL111=y

I think the right fix is:

diff --git a/drivers/gpu/drm/pl111/Kconfig b/drivers/gpu/drm/pl111/Kconfig
index 80f6748055e3..662fc38f92ba 100644
--- a/drivers/gpu/drm/pl111/Kconfig
+++ b/drivers/gpu/drm/pl111/Kconfig
@@ -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...

> > Making the whole file depend on VEXPRESS_CONFIG is 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/202105300926.fX0MYySp-lkp@intel.com/

> -Daniel
> 
> >
> > >
> > > Fixes: 826fc86b5903 ("drm: pl111: Move VExpress setup into versatile init")
> > > Signed-off-by: Kees Cook <keescook@chromium.org>
> > > ---
> > >  drivers/gpu/drm/pl111/Kconfig | 2 +-
> > >  1 file changed, 1 insertion(+), 1 deletion(-)
> > >
> > > diff --git a/drivers/gpu/drm/pl111/Kconfig b/drivers/gpu/drm/pl111/Kconfig
> > > index 80f6748055e3..c5210a5bef1b 100644
> > > --- a/drivers/gpu/drm/pl111/Kconfig
> > > +++ b/drivers/gpu/drm/pl111/Kconfig
> > > @@ -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
> > >
> 
> 
> 
> -- 
> Daniel Vetter
> Software Engineer, Intel Corporation
> http://blog.ffwll.ch

-- 
Kees Cook

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

* Re: [PATCH 3/3] drm/pl111: depend on CONFIG_VEXPRESS_CONFIG
@ 2021-06-03 21:19         ` Kees Cook
  0 siblings, 0 replies; 26+ messages in thread
From: Kees Cook @ 2021-06-03 21:19 UTC (permalink / raw)
  To: Daniel Vetter
  Cc: Sai Prakash Ranjan, kernel test robot, Emma Anholt,
	Arnd Bergmann, David Airlie, Sam Ravnborg, Sharat Masetty,
	Linux Kernel Mailing List, dri-devel, Thomas Zimmermann,
	linux-arm-msm, Dave Airlie, freedreno, Sean Paul

On Thu, Jun 03, 2021 at 09:19:42PM +0200, Daniel Vetter wrote:
> On Thu, Jun 3, 2021 at 8:43 PM Rob Herring <robh@kernel.org> wrote:
> >
> > On Wed, Jun 2, 2021 at 4:53 PM Kees Cook <keescook@chromium.org> wrote:
> > >
> > > 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?

Ah! I missed that when reading the code. I see the problem now. It's
because of:

CONFIG_VEXPRESS_CONFIG=m
CONFIG_DRM_PL111=y

I think the right fix is:

diff --git a/drivers/gpu/drm/pl111/Kconfig b/drivers/gpu/drm/pl111/Kconfig
index 80f6748055e3..662fc38f92ba 100644
--- a/drivers/gpu/drm/pl111/Kconfig
+++ b/drivers/gpu/drm/pl111/Kconfig
@@ -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...

> > Making the whole file depend on VEXPRESS_CONFIG is 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/202105300926.fX0MYySp-lkp@intel.com/

> -Daniel
> 
> >
> > >
> > > Fixes: 826fc86b5903 ("drm: pl111: Move VExpress setup into versatile init")
> > > Signed-off-by: Kees Cook <keescook@chromium.org>
> > > ---
> > >  drivers/gpu/drm/pl111/Kconfig | 2 +-
> > >  1 file changed, 1 insertion(+), 1 deletion(-)
> > >
> > > diff --git a/drivers/gpu/drm/pl111/Kconfig b/drivers/gpu/drm/pl111/Kconfig
> > > index 80f6748055e3..c5210a5bef1b 100644
> > > --- a/drivers/gpu/drm/pl111/Kconfig
> > > +++ b/drivers/gpu/drm/pl111/Kconfig
> > > @@ -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
> > >
> 
> 
> 
> -- 
> Daniel Vetter
> Software Engineer, Intel Corporation
> http://blog.ffwll.ch

-- 
Kees Cook

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

* Re: [PATCH 3/3] drm/pl111: depend on CONFIG_VEXPRESS_CONFIG
  2021-06-03 21:19         ` Kees Cook
@ 2021-06-03 21:29           ` Kees Cook
  -1 siblings, 0 replies; 26+ messages in thread
From: Kees Cook @ 2021-06-03 21:29 UTC (permalink / raw)
  To: Daniel Vetter
  Cc: Rob Herring, Dave Airlie, Maarten Lankhorst, Maxime Ripard,
	Thomas Zimmermann, David Airlie, Arnd Bergmann,
	kernel test robot, Sai Prakash Ranjan, Emma Anholt, Rob Clark,
	Sean Paul, Sharat Masetty, Linus Walleij, Sam Ravnborg,
	Linux Kernel Mailing List, dri-devel, linux-arm-msm, freedreno

On Thu, Jun 03, 2021 at 02:19:52PM -0700, Kees Cook wrote:
> On Thu, Jun 03, 2021 at 09:19:42PM +0200, Daniel Vetter wrote:
> > On Thu, Jun 3, 2021 at 8:43 PM Rob Herring <robh@kernel.org> wrote:
> > >
> > > On Wed, Jun 2, 2021 at 4:53 PM Kees Cook <keescook@chromium.org> wrote:
> > > >
> > > > 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?
> 
> Ah! I missed that when reading the code. I see the problem now. It's
> because of:
> 
> CONFIG_VEXPRESS_CONFIG=m
> CONFIG_DRM_PL111=y
> 
> I think the right fix is:
> 
> diff --git a/drivers/gpu/drm/pl111/Kconfig b/drivers/gpu/drm/pl111/Kconfig
> index 80f6748055e3..662fc38f92ba 100644
> --- a/drivers/gpu/drm/pl111/Kconfig
> +++ b/drivers/gpu/drm/pl111/Kconfig
> @@ -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 set
CONFIG_DRM_PL111=y

CONFIG_VEXPRESS_CONFIG=y
CONFIG_DRM_PL111=y

CONFIG_VEXPRESS_CONFIG=m
CONFIG_DRM_PL111=m

CONFIG_VEXPRESS_CONFIG=y
CONFIG_DRM_PL111=m

and disallows:

CONFIG_VEXPRESS_CONFIG=m
CONFIG_DRM_PL111=y

(this will force CONFIG_DRM_PL111=m)

-Kees

>  	depends on COMMON_CLK
>  	select DRM_KMS_HELPER
>  	select DRM_KMS_CMA_HELPER
> 
> I will go check the defconfigs Rob mentioned...
> 
> > > Making the whole file depend on VEXPRESS_CONFIG is 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/202105300926.fX0MYySp-lkp@intel.com/
> 
> > -Daniel
> > 
> > >
> > > >
> > > > Fixes: 826fc86b5903 ("drm: pl111: Move VExpress setup into versatile init")
> > > > Signed-off-by: Kees Cook <keescook@chromium.org>
> > > > ---
> > > >  drivers/gpu/drm/pl111/Kconfig | 2 +-
> > > >  1 file changed, 1 insertion(+), 1 deletion(-)
> > > >
> > > > diff --git a/drivers/gpu/drm/pl111/Kconfig b/drivers/gpu/drm/pl111/Kconfig
> > > > index 80f6748055e3..c5210a5bef1b 100644
> > > > --- a/drivers/gpu/drm/pl111/Kconfig
> > > > +++ b/drivers/gpu/drm/pl111/Kconfig
> > > > @@ -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
> > > >
> > 
> > 
> > 
> > -- 
> > Daniel Vetter
> > Software Engineer, Intel Corporation
> > http://blog.ffwll.ch
> 
> -- 
> Kees Cook

-- 
Kees Cook

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

* Re: [PATCH 3/3] drm/pl111: depend on CONFIG_VEXPRESS_CONFIG
@ 2021-06-03 21:29           ` Kees Cook
  0 siblings, 0 replies; 26+ messages in thread
From: Kees Cook @ 2021-06-03 21:29 UTC (permalink / raw)
  To: Daniel Vetter
  Cc: Sai Prakash Ranjan, kernel test robot, Emma Anholt,
	Arnd Bergmann, David Airlie, Sam Ravnborg, Sharat Masetty,
	Linux Kernel Mailing List, dri-devel, Thomas Zimmermann,
	linux-arm-msm, Dave Airlie, freedreno, Sean Paul

On Thu, Jun 03, 2021 at 02:19:52PM -0700, Kees Cook wrote:
> On Thu, Jun 03, 2021 at 09:19:42PM +0200, Daniel Vetter wrote:
> > On Thu, Jun 3, 2021 at 8:43 PM Rob Herring <robh@kernel.org> wrote:
> > >
> > > On Wed, Jun 2, 2021 at 4:53 PM Kees Cook <keescook@chromium.org> wrote:
> > > >
> > > > 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?
> 
> Ah! I missed that when reading the code. I see the problem now. It's
> because of:
> 
> CONFIG_VEXPRESS_CONFIG=m
> CONFIG_DRM_PL111=y
> 
> I think the right fix is:
> 
> diff --git a/drivers/gpu/drm/pl111/Kconfig b/drivers/gpu/drm/pl111/Kconfig
> index 80f6748055e3..662fc38f92ba 100644
> --- a/drivers/gpu/drm/pl111/Kconfig
> +++ b/drivers/gpu/drm/pl111/Kconfig
> @@ -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 set
CONFIG_DRM_PL111=y

CONFIG_VEXPRESS_CONFIG=y
CONFIG_DRM_PL111=y

CONFIG_VEXPRESS_CONFIG=m
CONFIG_DRM_PL111=m

CONFIG_VEXPRESS_CONFIG=y
CONFIG_DRM_PL111=m

and disallows:

CONFIG_VEXPRESS_CONFIG=m
CONFIG_DRM_PL111=y

(this will force CONFIG_DRM_PL111=m)

-Kees

>  	depends on COMMON_CLK
>  	select DRM_KMS_HELPER
>  	select DRM_KMS_CMA_HELPER
> 
> I will go check the defconfigs Rob mentioned...
> 
> > > Making the whole file depend on VEXPRESS_CONFIG is 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/202105300926.fX0MYySp-lkp@intel.com/
> 
> > -Daniel
> > 
> > >
> > > >
> > > > Fixes: 826fc86b5903 ("drm: pl111: Move VExpress setup into versatile init")
> > > > Signed-off-by: Kees Cook <keescook@chromium.org>
> > > > ---
> > > >  drivers/gpu/drm/pl111/Kconfig | 2 +-
> > > >  1 file changed, 1 insertion(+), 1 deletion(-)
> > > >
> > > > diff --git a/drivers/gpu/drm/pl111/Kconfig b/drivers/gpu/drm/pl111/Kconfig
> > > > index 80f6748055e3..c5210a5bef1b 100644
> > > > --- a/drivers/gpu/drm/pl111/Kconfig
> > > > +++ b/drivers/gpu/drm/pl111/Kconfig
> > > > @@ -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
> > > >
> > 
> > 
> > 
> > -- 
> > Daniel Vetter
> > Software Engineer, Intel Corporation
> > http://blog.ffwll.ch
> 
> -- 
> Kees Cook

-- 
Kees Cook

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

* Re: [PATCH 3/3] drm/pl111: depend on CONFIG_VEXPRESS_CONFIG
  2021-06-03 21:29           ` Kees Cook
@ 2021-06-03 21:41             ` Daniel Vetter
  -1 siblings, 0 replies; 26+ messages in thread
From: Daniel Vetter @ 2021-06-03 21:41 UTC (permalink / raw)
  To: Kees Cook
  Cc: Rob Herring, Dave Airlie, Maarten Lankhorst, Maxime Ripard,
	Thomas Zimmermann, David Airlie, Arnd Bergmann,
	kernel test robot, Sai Prakash Ranjan, Emma Anholt, Rob Clark,
	Sean Paul, Sharat Masetty, Linus Walleij, Sam Ravnborg,
	Linux Kernel Mailing List, dri-devel, linux-arm-msm, freedreno

On Thu, Jun 3, 2021 at 11:29 PM Kees Cook <keescook@chromium.org> wrote:
>
> On Thu, Jun 03, 2021 at 02:19:52PM -0700, Kees Cook wrote:
> > On Thu, Jun 03, 2021 at 09:19:42PM +0200, Daniel Vetter wrote:
> > > On Thu, Jun 3, 2021 at 8:43 PM Rob Herring <robh@kernel.org> wrote:
> > > >
> > > > On Wed, Jun 2, 2021 at 4:53 PM Kees Cook <keescook@chromium.org> wrote:
> > > > >
> > > > > 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?
> >
> > Ah! I missed that when reading the code. I see the problem now. It's
> > because of:
> >
> > CONFIG_VEXPRESS_CONFIG=m
> > CONFIG_DRM_PL111=y
> >
> > I think the right fix is:
> >
> > diff --git a/drivers/gpu/drm/pl111/Kconfig b/drivers/gpu/drm/pl111/Kconfig
> > index 80f6748055e3..662fc38f92ba 100644
> > --- a/drivers/gpu/drm/pl111/Kconfig
> > +++ b/drivers/gpu/drm/pl111/Kconfig
> > @@ -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

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

> _that_ lets me build with:
>
> # CONFIG_VEXPRESS_CONFIG is not set
> CONFIG_DRM_PL111=y
>
> CONFIG_VEXPRESS_CONFIG=y
> CONFIG_DRM_PL111=y
>
> CONFIG_VEXPRESS_CONFIG=m
> CONFIG_DRM_PL111=m
>
> CONFIG_VEXPRESS_CONFIG=y
> CONFIG_DRM_PL111=m
>
> and disallows:
>
> CONFIG_VEXPRESS_CONFIG=m
> CONFIG_DRM_PL111=y
>
> (this will force CONFIG_DRM_PL111=m)
>
> -Kees
>
> >       depends on COMMON_CLK
> >       select DRM_KMS_HELPER
> >       select DRM_KMS_CMA_HELPER
> >
> > I will go check the defconfigs Rob mentioned...
> >
> > > > Making the whole file depend on VEXPRESS_CONFIG is 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/202105300926.fX0MYySp-lkp@intel.com/
> >
> > > -Daniel
> > >
> > > >
> > > > >
> > > > > Fixes: 826fc86b5903 ("drm: pl111: Move VExpress setup into versatile init")
> > > > > Signed-off-by: Kees Cook <keescook@chromium.org>
> > > > > ---
> > > > >  drivers/gpu/drm/pl111/Kconfig | 2 +-
> > > > >  1 file changed, 1 insertion(+), 1 deletion(-)
> > > > >
> > > > > diff --git a/drivers/gpu/drm/pl111/Kconfig b/drivers/gpu/drm/pl111/Kconfig
> > > > > index 80f6748055e3..c5210a5bef1b 100644
> > > > > --- a/drivers/gpu/drm/pl111/Kconfig
> > > > > +++ b/drivers/gpu/drm/pl111/Kconfig
> > > > > @@ -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
> > > > >
> > >
> > >
> > >
> > > --
> > > Daniel Vetter
> > > Software Engineer, Intel Corporation
> > > http://blog.ffwll.ch
> >
> > --
> > Kees Cook
>
> --
> Kees Cook



-- 
Daniel Vetter
Software Engineer, Intel Corporation
http://blog.ffwll.ch

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

* Re: [PATCH 3/3] drm/pl111: depend on CONFIG_VEXPRESS_CONFIG
@ 2021-06-03 21:41             ` Daniel Vetter
  0 siblings, 0 replies; 26+ messages in thread
From: Daniel Vetter @ 2021-06-03 21:41 UTC (permalink / raw)
  To: Kees Cook
  Cc: Sai Prakash Ranjan, kernel test robot, Emma Anholt,
	Arnd Bergmann, David Airlie, Sam Ravnborg, Sharat Masetty,
	Linux Kernel Mailing List, dri-devel, Thomas Zimmermann,
	linux-arm-msm, Dave Airlie, freedreno, Sean Paul

On Thu, Jun 3, 2021 at 11:29 PM Kees Cook <keescook@chromium.org> wrote:
>
> On Thu, Jun 03, 2021 at 02:19:52PM -0700, Kees Cook wrote:
> > On Thu, Jun 03, 2021 at 09:19:42PM +0200, Daniel Vetter wrote:
> > > On Thu, Jun 3, 2021 at 8:43 PM Rob Herring <robh@kernel.org> wrote:
> > > >
> > > > On Wed, Jun 2, 2021 at 4:53 PM Kees Cook <keescook@chromium.org> wrote:
> > > > >
> > > > > 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?
> >
> > Ah! I missed that when reading the code. I see the problem now. It's
> > because of:
> >
> > CONFIG_VEXPRESS_CONFIG=m
> > CONFIG_DRM_PL111=y
> >
> > I think the right fix is:
> >
> > diff --git a/drivers/gpu/drm/pl111/Kconfig b/drivers/gpu/drm/pl111/Kconfig
> > index 80f6748055e3..662fc38f92ba 100644
> > --- a/drivers/gpu/drm/pl111/Kconfig
> > +++ b/drivers/gpu/drm/pl111/Kconfig
> > @@ -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

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

> _that_ lets me build with:
>
> # CONFIG_VEXPRESS_CONFIG is not set
> CONFIG_DRM_PL111=y
>
> CONFIG_VEXPRESS_CONFIG=y
> CONFIG_DRM_PL111=y
>
> CONFIG_VEXPRESS_CONFIG=m
> CONFIG_DRM_PL111=m
>
> CONFIG_VEXPRESS_CONFIG=y
> CONFIG_DRM_PL111=m
>
> and disallows:
>
> CONFIG_VEXPRESS_CONFIG=m
> CONFIG_DRM_PL111=y
>
> (this will force CONFIG_DRM_PL111=m)
>
> -Kees
>
> >       depends on COMMON_CLK
> >       select DRM_KMS_HELPER
> >       select DRM_KMS_CMA_HELPER
> >
> > I will go check the defconfigs Rob mentioned...
> >
> > > > Making the whole file depend on VEXPRESS_CONFIG is 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/202105300926.fX0MYySp-lkp@intel.com/
> >
> > > -Daniel
> > >
> > > >
> > > > >
> > > > > Fixes: 826fc86b5903 ("drm: pl111: Move VExpress setup into versatile init")
> > > > > Signed-off-by: Kees Cook <keescook@chromium.org>
> > > > > ---
> > > > >  drivers/gpu/drm/pl111/Kconfig | 2 +-
> > > > >  1 file changed, 1 insertion(+), 1 deletion(-)
> > > > >
> > > > > diff --git a/drivers/gpu/drm/pl111/Kconfig b/drivers/gpu/drm/pl111/Kconfig
> > > > > index 80f6748055e3..c5210a5bef1b 100644
> > > > > --- a/drivers/gpu/drm/pl111/Kconfig
> > > > > +++ b/drivers/gpu/drm/pl111/Kconfig
> > > > > @@ -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
> > > > >
> > >
> > >
> > >
> > > --
> > > Daniel Vetter
> > > Software Engineer, Intel Corporation
> > > http://blog.ffwll.ch
> >
> > --
> > Kees Cook
>
> --
> Kees Cook



-- 
Daniel Vetter
Software Engineer, Intel Corporation
http://blog.ffwll.ch

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

* Re: [PATCH 3/3] drm/pl111: depend on CONFIG_VEXPRESS_CONFIG
  2021-06-03 21:41             ` Daniel Vetter
@ 2021-06-03 21:48               ` Kees Cook
  -1 siblings, 0 replies; 26+ messages in thread
From: Kees Cook @ 2021-06-03 21:48 UTC (permalink / raw)
  To: Daniel Vetter
  Cc: Rob Herring, Dave Airlie, Maarten Lankhorst, Maxime Ripard,
	Thomas Zimmermann, David Airlie, Arnd Bergmann,
	kernel test robot, Sai Prakash Ranjan, Emma Anholt, Rob Clark,
	Sean Paul, Sharat Masetty, Linus Walleij, Sam Ravnborg,
	Linux Kernel Mailing List, dri-devel, linux-arm-msm, freedreno

On Thu, Jun 03, 2021 at 11:41:01PM +0200, Daniel Vetter wrote:
> On Thu, Jun 3, 2021 at 11:29 PM Kees Cook <keescook@chromium.org> wrote:
> >
> > On Thu, Jun 03, 2021 at 02:19:52PM -0700, Kees Cook wrote:
> > > On Thu, Jun 03, 2021 at 09:19:42PM +0200, Daniel Vetter wrote:
> > > > On Thu, Jun 3, 2021 at 8:43 PM Rob Herring <robh@kernel.org> wrote:
> > > > >
> > > > > On Wed, Jun 2, 2021 at 4:53 PM Kees Cook <keescook@chromium.org> wrote:
> > > > > >
> > > > > > 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?
> > >
> > > Ah! I missed that when reading the code. I see the problem now. It's
> > > because of:
> > >
> > > CONFIG_VEXPRESS_CONFIG=m
> > > CONFIG_DRM_PL111=y
> > >
> > > I think the right fix is:
> > >
> > > diff --git a/drivers/gpu/drm/pl111/Kconfig b/drivers/gpu/drm/pl111/Kconfig
> > > index 80f6748055e3..662fc38f92ba 100644
> > > --- a/drivers/gpu/drm/pl111/Kconfig
> > > +++ b/drivers/gpu/drm/pl111/Kconfig
> > > @@ -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
> 
> 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).

Ah! Yes, sorry. I wasn't sure if you'd reverted it yet. One moment...

-Kees

-- 
Kees Cook

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

* Re: [PATCH 3/3] drm/pl111: depend on CONFIG_VEXPRESS_CONFIG
@ 2021-06-03 21:48               ` Kees Cook
  0 siblings, 0 replies; 26+ messages in thread
From: Kees Cook @ 2021-06-03 21:48 UTC (permalink / raw)
  To: Daniel Vetter
  Cc: Sai Prakash Ranjan, kernel test robot, Emma Anholt,
	Arnd Bergmann, David Airlie, Sam Ravnborg, Sharat Masetty,
	Linux Kernel Mailing List, dri-devel, Thomas Zimmermann,
	linux-arm-msm, Dave Airlie, freedreno, Sean Paul

On Thu, Jun 03, 2021 at 11:41:01PM +0200, Daniel Vetter wrote:
> On Thu, Jun 3, 2021 at 11:29 PM Kees Cook <keescook@chromium.org> wrote:
> >
> > On Thu, Jun 03, 2021 at 02:19:52PM -0700, Kees Cook wrote:
> > > On Thu, Jun 03, 2021 at 09:19:42PM +0200, Daniel Vetter wrote:
> > > > On Thu, Jun 3, 2021 at 8:43 PM Rob Herring <robh@kernel.org> wrote:
> > > > >
> > > > > On Wed, Jun 2, 2021 at 4:53 PM Kees Cook <keescook@chromium.org> wrote:
> > > > > >
> > > > > > 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?
> > >
> > > Ah! I missed that when reading the code. I see the problem now. It's
> > > because of:
> > >
> > > CONFIG_VEXPRESS_CONFIG=m
> > > CONFIG_DRM_PL111=y
> > >
> > > I think the right fix is:
> > >
> > > diff --git a/drivers/gpu/drm/pl111/Kconfig b/drivers/gpu/drm/pl111/Kconfig
> > > index 80f6748055e3..662fc38f92ba 100644
> > > --- a/drivers/gpu/drm/pl111/Kconfig
> > > +++ b/drivers/gpu/drm/pl111/Kconfig
> > > @@ -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
> 
> 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).

Ah! Yes, sorry. I wasn't sure if you'd reverted it yet. One moment...

-Kees

-- 
Kees Cook

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

end of thread, other threads:[~2021-06-03 21:49 UTC | newest]

Thread overview: 26+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-06-02 21:52 [PATCH 0/3] drm: Fix randconfig link failures Kees Cook
2021-06-02 21:52 ` Kees Cook
2021-06-02 21:52 ` [PATCH 1/3] drm: Avoid circular dependencies for CONFIG_FB Kees Cook
2021-06-02 21:52   ` Kees Cook
2021-06-03  8:48   ` Daniel Vetter
2021-06-03  8:48     ` Daniel Vetter
2021-06-03 18:48     ` Rob Herring
2021-06-03 18:48       ` Rob Herring
2021-06-02 21:52 ` [PATCH 2/3] drm/msm/a6xx: add CONFIG_QCOM_LLCC dependency Kees Cook
2021-06-02 21:52   ` Kees Cook
2021-06-02 21:52 ` [PATCH 3/3] drm/pl111: depend on CONFIG_VEXPRESS_CONFIG Kees Cook
2021-06-02 21:52   ` Kees Cook
2021-06-03 18:42   ` Rob Herring
2021-06-03 18:42     ` Rob Herring
2021-06-03 19:19     ` Daniel Vetter
2021-06-03 19:19       ` Daniel Vetter
2021-06-03 21:19       ` Kees Cook
2021-06-03 21:19         ` Kees Cook
2021-06-03 21:29         ` Kees Cook
2021-06-03 21:29           ` Kees Cook
2021-06-03 21:41           ` Daniel Vetter
2021-06-03 21:41             ` Daniel Vetter
2021-06-03 21:48             ` Kees Cook
2021-06-03 21:48               ` Kees Cook
2021-06-03 19:54     ` Rob Herring
2021-06-03 19:54       ` Rob Herring

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.