net: ethernet: Add missing depends on MDIO_DEVRES
Andrew Lunn
maintainerPATCH 1/1 net: ethernet: Add missing depends on MDIO_DEVRES
A number of MDIO drivers make use of devm_mdiobus_alloc_size(). This is only available when CONFIG_MDIO_DEVRES is enabled. Add missing depends or selects, depending on if there are circular dependencies or not. This avoids linker errors, especially for randconfig builds.
--- drivers/net/ethernet/freescale/Kconfig | 1 + drivers/net/ethernet/freescale/enetc/Kconfig | 1 + drivers/net/ethernet/marvell/Kconfig | 1 + drivers/net/ethernet/qualcomm/Kconfig | 1 + drivers/net/mdio/Kconfig | 3 +++ 5 files changed, 7 insertions(+)
drivers/net/ethernet/freescale/Kconfig +1 -0
@@ -71,6 +71,7 @@ config FSL_XGMAC_MDIO tristate "Freescale XGMAC MDIO" select PHYLIB depends on OF + select MDIO_DEVRES select OF_MDIO help This driver supports the MDIO bus on the Fman 10G Ethernet MACs, and
drivers/net/ethernet/freescale/enetc/Kconfig +1 -0
@@ -10,6 +10,7 @@ config FSL_ENETC_CORE config FSL_ENETC tristate "ENETC PF driver" depends on PCI_MSI + select MDIO_DEVRES select FSL_ENETC_CORE select FSL_ENETC_IERB select FSL_ENETC_MDIO
drivers/net/ethernet/marvell/Kconfig +1 -0
@@ -34,6 +34,7 @@ config MV643XX_ETH config MVMDIO tristate "Marvell MDIO interface support" depends on HAS_IOMEM + select MDIO_DEVRES select PHYLIB help This driver supports the MDIO interface found in the network
drivers/net/ethernet/qualcomm/Kconfig +1 -0
@@ -52,6 +52,7 @@ config QCOM_EMAC depends on HAS_DMA && HAS_IOMEM select CRC32 select PHYLIB + select MDIO_DEVRES help This driver supports the Qualcomm Technologies, Inc. Gigabit Ethernet Media Access Controller (EMAC). The controller
drivers/net/mdio/Kconfig +3 -0
@@ -65,6 +65,7 @@ config MDIO_ASPEED tristate "ASPEED MDIO bus controller" depends on ARCH_ASPEED || COMPILE_TEST depends on OF_MDIO && HAS_IOMEM + depends on MDIO_DEVRES help This module provides a driver for the independent MDIO bus controllers found in the ASPEED AST2600 SoC. This is a driver for the
@@ -170,6 +171,7 @@ config MDIO_IPQ4019 tristate "Qualcomm IPQ4019 MDIO interface support" depends on HAS_IOMEM && OF_MDIO depends on COMMON_CLK + depends on MDIO_DEVRES help This driver supports the MDIO interface found in Qualcomm IPQ40xx, IPQ60xx, IPQ807x and IPQ50xx series Soc-s.
@@ -178,6 +180,7 @@ config MDIO_IPQ8064 tristate "Qualcomm IPQ8064 MDIO interface support" depends on HAS_IOMEM && OF_MDIO depends on MFD_SYSCON + depends on MDIO_DEVRES help This driver supports the MDIO interface found in the network interface units of the IPQ8064 SoC
Signature · 1 line
2.40.0
Quoted 19 lines · Andrew Lunn
A number of MDIO drivers make use of
devm_mdiobus_alloc_size(). This is only available whenCONFIG_MDIO_DEVRESis enabled. Add missing depends or selects, depending on if there are circular dependencies or not. This avoids linker errors, especially for randconfig builds.Signed-off-by Andrew Lunn <[email protected]>--- drivers/net/ethernet/freescale/Kconfig | 1 + drivers/net/ethernet/freescale/enetc/Kconfig | 1 + drivers/net/ethernet/marvell/Kconfig | 1 + drivers/net/ethernet/qualcomm/Kconfig | 1 + drivers/net/mdio/Kconfig | 3 +++ 5 files changed, 7 insertions(+)drivers/net/ethernet/freescale/Kconfig +0
-0
drivers/net/ethernet/freescale/Kconfig config FSL_XGMAC_MDIO · line 77
Quoted 7 lines
drivers/net/ethernet/freescale/Kconfig +1
-0@@ -71,6 +71,7 @@ config FSL_XGMAC_MDIO tristate "Freescale XGMAC MDIO" select PHYLIB depends on OF + select MDIO_DEVRES select OF_MDIO help This driver supports the MDIO bus on the Fman 10G Ethernet MACs, and
Perhaps this is a good idea, but I'd like to mention that I don't think it is strictly necessary as:
1. FSL_XGMAC_MDIO selects PHYLIB.
2. And PHYLIB selects MDIO_DEVRES.
Likewise for FSL_ENETC, MV643XX_ETH, QCOM_EMAC.
Is there some combination of N/y/m that defeats my logic here? I feel like I am missing something obvious.
Quoted 41 lines
drivers/net/ethernet/freescale/enetc/Kconfig +1
-0@@ -10,6 +10,7 @@ config FSL_ENETC_CORE config FSL_ENETC tristate "ENETC PF driver" depends on PCI_MSI + select MDIO_DEVRES select FSL_ENETC_CORE select FSL_ENETC_IERB select FSL_ENETC_MDIOdrivers/net/ethernet/marvell/Kconfig +1
-0@@ -34,6 +34,7 @@ config MV643XX_ETH config MVMDIO tristate "Marvell MDIO interface support" depends on HAS_IOMEM + select MDIO_DEVRES select PHYLIB help This driver supports the MDIO interface found in the networkdrivers/net/ethernet/qualcomm/Kconfig +1
-0@@ -52,6 +52,7 @@ config QCOM_EMAC depends on HAS_DMA && HAS_IOMEM select CRC32 select PHYLIB + select MDIO_DEVRES help This driver supports the Qualcomm Technologies, Inc. Gigabit Ethernet Media Access Controller (EMAC). The controllerdrivers/net/mdio/Kconfig +0
-0
drivers/net/mdio/Kconfig config MDIO_ASPEED · line 71
Quoted 7 lines
drivers/net/mdio/Kconfig +1
-0@@ -65,6 +65,7 @@ config MDIO_ASPEED tristate "ASPEED MDIO bus controller" depends on ARCH_ASPEED || COMPILE_TEST depends on OF_MDIO && HAS_IOMEM + depends on MDIO_DEVRES help This module provides a driver for the independent MDIO bus controllers found in the ASPEED AST2600 SoC. This is a driver for the
Again, I'm not sure if this is necessary:
1. MDIO_ASPEED depends on OF_MDIO
2. OF_MDIO depends on PHYLIB
3. PHYLIB selects MDIO_DEVRES
Likewise for MDIO_IPQ4019 and MDIO_IPQ8064.
Quoted 19 lines
drivers/net/mdio/Kconfig +2
-0@@ -170,6 +171,7 @@ config MDIO_IPQ4019 tristate "Qualcomm IPQ4019 MDIO interface support" depends on HAS_IOMEM && OF_MDIO depends on COMMON_CLK + depends on MDIO_DEVRES help This driver supports the MDIO interface found in Qualcomm IPQ40xx, IPQ60xx, IPQ807x and IPQ50xx series Soc-s.@@ -178,6 +180,7 @@ config MDIO_IPQ8064 tristate "Qualcomm IPQ8064 MDIO interface support" depends on HAS_IOMEM && OF_MDIO depends on MFD_SYSCON + depends on MDIO_DEVRES help This driver supports the MDIO interface found in the network interface units of the IPQ8064 SoCSignature · 1 line
2.40.0
Andrew Lunn
maintainerQuoted 31 lines · Simon Horman
Quoted 19 lines · Andrew Lunn
A number of MDIO drivers make use of
devm_mdiobus_alloc_size(). This is only available whenCONFIG_MDIO_DEVRESis enabled. Add missing depends or selects, depending on if there are circular dependencies or not. This avoids linker errors, especially for randconfig builds.Signed-off-by Andrew Lunn <[email protected]>--- drivers/net/ethernet/freescale/Kconfig | 1 + drivers/net/ethernet/freescale/enetc/Kconfig | 1 + drivers/net/ethernet/marvell/Kconfig | 1 + drivers/net/ethernet/qualcomm/Kconfig | 1 + drivers/net/mdio/Kconfig | 3 +++ 5 files changed, 7 insertions(+)drivers/net/ethernet/freescale/Kconfig +0
-0drivers/net/ethernet/freescale/Kconfig config FSL_XGMAC_MDIO · line 77
Quoted 7 lines
drivers/net/ethernet/freescale/Kconfig +1
-0@@ -71,6 +71,7 @@ config FSL_XGMAC_MDIO tristate "Freescale XGMAC MDIO" select PHYLIB depends on OF + select MDIO_DEVRES select OF_MDIO help This driver supports the MDIO bus on the Fman 10G Ethernet MACs, andPerhaps this is a good idea, but I'd like to mention that I don't think it is strictly necessary as:
Quoted 7 lines
1.
FSL_XGMAC_MDIOselects PHYLIB.
2. And PHYLIB selectsMDIO_DEVRES.Likewise for
FSL_ENETC,MV643XX_ETH,QCOM_EMAC.Is there some combination of N/y/m that defeats my logic here? I feel like I am missing something obvious.
I keep getting 0-day randconfig build warning about kernel configuration which don't link. It seems to get worse when we add in support of MAC and PHY LEDs. My guess is, the additional dependencies for LEDs upsets the conflict resolution engine, and it comes out with a different solution. select is a soft dependency. It is more a hint, and can be ignored. And when a randconfig kernel fails to build, MDIO_DEVRES is disabled.
Where possible, i've added a depends on, which is a much stronger dependency. But that can lead to circular dependencies, which kconfig cannot handle. In such cases, i've added selects. Maybe having more selects for a config option will influence it to find a solution which has MDIO_DEVRES enabled?
I've had this patch in a github tree for a week or more, and 0-day has not yet returned any randconfig build errors. But i've not combined it with the LED code.
Andrew
Quoted 54 lines · Andrew Lunn
Quoted 31 lines · Simon Horman
Quoted 19 lines · Andrew Lunn
A number of MDIO drivers make use of
devm_mdiobus_alloc_size(). This is only available whenCONFIG_MDIO_DEVRESis enabled. Add missing depends or selects, depending on if there are circular dependencies or not. This avoids linker errors, especially for randconfig builds.Signed-off-by Andrew Lunn <[email protected]>--- drivers/net/ethernet/freescale/Kconfig | 1 + drivers/net/ethernet/freescale/enetc/Kconfig | 1 + drivers/net/ethernet/marvell/Kconfig | 1 + drivers/net/ethernet/qualcomm/Kconfig | 1 + drivers/net/mdio/Kconfig | 3 +++ 5 files changed, 7 insertions(+)drivers/net/ethernet/freescale/Kconfig +0
-0drivers/net/ethernet/freescale/Kconfig config FSL_XGMAC_MDIO · line 77
Quoted 7 lines
drivers/net/ethernet/freescale/Kconfig +1
-0@@ -71,6 +71,7 @@ config FSL_XGMAC_MDIO tristate "Freescale XGMAC MDIO" select PHYLIB depends on OF + select MDIO_DEVRES select OF_MDIO help This driver supports the MDIO bus on the Fman 10G Ethernet MACs, andPerhaps this is a good idea, but I'd like to mention that I don't think it is strictly necessary as:
Quoted 7 lines
1.
FSL_XGMAC_MDIOselects PHYLIB.
2. And PHYLIB selectsMDIO_DEVRES.Likewise for
FSL_ENETC,MV643XX_ETH,QCOM_EMAC.Is there some combination of N/y/m that defeats my logic here? I feel like I am missing something obvious.
I keep getting 0-day randconfig build warning about kernel configuration which don't link. It seems to get worse when we add in support of MAC and PHY LEDs. My guess is, the additional dependencies for LEDs upsets the conflict resolution engine, and it comes out with a different solution.
selectis a soft dependency. It is more a hint, and can be ignored. And when a randconfig kernel fails to build,MDIO_DEVRESis disabled.Where possible, i've added a
depends on, which is a much stronger dependency. But that can lead to circular dependencies, which kconfig cannot handle. In such cases, i've added selects. Maybe having more selects for a config option will influence it to find a solution which hasMDIO_DEVRESenabled?
Quoted 3 lines
I've had this patch in a github tree for a week or more, and 0-day has not yet returned any randconfig build errors. But i've not combined it with the LED code.
Thanks Andrew,
I'm certainly not opposed to this patch.
More curious as to what situations (configs) the problems arise in.
Quoted 48 lines · Andrew Lunn
Quoted 31 lines · Simon Horman
Quoted 19 lines · Andrew Lunn
A number of MDIO drivers make use of
devm_mdiobus_alloc_size(). This is only available whenCONFIG_MDIO_DEVRESis enabled. Add missing depends or selects, depending on if there are circular dependencies or not. This avoids linker errors, especially for randconfig builds.Signed-off-by Andrew Lunn <[email protected]>--- drivers/net/ethernet/freescale/Kconfig | 1 + drivers/net/ethernet/freescale/enetc/Kconfig | 1 + drivers/net/ethernet/marvell/Kconfig | 1 + drivers/net/ethernet/qualcomm/Kconfig | 1 + drivers/net/mdio/Kconfig | 3 +++ 5 files changed, 7 insertions(+)drivers/net/ethernet/freescale/Kconfig +0
-0drivers/net/ethernet/freescale/Kconfig config FSL_XGMAC_MDIO · line 77
Quoted 7 lines
drivers/net/ethernet/freescale/Kconfig +1
-0@@ -71,6 +71,7 @@ config FSL_XGMAC_MDIO tristate "Freescale XGMAC MDIO" select PHYLIB depends on OF + select MDIO_DEVRES select OF_MDIO help This driver supports the MDIO bus on the Fman 10G Ethernet MACs, andPerhaps this is a good idea, but I'd like to mention that I don't think it is strictly necessary as:
Quoted 7 lines
1.
FSL_XGMAC_MDIOselects PHYLIB.
2. And PHYLIB selectsMDIO_DEVRES.Likewise for
FSL_ENETC,MV643XX_ETH,QCOM_EMAC.Is there some combination of N/y/m that defeats my logic here? I feel like I am missing something obvious.
I keep getting 0-day randconfig build warning about kernel configuration which don't link. It seems to get worse when we add in support of MAC and PHY LEDs. My guess is, the additional dependencies for LEDs upsets the conflict resolution engine, and it comes out with a different solution.
selectis a soft dependency. It is more a hint, and can be ignored. And when a randconfig kernel fails to build,MDIO_DEVRESis disabled.
Quoted 6 lines
Where possible, i've added a
depends on, which is a much stronger dependency. But that can lead to circular dependencies, which kconfig cannot handle. In such cases, i've added selects. Maybe having more selects for a config option will influence it to find a solution which hasMDIO_DEVRESenabled?
I think this approach is ok. Other alternatives to solve the circular dependency are much more invasive.
Quoted 5 lines
I've had this patch in a github tree for a week or more, and 0-day has not yet returned any randconfig build errors. But i've not combined it with the LED code.
Andrew
Quoted 7 lines · Andrew Lunn
A number of MDIO drivers make use of
devm_mdiobus_alloc_size(). This is only available whenCONFIG_MDIO_DEVRESis enabled. Add missing depends or selects, depending on if there are circular dependencies or not. This avoids linker errors, especially for randconfig builds.Signed-off-by Andrew Lunn <[email protected]>---
This patch was applied to netdev/net-next.git (main) by Jakub Kicinski <[email protected]>:
Hello:
This patch was applied to netdev/net-next.git (main) by Jakub Kicinski <[email protected]>:
Quoted 8 lines · On Sun, 9 Apr 2023 17:02:04 +0200 you wrote:
A number of MDIO drivers make use of
devm_mdiobus_alloc_size(). This is only available whenCONFIG_MDIO_DEVRESis enabled. Add missing depends or selects, depending on if there are circular dependencies or not. This avoids linker errors, especially for randconfig builds.Signed-off-by Andrew Lunn <[email protected]>[...]
Here is the summary with links:
- net: ethernet: Add missing depends on MDIO_DEVRES
https://git.kernel.org/netdev/net-next/c/37f9b2a6c086
You are awesome, thank you!
Signature · 2 lines
Deet-doot-dot, I am a bot. https://korg.docs.kernel.org/patchwork/pwbot.html