Skip to contentSkip to conversation

net: dsa: MxL862xx: don't force-enable MAXLINEAR_GPHY

PATCH Applied Arnd Bergmann 5 participants 12 messages Feb 16 – Feb 21

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

PATCH 1/1 net: dsa: MxL862xx: don't force-enable MAXLINEAR_GPHY

From: Arnd Bergmann <[email protected]>

The newly added dsa driver attempts to enable the corresponding PHY driver, but that one has additional dependencies that may not be available:

WARNING: unmet direct dependencies detected for MAXLINEAR_GPHY
Depends on [m]: NETDEVICES [=y] && PHYLIB [=y] && (HWMON [=m] || HWMON [=m]=n [=n]) Selected by [y]:
- NET_DSA_MXL862 [=y] && NETDEVICES [=y] && NET_DSA [=y]
aarch64-linux-ld: drivers/net/phy/mxl-gpy.o: in function `gpy_probe':
mxl-gpy.c:(.text.gpy_probe+0x13c): undefined reference to `devm_hwmon_device_register_with_info'
aarch64-linux-ld: drivers/net/phy/mxl-gpy.o: in function `gpy_hwmon_read':
mxl-gpy.c:(.text.gpy_hwmon_read+0x48): undefined reference to `polynomial_calc'

There is actually no compile-time dependency, as DSA correctly uses the PHY abstractions. Remove the 'select' statement to reduce the complexity.

Fixes 23794bec1cb6 ("net: dsa: add basic initial driver for MxL862xx switches")
---
 drivers/net/dsa/mxl862xx/Kconfig | 1 -
 1 file changed, 1 deletion(-)
drivers/net/dsa/mxl862xx/Kconfig +0 -1
index 4db7bab21a71..3e772298cc89 100644
@@ -2,7 +2,6 @@
 config NET_DSA_MXL862
 	tristate "MaxLinear MxL862xx"
 	depends on NET_DSA
-	select MAXLINEAR_GPHY
 	select NET_DSA_TAG_MXL_862XX
 	help
 	  This enables support for the MaxLinear MxL862xx switch family.
Signature · 1 line
2.39.5
maintainer Reviewed-by on v1 1/1
#1 lore raw
Quoted 5 lines · Arnd Bergmann

From: Arnd Bergmann <[email protected]>

The newly added dsa driver attempts to enable the corresponding PHY driver, but that one has additional dependencies that may not be available:

Quoted 8 lines

WARNING: unmet direct dependencies detected for MAXLINEAR_GPHY
Depends on [m]: NETDEVICES [=y] && PHYLIB [=y] && (HWMON [=m] || HWMON [=m]=n [=n]) Selected by [y]:
- NET_DSA_MXL862 [=y] && NETDEVICES [=y] && NET_DSA [=y]
aarch64-linux-ld: drivers/net/phy/mxl-gpy.o: in function `gpy_probe':
mxl-gpy.c:(.text.gpy_probe+0x13c): undefined reference to `devm_hwmon_device_register_with_info'
aarch64-linux-ld: drivers/net/phy/mxl-gpy.o: in function `gpy_hwmon_read':
mxl-gpy.c:(.text.gpy_hwmon_read+0x48): undefined reference to `polynomial_calc'

I assume this happens in case CONFIG_MAXLINEAR_GPHY=y and CONFIG_HWMON=m, right?

None of the PHY drivers seem to adequately prevent such situations, which in my opinion would be worth correcting, ie. by preventing any PHY driver using HWMON from being built-in while CONFIG_HWMON=m.

Quoted 6 lines

There is actually no compile-time dependency, as DSA correctly uses the PHY abstractions. Remove the 'select' statement to reduce the complexity.

Fixes 23794bec1cb6 ("net: dsa: add basic initial driver for MxL862xx switches")

As there is no compile-time dependency, this change is fine.

Quoted 19 lines
---
 drivers/net/dsa/mxl862xx/Kconfig | 1 -
 1 file changed, 1 deletion(-)
drivers/net/dsa/mxl862xx/Kconfig +0 -1
index 4db7bab21a71..3e772298cc89 100644
@@ -2,7 +2,6 @@
 config NET_DSA_MXL862
 	tristate "MaxLinear MxL862xx"
 	depends on NET_DSA
