Re: [PATCH] net: dsa: MxL862xx: don't force-enable MAXLINEAR_GPHY

From: Arnd Bergmann

Date: Mon Feb 16 2026 - 07:27:06 EST


On Mon, Feb 16, 2026, at 13:15, Daniel Golle wrote:
> On Mon, Feb 16, 2026 at 11:55:17AM +0100, Arnd Bergmann wrote:
>> From: Arnd Bergmann <arnd@xxxxxxxx>
>>
>> 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'
>
> 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