Skip to contentSkip to conversation

drm/mediatek: stop selecting foreign drivers

PATCH Applied Arnd Bergmann 6 participants 7 messages Dec 18, 2024 – Dec 25, 2024

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

PATCH 1/1 drm/mediatek: stop selecting foreign drivers

From: Arnd Bergmann <[email protected]>

The PHY portion of the mediatek hdmi driver was originally part of the driver it self and later split out into drivers/phy, which a 'select' to keep the prior behavior.

However, this leads to build failures when the PHY driver cannot be built:

WARNING: unmet direct dependencies detected for PHY_MTK_HDMI
Depends on [n]: (ARCH_MEDIATEK || COMPILE_TEST [=y]) && COMMON_CLK [=y] && OF [=y] && REGULATOR [=n] Selected by [m]:
- DRM_MEDIATEK_HDMI [=m] && HAS_IOMEM [=y] && DRM [=m] && DRM_MEDIATEK [=m]
ERROR: modpost: "devm_regulator_register" [drivers/phy/mediatek/phy-mtk-hdmi-drv.ko] undefined!
ERROR: modpost: "rdev_get_drvdata" [drivers/phy/mediatek/phy-mtk-hdmi-drv.ko] undefined!

The best option here is to just not select the phy driver and leave that up to the defconfig. Do the same for the other PHY and memory drivers selected here as well for consistency.

Fixes a481bf2f0ca4 ("drm/mediatek: Separate mtk_hdmi_phy to an independent module")
---
 drivers/gpu/drm/mediatek/Kconfig | 5 -----
 1 file changed, 5 deletions(-)
drivers/gpu/drm/mediatek/Kconfig +0 -5
index 1c2f56b75716..1d4f20a4f265 100644
@@ -15,9 +15,6 @@ config DRM_MEDIATEK
 	select DRM_BRIDGE_CONNECTOR
 	select DRM_MIPI_DSI
 	select DRM_PANEL
-	select MEMORY
-	select MTK_SMI
-	select PHY_MTK_MIPI_DSI
 	select VIDEOMODE_HELPERS
 	help
 	  Choose this option if you have a Mediatek SoCs.
@@ -28,7 +25,6 @@ config DRM_MEDIATEK
 config DRM_MEDIATEK_DP
 	tristate "DRM DPTX Support for MediaTek SoCs"
 	depends on DRM_MEDIATEK
-	select PHY_MTK_DP
 	select DRM_DISPLAY_HELPER
 	select DRM_DISPLAY_DP_HELPER
 	select DRM_DISPLAY_DP_AUX_BUS
@@ -39,6 +35,5 @@ config DRM_MEDIATEK_HDMI
 	tristate "DRM HDMI Support for Mediatek SoCs"
 	depends on DRM_MEDIATEK
 	select SND_SOC_HDMI_CODEC if SND_SOC
-	select PHY_MTK_HDMI
 	help
 	  DRM/KMS HDMI driver for Mediatek SoCs
Signature · 1 line
2.39.5
#1 lore raw

Hi Arnd,

Quoted 16 lines · Arnd Bergmann

From: Arnd Bergmann <[email protected]>

The PHY portion of the mediatek hdmi driver was originally part of the driver it self and later split out into drivers/phy, which a 'select' to keep the prior behavior.

However, this leads to build failures when the PHY driver cannot be built:

WARNING: unmet direct dependencies detected for PHY_MTK_HDMI
Depends on [n]: (ARCH_MEDIATEK || COMPILE_TEST [=y]) && COMMON_CLK [=y] && OF [=y] && REGULATOR [=n] Selected by [m]:
- DRM_MEDIATEK_HDMI [=m] && HAS_IOMEM [=y] && DRM [=m] && DRM_MEDIATEK [=m]
ERROR: modpost: "devm_regulator_register" [drivers/phy/mediatek/phy-mtk-hdmi-drv.ko] undefined!
ERROR: modpost: "rdev_get_drvdata" [drivers/phy/mediatek/phy-mtk-hdmi-drv.ko] undefined!

Quoted 6 lines

The best option here is to just not select the phy driver and leave that up to the defconfig. Do the same for the other PHY and memory drivers selected here as well for consistency.