-	select MAXLINEAR_GPHY
 	select NET_DSA_TAG_MXL_862XX
 	help
 	  This enables support for the MaxLinear MxL862xx switch family.
Signature · 1 line
2.39.5
#2 lore raw
Quoted 15 lines · Daniel Golle
Quoted 5 lines · Arnd Bergmann

From: Arnd Bergmann <[email protected]>

The newly added dsa driver attempts to enable the corresponding PHY driver, but that one has additional dependencies that may not be available:

Quoted 8 lines

WARNING: unmet direct dependencies detected for MAXLINEAR_GPHY
Depends on [m]: NETDEVICES [=y] && PHYLIB [=y] && (HWMON [=m] || HWMON [=m]=n [=n]) Selected by [y]:
- NET_DSA_MXL862 [=y] && NETDEVICES [=y] && NET_DSA [=y]
aarch64-linux-ld: drivers/net/phy/mxl-gpy.o: in function `gpy_probe':
mxl-gpy.c:(.text.gpy_probe+0x13c): undefined reference to `devm_hwmon_device_register_with_info'
aarch64-linux-ld: drivers/net/phy/mxl-gpy.o: in function `gpy_hwmon_read':
mxl-gpy.c:(.text.gpy_hwmon_read+0x48): undefined reference to `polynomial_calc'

Quoted 6 lines

I assume this happens in case CONFIG_MAXLINEAR_GPHY=y and CONFIG_HWMON=m, right?

None of the PHY drivers seem to adequately prevent such situations, which in my opinion would be worth correcting, ie. by preventing any PHY driver using HWMON from being built-in while CONFIG_HWMON=m.

As far as I can tell, the dependency in MAXLINEAR_GPHY does address this correctly. We are however a bit inconsistent in how we pick the PHY drivers in general. Almost all ethernet drivers expect the user to enable the correct phy separately, but there are a couple of exceptions that force a specific one:

drivers/net/dsa/Kconfig:        select BCM7XXX_PHY
drivers/net/dsa/Kconfig:        select MEDIATEK_GE_PHY
drivers/net/dsa/Kconfig:        select VITESSE_PHY
drivers/net/dsa/realtek/Kconfig:        select REALTEK_PHY

drivers/net/ethernet/8390/Kconfig: select AX88796B_PHY
drivers/net/ethernet/broadcom/Kconfig: select BCM7XXX_PHY drivers/net/ethernet/hisilicon/Kconfig: select MARVELL_PHY drivers/net/ethernet/hisilicon/Kconfig: select MOTORCOMM_PHY drivers/net/ethernet/hisilicon/Kconfig: select REALTEK_PHY

drivers/net/ethernet/micrel/Kconfig:    select MICREL_PHY
drivers/net/ethernet/micrel/Kconfig:    select MICREL_PHY
drivers/net/ethernet/realtek/Kconfig:   select REALTEK_PHY
drivers/net/ethernet/smsc/Kconfig:      select SMSC_PHY
drivers/net/ethernet/stmicro/stmmac/Kconfig:    select MOTORCOMM_PHY
drivers/net/ethernet/wangxun/Kconfig:   select MARVELL_10G_PHY
drivers/net/usb/Kconfig:        select MICROCHIP_PHY
drivers/net/usb/Kconfig:        select AX88796B_PHY
drivers/net/usb/Kconfig:        select SMSC_PHY

We could probably drop most or all of those as well, but that risks regressions with existing defconfig files.

Arnd

maintainer
#3 lore raw
In reply to Daniel Golle
Quoted 15 lines · Daniel Golle
Quoted 5 lines · Arnd Bergmann

From: Arnd Bergmann <[email protected]>

The newly added dsa driver attempts to enable the corresponding PHY driver, but that one has additional dependencies that may not be available:

Quoted 8 lines

WARNING: unmet direct dependencies detected for MAXLINEAR_GPHY
Depends on [m]: NETDEVICES [=y] && PHYLIB [=y] && (HWMON [=m] || HWMON [=m]=n [=n]) Selected by [y]:
- NET_DSA_MXL862 [=y] && NETDEVICES [=y] && NET_DSA [=y]
aarch64-linux-ld: drivers/net/phy/mxl-gpy.o: in function `gpy_probe':
mxl-gpy.c:(.text.gpy_probe+0x13c): undefined reference to `devm_hwmon_device_register_with_info'
aarch64-linux-ld: drivers/net/phy/mxl-gpy.o: in function `gpy_hwmon_read':
mxl-gpy.c:(.text.gpy_hwmon_read+0x48): undefined reference to `polynomial_calc'

