Skip to contentSkip to conversation

drm: msm: fix building without CONFIG_COMMON_CLK

PATCH In review Arnd Bergmann 4 participants 9 messages Oct 13, 2021 – Oct 18, 2021

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

PATCH 1/1 drm: msm: fix building without CONFIG_COMMON_CLK

From: Arnd Bergmann <[email protected]>

When CONFIG_COMMON_CLOCK is disabled, the 8996 specific phy code is left out, which results in a link failure:

ld: drivers/gpu/drm/msm/hdmi/hdmi_phy.o:(.rodata+0x3f0): undefined reference to `msm_hdmi_phy_8996_cfg'

This was only exposed after it became possible to build test the driver without the clock interfaces.

Make COMMON_CLK a hard dependency for compile testing, and simplify it a little based on that.

Fixes b3ed524f84f5 ("drm/msm: allow compile_test on !ARM")
---
 drivers/gpu/drm/msm/Kconfig  | 2 +-
 drivers/gpu/drm/msm/Makefile | 6 +++---
 2 files changed, 4 insertions(+), 4 deletions(-)
drivers/gpu/drm/msm/Kconfig +1 -1
index f5107b6ded7b..cb204912e0f4 100644
@@ -4,8 +4,8 @@ config DRM_MSM
 	tristate "MSM DRM"
 	depends on DRM
 	depends on ARCH_QCOM || SOC_IMX5 || COMPILE_TEST
+	depends on COMMON_CLK
 	depends on IOMMU_SUPPORT
-	depends on (OF && COMMON_CLK) || COMPILE_TEST
 	depends on QCOM_OCMEM || QCOM_OCMEM=n
 	depends on QCOM_LLCC || QCOM_LLCC=n
 	depends on QCOM_COMMAND_DB || QCOM_COMMAND_DB=n
drivers/gpu/drm/msm/Makefile +3 -3
index 904535eda0c4..bbee22b54b0c 100644
@@ -23,8 +23,10 @@ msm-y := \
 	hdmi/hdmi_i2c.o \
 	hdmi/hdmi_phy.o \
 	hdmi/hdmi_phy_8960.o \
+	hdmi/hdmi_phy_8996.o \
 	hdmi/hdmi_phy_8x60.o \
 	hdmi/hdmi_phy_8x74.o \
+	hdmi/hdmi_pll_8960.o \
 	edp/edp.o \
 	edp/edp_aux.o \
 	edp/edp_bridge.o \
@@ -37,6 +39,7 @@ msm-y := \
 	disp/mdp4/mdp4_dtv_encoder.o \
 	disp/mdp4/mdp4_lcdc_encoder.o \
 	disp/mdp4/mdp4_lvds_connector.o \
+	disp/mdp4/mdp4_lvds_pll.o \
 	disp/mdp4/mdp4_irq.o \
 	disp/mdp4/mdp4_kms.o \
 	disp/mdp4/mdp4_plane.o \
@@ -117,9 +120,6 @@ msm-$(CONFIG_DRM_MSM_DP)+= dp/dp_aux.o \
 	dp/dp_audio.o
 
 msm-$(CONFIG_DRM_FBDEV_EMULATION) += msm_fbdev.o
-msm-$(CONFIG_COMMON_CLK) += disp/mdp4/mdp4_lvds_pll.o
-msm-$(CONFIG_COMMON_CLK) += hdmi/hdmi_pll_8960.o
-msm-$(CONFIG_COMMON_CLK) += hdmi/hdmi_phy_8996.o
 
 msm-$(CONFIG_DRM_MSM_HDMI_HDCP) += hdmi/hdmi_hdcp.o
 
Signature · 1 line
2.29.2
Reviewed-by on v1 1/1
#1 lore raw
Quoted 10 lines · Arnd Bergmann

From: Arnd Bergmann <[email protected]>

When CONFIG_COMMON_CLOCK is disabled, the 8996 specific phy code is left out, which results in a link failure:

ld: drivers/gpu/drm/msm/hdmi/hdmi_phy.o:(.rodata+0x3f0): undefined reference to `msm_hdmi_phy_8996_cfg'

This was only exposed after it became possible to build test the driver without the clock interfaces.