Fixes a481bf2f0ca4 ("drm/mediatek: Separate mtk_hdmi_phy to an independent module")

Thanks for your patch!

Quoted 21 lines
drivers/gpu/drm/mediatek/Kconfig +0 -4
@@ -15,9 +15,6 @@ config DRM_MEDIATEK
        select DRM_BRIDGE_CONNECTOR
        select DRM_MIPI_DSI
        select DRM_PANEL
-       select MEMORY
-       select MTK_SMI
-       select PHY_MTK_MIPI_DSI
        select VIDEOMODE_HELPERS
        help
          Choose this option if you have a Mediatek SoCs.
@@ -28,7 +25,6 @@ config DRM_MEDIATEK
 config DRM_MEDIATEK_DP
        tristate "DRM DPTX Support for MediaTek SoCs"
        depends on DRM_MEDIATEK
-       select PHY_MTK_DP
        select DRM_DISPLAY_HELPER
        select DRM_DISPLAY_DP_HELPER
        select DRM_DISPLAY_DP_AUX_BUS

drivers/gpu/drm/mediatek/Kconfig config DRM_MEDIATEK_HDMI · line 39

Quoted 6 lines
drivers/gpu/drm/mediatek/Kconfig +0 -1
@@ -39,6 +35,5 @@ config DRM_MEDIATEK_HDMI
        tristate "DRM HDMI Support for Mediatek SoCs"
        depends on DRM_MEDIATEK
        select SND_SOC_HDMI_CODEC if SND_SOC
-       select PHY_MTK_HDMI
        help
          DRM/KMS HDMI driver for Mediatek SoCs

What about replacing select by imply?

Alternatively, PHY_MTK_HDMI could default to DRM_MEDIATEK || DRM_MEDIATEK_DP || DRM_MEDIATEK_HDMI.

Gr{oetje,eeting}s,

Geert

Signature · 5 lines
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
#2 lore raw
In reply to Arnd Bergmann

Il 18/12/24 09:58, Arnd Bergmann ha scritto:

Quoted 16 lines

From: Arnd Bergmann <[email protected]>

The PHY portion of the mediatek hdmi driver was originally part of the driver it self and later split out into drivers/phy, which a 'select' to keep the prior behavior.

However, this leads to build failures when the PHY driver cannot be built:

WARNING: unmet direct dependencies detected for PHY_MTK_HDMI
Depends on [n]: (ARCH_MEDIATEK || COMPILE_TEST [=y]) && COMMON_CLK [=y] && OF [=y] && REGULATOR [=n] Selected by [m]:
- DRM_MEDIATEK_HDMI [=m] && HAS_IOMEM [=y] && DRM [=m] && DRM_MEDIATEK [=m]
ERROR: modpost: "devm_regulator_register" [drivers/phy/mediatek/phy-mtk-hdmi-drv.ko] undefined!
ERROR: modpost: "rdev_get_drvdata" [drivers/phy/mediatek/phy-mtk-hdmi-drv.ko] undefined!

Quoted 6 lines

The best option here is to just not select the phy driver and leave that up to the defconfig. Do the same for the other PHY and memory drivers selected here as well for consistency.

Fixes a481bf2f0ca4 ("drm/mediatek: Separate mtk_hdmi_phy to an independent module")

The problem is - no PHY no party, it's not going to work without... but I get the reasons behind this change.

Are we sure that we can't just add a depends on PHY_MTK_xxxx (or extend depends on DRM_MEDIATEK && PHY_MTK_xxx)?

Cheers,
Angelo

Quoted 33 lines
---
  drivers/gpu/drm/mediatek/Kconfig | 5 -----
  1 file changed, 5 deletions(-)
drivers/gpu/drm/mediatek/Kconfig +0 -5
index 1c2f56b75716..1d4f20a4f265 100644
@@ -15,9 +15,6 @@ config DRM_MEDIATEK
  	select DRM_BRIDGE_CONNECTOR
  	select DRM_MIPI_DSI
  	select DRM_PANEL
-	select MEMORY
-	select MTK_SMI
-	select PHY_MTK_MIPI_DSI
  	select VIDEOMODE_HELPERS
  	help
  	  Choose this option if you have a Mediatek SoCs.