Quoted 7 lines

I assume this happens in case CONFIG_MAXLINEAR_GPHY=y and CONFIG_HWMON=m, right?

None of the PHY drivers seem to adequately prevent such situations, which in my opinion would be worth correcting, ie. by preventing any PHY driver using HWMON from being built-in while CONFIG_HWMON=m.

Technically, with "select MAXLINEAR_GPHY", NET_DSA_MXL862 should depend on "depends on HWMON || HWMON=n". That would prevent NET_DSA_MXL862=y and with it MAXLINEAR_GPHY=y.

Maybe it is time to implement dummy functions for hwmon API calls to avoid all this.

Guenter

Quoted 31 lines
Quoted 6 lines

There is actually no compile-time dependency, as DSA correctly uses the PHY abstractions. Remove the 'select' statement to reduce the complexity.

Fixes 23794bec1cb6 ("net: dsa: add basic initial driver for MxL862xx switches")

As there is no compile-time dependency, this change is fine.

Quoted 19 lines
---
  drivers/net/dsa/mxl862xx/Kconfig | 1 -
  1 file changed, 1 deletion(-)
drivers/net/dsa/mxl862xx/Kconfig +0 -1
index 4db7bab21a71..3e772298cc89 100644
@@ -2,7 +2,6 @@
  config NET_DSA_MXL862
  	tristate "MaxLinear MxL862xx"
  	depends on NET_DSA
-	select MAXLINEAR_GPHY
  	select NET_DSA_TAG_MXL_862XX
  	help
  	  This enables support for the MaxLinear MxL862xx switch family.
Signature · 1 line
2.39.5
#4 lore raw
Quoted 8 lines · Guenter Roeck

On 2/16/26 04:15, Daniel Golle wrote:

Technically, with "select MAXLINEAR_GPHY", NET_DSA_MXL862 should depend on "depends on HWMON || HWMON=n". That would prevent NET_DSA_MXL862=y and with it MAXLINEAR_GPHY=y.

Maybe it is time to implement dummy functions for hwmon API calls to avoid all this.

I had considered this when I found the build failure, but I think removing the 'select' here is much better: this simplifies the dependencies, and allows a valid configuration with hwmon and gphy support in a loadable module that would otherwise be impossible.

Arnd

maintainer
#5 lore raw
Quoted 7 lines · Arnd Bergmann
Quoted 6 lines · Guenter Roeck

On 2/16/26 04:15, Daniel Golle wrote:

Technically, with "select MAXLINEAR_GPHY", NET_DSA_MXL862 should depend on "depends on HWMON || HWMON=n". That would prevent NET_DSA_MXL862=y and with it MAXLINEAR_GPHY=y.

Quoted 9 lines
Quoted 2 lines

Maybe it is time to implement dummy functions for hwmon API calls to avoid all this.

I had considered this when I found the build failure, but I think removing the 'select' here is much better: this simplifies the dependencies, and allows a valid configuration with hwmon and gphy support in a loadable module that would otherwise be impossible.

Makes sense. I think I'll move forward with the dummy functions anyway because with that the #ifdefs in drivers are no longer necessary and the "depends on HWMON || HWMON=n" becomes optional.

Guenter

maintainer
#6 lore raw
Quoted 18 lines · Guenter Roeck
Quoted 7 lines · Arnd Bergmann
Quoted 6 lines · Guenter Roeck

On 2/16/26 04:15, Daniel Golle wrote:

Technically, with "select MAXLINEAR_GPHY", NET_DSA_MXL862 should depend on "depends on HWMON || HWMON=n". That would prevent NET_DSA_MXL862=y and with it MAXLINEAR_GPHY=y.

Quoted 9 lines
Quoted 2 lines

Maybe it is time to implement dummy functions for hwmon API calls to avoid all this.

I had considered this when I found the build failure, but I think removing the 'select' here is much better: this simplifies the dependencies, and allows a valid configuration with hwmon and gphy support in a loadable module that would otherwise be impossible.