Quoted 7 lines

Make COMMON_CLK a hard dependency for compile testing, and simplify it a little based on that.

Fixes b3ed524f84f5 ("drm/msm: allow compile_test on !ARM")

This drops dependency on CONFIG_OF. While ARM64 selects OF, pure ARM does not.

With that fixed:

Quoted 53 lines
---
  drivers/gpu/drm/msm/Kconfig  | 2 +-
  drivers/gpu/drm/msm/Makefile | 6 +++---
  2 files changed, 4 insertions(+), 4 deletions(-)
drivers/gpu/drm/msm/Kconfig +1 -1
index f5107b6ded7b..cb204912e0f4 100644
@@ -4,8 +4,8 @@ config DRM_MSM
  	tristate "MSM DRM"
  	depends on DRM
  	depends on ARCH_QCOM || SOC_IMX5 || COMPILE_TEST
+	depends on COMMON_CLK
  	depends on IOMMU_SUPPORT
-	depends on (OF && COMMON_CLK) || COMPILE_TEST
  	depends on QCOM_OCMEM || QCOM_OCMEM=n
  	depends on QCOM_LLCC || QCOM_LLCC=n
  	depends on QCOM_COMMAND_DB || QCOM_COMMAND_DB=n
drivers/gpu/drm/msm/Makefile +3 -3
index 904535eda0c4..bbee22b54b0c 100644
@@ -23,8 +23,10 @@ msm-y := \
  	hdmi/hdmi_i2c.o \
  	hdmi/hdmi_phy.o \
  	hdmi/hdmi_phy_8960.o \
+	hdmi/hdmi_phy_8996.o \
  	hdmi/hdmi_phy_8x60.o \
  	hdmi/hdmi_phy_8x74.o \
+	hdmi/hdmi_pll_8960.o \
  	edp/edp.o \
  	edp/edp_aux.o \
  	edp/edp_bridge.o \
@@ -37,6 +39,7 @@ msm-y := \
  	disp/mdp4/mdp4_dtv_encoder.o \
  	disp/mdp4/mdp4_lcdc_encoder.o \
  	disp/mdp4/mdp4_lvds_connector.o \
+	disp/mdp4/mdp4_lvds_pll.o \
  	disp/mdp4/mdp4_irq.o \
  	disp/mdp4/mdp4_kms.o \
  	disp/mdp4/mdp4_plane.o \
@@ -117,9 +120,6 @@ msm-$(CONFIG_DRM_MSM_DP)+= dp/dp_aux.o \
  	dp/dp_audio.o
 
  msm-$(CONFIG_DRM_FBDEV_EMULATION) += msm_fbdev.o
-msm-$(CONFIG_COMMON_CLK) += disp/mdp4/mdp4_lvds_pll.o
-msm-$(CONFIG_COMMON_CLK) += hdmi/hdmi_pll_8960.o
-msm-$(CONFIG_COMMON_CLK) += hdmi/hdmi_phy_8996.o
 
  msm-$(CONFIG_DRM_MSM_HDMI_HDCP) += hdmi/hdmi_hdcp.o
 
Signature · 2 lines
With best wishes
Dmitry
#2 lore raw

Hi Dmitry,

Quoted 14 lines · Dmitry Baryshkov
Quoted 13 lines · Arnd Bergmann

From: Arnd Bergmann <[email protected]>

When CONFIG_COMMON_CLOCK is disabled, the 8996 specific phy code is left out, which results in a link failure:

ld: drivers/gpu/drm/msm/hdmi/hdmi_phy.o:(.rodata+0x3f0): undefined reference to `msm_hdmi_phy_8996_cfg'

This was only exposed after it became possible to build test the driver without the clock interfaces.

Make COMMON_CLK a hard dependency for compile testing, and simplify it a little based on that.

Quoted 7 lines
Quoted 4 lines
Fixes b3ed524f84f5 ("drm/msm: allow compile_test on !ARM")

This drops dependency on CONFIG_OF. While ARM64 selects OF, pure ARM does not.

But SOC_IMX5 depends on ARCH_MULTI_V7, which depends on ARCH_MULTIPLATFORM, which selects USE_OF, which selects OF.

Gr{oetje,eeting}s,

Geert

--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- [email protected]

In personal conversations with technical people, I call myself a hacker. But when I'm talking to journalists I just say "programmer" or something like that.
-- Linus Torvalds

#3 lore raw
In reply to Arnd Bergmann

Am 13.10.21 um 16:42 schrieb Arnd Bergmann:

Quoted 27 lines

From: Arnd Bergmann <[email protected]>

When CONFIG_COMMON_CLOCK is disabled, the 8996 specific phy code is left out, which results in a link failure:

ld: drivers/gpu/drm/msm/hdmi/hdmi_phy.o:(.rodata+0x3f0): undefined reference to `msm_hdmi_phy_8996_cfg'