@@ -28,7 +25,6 @@ config DRM_MEDIATEK
  config DRM_MEDIATEK_DP
  	tristate "DRM DPTX Support for MediaTek SoCs"
  	depends on DRM_MEDIATEK
-	select PHY_MTK_DP
  	select DRM_DISPLAY_HELPER
  	select DRM_DISPLAY_DP_HELPER
  	select DRM_DISPLAY_DP_AUX_BUS
@@ -39,6 +35,5 @@ config DRM_MEDIATEK_HDMI
  	tristate "DRM HDMI Support for Mediatek SoCs"
  	depends on DRM_MEDIATEK
  	select SND_SOC_HDMI_CODEC if SND_SOC
-	select PHY_MTK_HDMI
  	help
  	  DRM/KMS HDMI driver for Mediatek SoCs
#3 lore raw
Quoted 9 lines · AngeloGioacchino Del Regno

Il 18/12/24 09:58, Arnd Bergmann ha scritto:

Quoted 1 line

From: Arnd Bergmann <[email protected]>

The problem is - no PHY no party, it's not going to work without... but I get the
reasons behind this change.

Are we sure that we can't just add a depends on PHY_MTK_xxxx (or extend depends on DRM_MEDIATEK && PHY_MTK_xxx)?

Doing this wouldn't cause any problems, but it also doesn't really help much, you just have to know which devices are present and enable all their drivers anyway.

We used to just select all drivers from arch/arm/mach-*/Kconfig on some older platforms, but this was too much of a hassle.

Arnd

maintainer Reviewed-by
#4 lore raw

Il 18/12/24 12:44, Arnd Bergmann ha scritto:

Quoted 11 lines · AngeloGioacchino Del Regno
Quoted 9 lines

Il 18/12/24 09:58, Arnd Bergmann ha scritto:

Quoted 1 line

From: Arnd Bergmann <[email protected]>

The problem is - no PHY no party, it's not going to work without... but I get the
reasons behind this change.

Are we sure that we can't just add a depends on PHY_MTK_xxxx (or extend depends on DRM_MEDIATEK && PHY_MTK_xxx)?

Quoted 8 lines

Doing this wouldn't cause any problems, but it also doesn't really help much, you just have to know which devices are present and enable all their drivers anyway.

We used to just select all drivers from arch/arm/mach-*/Kconfig on some older platforms, but this was too much of a hassle.

Arnd

Reviewed-by on v1 1/1
#5 lore raw
In reply to Arnd Bergmann

Hi, Arnd:

Quoted 19 lines · Arnd Bergmann

External email : Please do not click links or open attachments until you have verified the sender or the content.

From: Arnd Bergmann <[email protected]>

The PHY portion of the mediatek hdmi driver was originally part of the driver it self and later split out into drivers/phy, which a 'select' to keep the prior behavior.

However, this leads to build failures when the PHY driver cannot be built:

WARNING: unmet direct dependencies detected for PHY_MTK_HDMI
Depends on [n]: (ARCH_MEDIATEK || COMPILE_TEST [=y]) && COMMON_CLK [=y] && OF [=y] && REGULATOR [=n] Selected by [m]:
- DRM_MEDIATEK_HDMI [=m] && HAS_IOMEM [=y] && DRM [=m] && DRM_MEDIATEK [=m]
ERROR: modpost: "devm_regulator_register" [drivers/phy/mediatek/phy-mtk-hdmi-drv.ko] undefined!
ERROR: modpost: "rdev_get_drvdata" [drivers/phy/mediatek/phy-mtk-hdmi-drv.ko] undefined!

Quoted 3 lines

The best option here is to just not select the phy driver and leave that up to the defconfig. Do the same for the other PHY and memory drivers selected here as well for consistency.

Quoted 39 lines
Fixes a481bf2f0ca4 ("drm/mediatek: Separate mtk_hdmi_phy to an independent module")
---
 drivers/gpu/drm/mediatek/Kconfig | 5 -----
 1 file changed, 5 deletions(-)
drivers/gpu/drm/mediatek/Kconfig +0 -6
index 1c2f56b75716..1d4f20a4f265 100644
@@ -15,9 +15,6 @@ config DRM_MEDIATEK
        select DRM_BRIDGE_CONNECTOR
        select DRM_MIPI_DSI
        select DRM_PANEL