Quoted 3 lines

Makes sense. I think I'll move forward with the dummy functions anyway because with that the #ifdefs in drivers are no longer necessary and the "depends on HWMON || HWMON=n" becomes optional.

Yes, that would be great and eliminate that whole class of obstacles with some inline no-op stubs in the header.

#7 lore raw
Quoted 11 lines · Daniel Golle
Quoted 10 lines · Guenter Roeck
Quoted 9 lines · Arnd Bergmann
Quoted 8 lines · Guenter Roeck

On 2/16/26 04:15, Daniel Golle wrote:

Technically, with "select MAXLINEAR_GPHY", NET_DSA_MXL862 should depend on "depends on HWMON || HWMON=n". That would prevent NET_DSA_MXL862=y and with it MAXLINEAR_GPHY=y.

Maybe it is time to implement dummy functions for hwmon API calls to avoid all this.

I think I misread this bit earlier, sorry

Quoted 7 lines
Quoted 7 lines
Quoted 6 lines

I had considered this when I found the build failure, but I think removing the 'select' here is much better: this simplifies the dependencies, and allows a valid configuration with hwmon and gphy support in a loadable module that would otherwise be impossible.

Quoted 6 lines
Quoted 3 lines

Makes sense. I think I'll move forward with the dummy functions anyway because with that the #ifdefs in drivers are no longer necessary and the "depends on HWMON || HWMON=n" becomes optional.

Yes, that would be great and eliminate that whole class of obstacles with some inline no-op stubs in the header.

What I meant above is that I had considered and rejected the extra dependencies in the ethernet driver. I don't think there is a good way to add inline helpers. Technically, one could use IS_REACHABLE() here, to stub out the functions when the caller is built-in, but I find that even worse because it replaces a trivial build-time failure with very subtle runtime bug.

Arnd

maintainer
#8 lore raw
Quoted 29 lines · Arnd Bergmann
Quoted 11 lines · Daniel Golle
Quoted 10 lines · Guenter Roeck
Quoted 9 lines · Arnd Bergmann
Quoted 8 lines · Guenter Roeck

On 2/16/26 04:15, Daniel Golle wrote:

Technically, with "select MAXLINEAR_GPHY", NET_DSA_MXL862 should depend on "depends on HWMON || HWMON=n". That would prevent NET_DSA_MXL862=y and with it MAXLINEAR_GPHY=y.

Maybe it is time to implement dummy functions for hwmon API calls to avoid all this.

I think I misread this bit earlier, sorry

Quoted 7 lines
Quoted 7 lines
Quoted 6 lines

I had considered this when I found the build failure, but I think removing the 'select' here is much better: this simplifies the dependencies, and allows a valid configuration with hwmon and gphy support in a loadable module that would otherwise be impossible.

Quoted 6 lines
Quoted 3 lines

Makes sense. I think I'll move forward with the dummy functions anyway because with that the #ifdefs in drivers are no longer necessary and the "depends on HWMON || HWMON=n" becomes optional.

Yes, that would be great and eliminate that whole class of obstacles with some inline no-op stubs in the header.

Quoted 7 lines

What I meant above is that I had considered and rejected the extra dependencies in the ethernet driver. I don't think there is a good way to add inline helpers. Technically, one could use IS_REACHABLE() here, to stub out the functions when the caller is built-in, but I find that even worse because it replaces a trivial build-time failure with very subtle runtime bug.

Lots of kernel APIs have dummy implementations. hwmon isn't really that different to those. Also, arguably, that would not be a subtle runtime bug but a feature.

In this context:

If NET_DSA_MXL862 is enabled but MAXLINEAR_GPHY isn't, does the system still work ?

Guenter

maintainer
#9 lore raw
Quoted 38 lines · Guenter Roeck
Quoted 29 lines · Arnd Bergmann
Quoted 11 lines · Daniel Golle
Quoted 10 lines · Guenter Roeck
Quoted 9 lines · Arnd Bergmann
Quoted 8 lines · Guenter Roeck

On 2/16/26 04:15, Daniel Golle wrote:

Technically, with "select MAXLINEAR_GPHY", NET_DSA_MXL862 should depend on "depends on HWMON || HWMON=n". That would prevent NET_DSA_MXL862=y and with it MAXLINEAR_GPHY=y.