This was only exposed after it became possible to build test the driver without the clock interfaces.

Make COMMON_CLK a hard dependency for compile testing, and simplify it a little based on that.

Fixes b3ed524f84f5 ("drm/msm: allow compile_test on !ARM")
---
  drivers/gpu/drm/msm/Kconfig  | 2 +-
  drivers/gpu/drm/msm/Makefile | 6 +++---
  2 files changed, 4 insertions(+), 4 deletions(-)
drivers/gpu/drm/msm/Kconfig +0 -0
index f5107b6ded7b..cb204912e0f4 100644

drivers/gpu/drm/msm/Kconfig config DRM_MSM · line 8

Quoted 5 lines
drivers/gpu/drm/msm/Kconfig +1 -0
@@ -4,8 +4,8 @@ config DRM_MSM
  	tristate "MSM DRM"
  	depends on DRM
  	depends on ARCH_QCOM || SOC_IMX5 || COMPILE_TEST
+	depends on COMMON_CLK
  	depends on IOMMU_SUPPORT

We also need a "depends on MMU" here because some automated test is now trying to compile the driver on parisc as well.

I have absolutely no idea how a platform can have IOMMU but no MMU support but it indeed seems to be the case here.

Regards,
Christian.

Quoted 37 lines
drivers/gpu/drm/msm/Kconfig +0 -1
-	depends on (OF && COMMON_CLK) || COMPILE_TEST
  	depends on QCOM_OCMEM || QCOM_OCMEM=n
  	depends on QCOM_LLCC || QCOM_LLCC=n
  	depends on QCOM_COMMAND_DB || QCOM_COMMAND_DB=n
drivers/gpu/drm/msm/Makefile +3 -3
index 904535eda0c4..bbee22b54b0c 100644
@@ -23,8 +23,10 @@ msm-y := \
  	hdmi/hdmi_i2c.o \
  	hdmi/hdmi_phy.o \
  	hdmi/hdmi_phy_8960.o \
+	hdmi/hdmi_phy_8996.o \
  	hdmi/hdmi_phy_8x60.o \
  	hdmi/hdmi_phy_8x74.o \
+	hdmi/hdmi_pll_8960.o \
  	edp/edp.o \
  	edp/edp_aux.o \
  	edp/edp_bridge.o \
@@ -37,6 +39,7 @@ msm-y := \
  	disp/mdp4/mdp4_dtv_encoder.o \
  	disp/mdp4/mdp4_lcdc_encoder.o \
  	disp/mdp4/mdp4_lvds_connector.o \
+	disp/mdp4/mdp4_lvds_pll.o \
  	disp/mdp4/mdp4_irq.o \
  	disp/mdp4/mdp4_kms.o \
  	disp/mdp4/mdp4_plane.o \
@@ -117,9 +120,6 @@ msm-$(CONFIG_DRM_MSM_DP)+= dp/dp_aux.o \
  	dp/dp_audio.o
 
  msm-$(CONFIG_DRM_FBDEV_EMULATION) += msm_fbdev.o
-msm-$(CONFIG_COMMON_CLK) += disp/mdp4/mdp4_lvds_pll.o
-msm-$(CONFIG_COMMON_CLK) += hdmi/hdmi_pll_8960.o
-msm-$(CONFIG_COMMON_CLK) += hdmi/hdmi_phy_8996.o
 
  msm-$(CONFIG_DRM_MSM_HDMI_HDCP) += hdmi/hdmi_hdcp.o
 
#4 lore raw