-       select MEMORY
-       select MTK_SMI
-       select PHY_MTK_MIPI_DSI
        select VIDEOMODE_HELPERS
        help
          Choose this option if you have a Mediatek SoCs.
@@ -28,7 +25,6 @@ config DRM_MEDIATEK
 config DRM_MEDIATEK_DP
        tristate "DRM DPTX Support for MediaTek SoCs"
        depends on DRM_MEDIATEK
-       select PHY_MTK_DP
        select DRM_DISPLAY_HELPER
        select DRM_DISPLAY_DP_HELPER
        select DRM_DISPLAY_DP_AUX_BUS
@@ -39,6 +35,5 @@ config DRM_MEDIATEK_HDMI
        tristate "DRM HDMI Support for Mediatek SoCs"
        depends on DRM_MEDIATEK
        select SND_SOC_HDMI_CODEC if SND_SOC
-       select PHY_MTK_HDMI
        help
          DRM/KMS HDMI driver for Mediatek SoCs
--

2.39.5

maintainer Applied
#6 lore raw
In reply to Arnd Bergmann

Hi, Arnd:

Arnd Bergmann <[email protected]> 於 2024年12月18日 週三 下午4:58寫道:

Quoted 17 lines

From: Arnd Bergmann <[email protected]>

The PHY portion of the mediatek hdmi driver was originally part of the driver it self and later split out into drivers/phy, which a 'select' to keep the prior behavior.

However, this leads to build failures when the PHY driver cannot be built:

WARNING: unmet direct dependencies detected for PHY_MTK_HDMI
Depends on [n]: (ARCH_MEDIATEK || COMPILE_TEST [=y]) && COMMON_CLK [=y] && OF [=y] && REGULATOR [=n] Selected by [m]:
- DRM_MEDIATEK_HDMI [=m] && HAS_IOMEM [=y] && DRM [=m] && DRM_MEDIATEK [=m]
ERROR: modpost: "devm_regulator_register" [drivers/phy/mediatek/phy-mtk-hdmi-drv.ko] undefined!
ERROR: modpost: "rdev_get_drvdata" [drivers/phy/mediatek/phy-mtk-hdmi-drv.ko] undefined!

Quoted 3 lines

The best option here is to just not select the phy driver and leave that up to the defconfig. Do the same for the other PHY and memory drivers selected here as well for consistency.

Applied to mediatek-drm-fixes [1], thanks.

[1] https://git.kernel.org/pub/scm/linux/kernel/git/chunkuang.hu/linux.git/log/?h=mediatek-drm-fixes

Regards,
Chun-Kuang.

Quoted 39 lines
Fixes a481bf2f0ca4 ("drm/mediatek: Separate mtk_hdmi_phy to an independent module")
---
 drivers/gpu/drm/mediatek/Kconfig | 5 -----
 1 file changed, 5 deletions(-)
drivers/gpu/drm/mediatek/Kconfig +0 -6
index 1c2f56b75716..1d4f20a4f265 100644
@@ -15,9 +15,6 @@ config DRM_MEDIATEK
        select DRM_BRIDGE_CONNECTOR
        select DRM_MIPI_DSI
        select DRM_PANEL
-       select MEMORY
-       select MTK_SMI
-       select PHY_MTK_MIPI_DSI
        select VIDEOMODE_HELPERS
        help
          Choose this option if you have a Mediatek SoCs.
@@ -28,7 +25,6 @@ config DRM_MEDIATEK
 config DRM_MEDIATEK_DP
        tristate "DRM DPTX Support for MediaTek SoCs"
        depends on DRM_MEDIATEK
-       select PHY_MTK_DP
        select DRM_DISPLAY_HELPER
        select DRM_DISPLAY_DP_HELPER
        select DRM_DISPLAY_DP_AUX_BUS
@@ -39,6 +35,5 @@ config DRM_MEDIATEK_HDMI
        tristate "DRM HDMI Support for Mediatek SoCs"
        depends on DRM_MEDIATEK
        select SND_SOC_HDMI_CODEC if SND_SOC
-       select PHY_MTK_HDMI
        help
          DRM/KMS HDMI driver for Mediatek SoCs
--

2.39.5