Maybe it is time to implement dummy functions for hwmon API calls to avoid all this.

I think I misread this bit earlier, sorry

Quoted 7 lines
Quoted 7 lines
Quoted 6 lines

I had considered this when I found the build failure, but I think removing the 'select' here is much better: this simplifies the dependencies, and allows a valid configuration with hwmon and gphy support in a loadable module that would otherwise be impossible.

Quoted 6 lines
Quoted 3 lines

Makes sense. I think I'll move forward with the dummy functions anyway because with that the #ifdefs in drivers are no longer necessary and the "depends on HWMON || HWMON=n" becomes optional.

Yes, that would be great and eliminate that whole class of obstacles with some inline no-op stubs in the header.

Quoted 7 lines

What I meant above is that I had considered and rejected the extra dependencies in the ethernet driver. I don't think there is a good way to add inline helpers. Technically, one could use IS_REACHABLE() here, to stub out the functions when the caller is built-in, but I find that even worse because it replaces a trivial build-time failure with very subtle runtime bug.

Quoted 8 lines

Lots of kernel APIs have dummy implementations. hwmon isn't really that different to those. Also, arguably, that would not be a subtle runtime bug but a feature.

In this context:

If NET_DSA_MXL862 is enabled but MAXLINEAR_GPHY isn't, does the system still work ?

The switches supported by NET_DSA_MXL862 come with 5 or 8 twistedpair ports provided by built-in PHYs. For the ports to (fully) work the MAXLINEAR_GPHY driver is required, as without it they would be detected as "Generic PHY".

This is similar to the situation on other DSA switches, and there is apparently no clear rule whether this (runtime) dependency should be treated as depedency in Kconfig which is typically used only to express linking dependencies.

#10 lore raw
In reply to Guenter Roeck
Quoted 12 lines · Guenter Roeck
Quoted 10 lines · Arnd Bergmann
Quoted 1 line · Daniel Golle

On Mon, Feb 16, 2026 at 08:20:41AM -0800, Guenter Roeck wrote:

What I meant above is that I had considered and rejected the extra dependencies in the ethernet driver. I don't think there is a good way to add inline helpers. Technically, one could use IS_REACHABLE() here, to stub out the functions when the caller is built-in, but I find that even worse because it replaces a trivial build-time failure with very subtle runtime bug.

Quoted 3 lines

Lots of kernel APIs have dummy implementations. hwmon isn't really that different to those. Also, arguably, that would not be a subtle runtime bug but a feature.

I would argue that all of them are wrong. I currently count 33 uses of IS_REACHABLE() in header files, which is not a lot, but I would prefer replacing these with proper Kconfig dependencies than to add more for cases we already handle correctly.

Arnd

#11 lore raw
In reply to Arnd Bergmann
This patch was applied to netdev/net.git (main) by Jakub Kicinski <[email protected]>:

Hello:

This patch was applied to netdev/net.git (main)
by Jakub Kicinski <[email protected]>:

Quoted 14 lines · On Mon, 16 Feb 2026 11:55:17 +0100 you wrote:

From: Arnd Bergmann <[email protected]>

The newly added dsa driver attempts to enable the corresponding PHY driver, but that one has additional dependencies that may not be available:

WARNING: unmet direct dependencies detected for MAXLINEAR_GPHY
Depends on [m]: NETDEVICES [=y] && PHYLIB [=y] && (HWMON [=m] || HWMON [=m]=n [=n]) Selected by [y]:
- NET_DSA_MXL862 [=y] && NETDEVICES [=y] && NET_DSA [=y]
aarch64-linux-ld: drivers/net/phy/mxl-gpy.o: in function `gpy_probe':
mxl-gpy.c:(.text.gpy_probe+0x13c): undefined reference to `devm_hwmon_device_register_with_info'
aarch64-linux-ld: drivers/net/phy/mxl-gpy.o: in function `gpy_hwmon_read':
mxl-gpy.c:(.text.gpy_hwmon_read+0x48): undefined reference to `polynomial_calc'

Quoted 1 line

[...]

Here is the summary with links:
- net: dsa: MxL862xx: don't force-enable MAXLINEAR_GPHY

    https://git.kernel.org/netdev/net/c/458c95de5c55

You are awesome, thank you!

Signature · 2 lines
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html