Hi Christian,

Quoted 37 lines · Christian König

Am 13.10.21 um 16:42 schrieb Arnd Bergmann:

Quoted 27 lines

From: Arnd Bergmann <[email protected]>

When CONFIG_COMMON_CLOCK is disabled, the 8996 specific phy code is left out, which results in a link failure:

ld: drivers/gpu/drm/msm/hdmi/hdmi_phy.o:(.rodata+0x3f0): undefined reference to `msm_hdmi_phy_8996_cfg'

This was only exposed after it became possible to build test the driver without the clock interfaces.

Make COMMON_CLK a hard dependency for compile testing, and simplify it a little based on that.

Fixes b3ed524f84f5 ("drm/msm: allow compile_test on !ARM")
---
  drivers/gpu/drm/msm/Kconfig  | 2 +-
  drivers/gpu/drm/msm/Makefile | 6 +++---
  2 files changed, 4 insertions(+), 4 deletions(-)
drivers/gpu/drm/msm/Kconfig +0 -0
index f5107b6ded7b..cb204912e0f4 100644

drivers/gpu/drm/msm/Kconfig config DRM_MSM · line 8

Quoted 5 lines
drivers/gpu/drm/msm/Kconfig +1 -0
@@ -4,8 +4,8 @@ config DRM_MSM
      tristate "MSM DRM"
      depends on DRM
      depends on ARCH_QCOM || SOC_IMX5 || COMPILE_TEST
+     depends on COMMON_CLK
      depends on IOMMU_SUPPORT

We also need a "depends on MMU" here because some automated test is now trying to compile the driver on parisc as well.

Quoted 2 lines

I have absolutely no idea how a platform can have IOMMU but no MMU support but it indeed seems to be the case here.

Huh?

Parisc has config MMU def_bool y?

Gr{oetje,eeting}s,

Geert

--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- [email protected]

In personal conversations with technical people, I call myself a hacker. But when I'm talking to journalists I just say "programmer" or something like that.
-- Linus Torvalds

#5 lore raw

Am 18.10.21 um 13:38 schrieb Geert Uytterhoeven:

Quoted 40 lines

Hi Christian,

Quoted 36 lines · Christian König

Am 13.10.21 um 16:42 schrieb Arnd Bergmann:

Quoted 27 lines

From: Arnd Bergmann <[email protected]>

When CONFIG_COMMON_CLOCK is disabled, the 8996 specific phy code is left out, which results in a link failure:

ld: drivers/gpu/drm/msm/hdmi/hdmi_phy.o:(.rodata+0x3f0): undefined reference to `msm_hdmi_phy_8996_cfg'

This was only exposed after it became possible to build test the driver without the clock interfaces.

Make COMMON_CLK a hard dependency for compile testing, and simplify it a little based on that.

Fixes b3ed524f84f5 ("drm/msm: allow compile_test on !ARM")
---
   drivers/gpu/drm/msm/Kconfig  | 2 +-
   drivers/gpu/drm/msm/Makefile | 6 +++---
   2 files changed, 4 insertions(+), 4 deletions(-)
drivers/gpu/drm/msm/Kconfig +0 -0
index f5107b6ded7b..cb204912e0f4 100644

drivers/gpu/drm/msm/Kconfig config DRM_MSM · line 8

Quoted 5 lines
drivers/gpu/drm/msm/Kconfig +1 -0
@@ -4,8 +4,8 @@ config DRM_MSM
       tristate "MSM DRM"
       depends on DRM
       depends on ARCH_QCOM || SOC_IMX5 || COMPILE_TEST
+     depends on COMMON_CLK
       depends on IOMMU_SUPPORT

We also need a "depends on MMU" here because some automated test is now trying to compile the driver on parisc as well.

Quoted 5 lines
Quoted 2 lines

I have absolutely no idea how a platform can have IOMMU but no MMU support but it indeed seems to be the case here.

Huh?

Parisc has config MMU def_bool y?

Then why vmap isn't available?

See the mail thread: [linux-next:master 3576/7806] drivers/gpu/drm/msm/msm_gem.c:624:20: error: implicit declaration of function 'vmap'

Thanks for taking a look into this,
Christian.

Quoted 11 lines

Gr{oetje,eeting}s,

Geert

--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- [email protected]

In personal conversations with technical people, I call myself a hacker. But when I'm talking to journalists I just say "programmer" or something like that.
-- Linus Torvalds

#6 lore raw
Quoted 11 lines · Christian König
Quoted 5 lines
Quoted 2 lines

I have absolutely no idea how a platform can have IOMMU but no MMU support but it indeed seems to be the case here.

Huh?

Parisc has config MMU def_bool y?

Then why vmap isn't available?

See the mail thread: [linux-next:master 3576/7806] drivers/gpu/drm/msm/msm_gem.c:624:20: error: implicit declaration of function 'vmap'

This is just a missing "#include <linux/vmalloc.h>". It must be included indirectly
on some architectures but not other.

Arnd

#7 lore raw

Am 18.10.21 um 13:46 schrieb Arnd Bergmann:

Quoted 7 lines
Quoted 5 lines · Christian König
Quoted 5 lines
Quoted 2 lines

I have absolutely no idea how a platform can have IOMMU but no MMU support but it indeed seems to be the case here.

Huh?

Parisc has config MMU def_bool y?

Quoted 8 lines
Quoted 5 lines

Then why vmap isn't available?

See the mail thread: [linux-next:master 3576/7806] drivers/gpu/drm/msm/msm_gem.c:624:20: error: implicit declaration of function 'vmap'

This is just a missing "#include <linux/vmalloc.h>". It must be included indirectly
on some architectures but not other.

Ah! Should I send a patch or you take care of that as well?

Thanks,
Christian.

Quoted 2 lines

Arnd

#8 lore raw
In reply to Christian König

Hi Christian,

Quoted 43 lines · Christian König

Am 18.10.21 um 13:38 schrieb Geert Uytterhoeven:

Quoted 42 lines
Quoted 36 lines · Christian König

Am 13.10.21 um 16:42 schrieb Arnd Bergmann:

Quoted 27 lines

From: Arnd Bergmann <[email protected]>

When CONFIG_COMMON_CLOCK is disabled, the 8996 specific phy code is left out, which results in a link failure:

ld: drivers/gpu/drm/msm/hdmi/hdmi_phy.o:(.rodata+0x3f0): undefined reference to `msm_hdmi_phy_8996_cfg'

This was only exposed after it became possible to build test the driver without the clock interfaces.

Make COMMON_CLK a hard dependency for compile testing, and simplify it a little based on that.

Fixes b3ed524f84f5 ("drm/msm: allow compile_test on !ARM")
---
   drivers/gpu/drm/msm/Kconfig  | 2 +-
   drivers/gpu/drm/msm/Makefile | 6 +++---
   2 files changed, 4 insertions(+), 4 deletions(-)
drivers/gpu/drm/msm/Kconfig +0 -0
index f5107b6ded7b..cb204912e0f4 100644

drivers/gpu/drm/msm/Kconfig config DRM_MSM · line 8

Quoted 5 lines
drivers/gpu/drm/msm/Kconfig +1 -0
@@ -4,8 +4,8 @@ config DRM_MSM
       tristate "MSM DRM"
       depends on DRM
       depends on ARCH_QCOM || SOC_IMX5 || COMPILE_TEST
+     depends on COMMON_CLK
       depends on IOMMU_SUPPORT

We also need a "depends on MMU" here because some automated test is now trying to compile the driver on parisc as well.

Quoted 2 lines

I have absolutely no idea how a platform can have IOMMU but no MMU support but it indeed seems to be the case here.

Huh?

Quoted 7 lines
Quoted 1 line

Parisc has config MMU def_bool y?

Then why vmap isn't available?

See the mail thread: [linux-next:master 3576/7806] drivers/gpu/drm/msm/msm_gem.c:624:20: error: implicit declaration of function 'vmap'

You mean https://lore.kernel.org/all/[email protected]/?

Hexagon != parisc.
.
And Hexagon also has config MMU def_bool y

Gr{oetje,eeting}s,

Geert

--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- [email protected]

In personal conversations with technical people, I call myself a hacker. But when I'm talking to journalists I just say "programmer" or something like that.
-- Linus Torvalds