netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH net-next] net: pcs-xpcs: depend on MDIO_BUS instead of selecting it
@ 2020-10-15 20:00 Ioana Ciornei
  2020-10-16 23:56 ` Jakub Kicinski
  0 siblings, 1 reply; 2+ messages in thread
From: Ioana Ciornei @ 2020-10-15 20:00 UTC (permalink / raw)
  To: davem, kuba, netdev
  Cc: rdunlap, Jose.Abreu, andrew, sfr, linux-next, Ioana Ciornei

The below compile time error can be seen when PHYLIB is configured as a
module.

 ld: drivers/net/pcs/pcs-xpcs.o: in function `xpcs_read':
 pcs-xpcs.c:(.text+0x29): undefined reference to `mdiobus_read'
 ld: drivers/net/pcs/pcs-xpcs.o: in function `xpcs_soft_reset.constprop.7':
 pcs-xpcs.c:(.text+0x80): undefined reference to `mdiobus_write'
 ld: drivers/net/pcs/pcs-xpcs.o: in function `xpcs_config_aneg':
 pcs-xpcs.c:(.text+0x318): undefined reference to `mdiobus_write'
 ld: pcs-xpcs.c:(.text+0x38e): undefined reference to `mdiobus_write'
 ld: pcs-xpcs.c:(.text+0x3eb): undefined reference to `mdiobus_write'
 ld: pcs-xpcs.c:(.text+0x437): undefined reference to `mdiobus_write'
 ld: drivers/net/pcs/pcs-xpcs.o:pcs-xpcs.c:(.text+0xb1e): more undefined references to `mdiobus_write' follow

PHYLIB being a module leads to MDIO_BUS being a module as well while the
XPCS is still built-in. What should happen in this configuration is that
PCS_XPCS should be forced to build as module. However, that select only
acts in the opposite way so we should turn it into a depends.

Fix this up by explicitly depending on MDIO_BUS.

Reported-by: Randy Dunlap <rdunlap@infradead.org>
Acked-by: Randy Dunlap <rdunlap@infradead.org> # build-tested
Fixes: 2fa4e4b799e1 ("net: pcs: Move XPCS into new PCS subdirectory")
Signed-off-by: Ioana Ciornei <ioana.ciornei@nxp.com>
---
 drivers/net/pcs/Kconfig | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/drivers/net/pcs/Kconfig b/drivers/net/pcs/Kconfig
index 074fb3f5db18..22ba7b0b476d 100644
--- a/drivers/net/pcs/Kconfig
+++ b/drivers/net/pcs/Kconfig
@@ -7,8 +7,7 @@ menu "PCS device drivers"
 
 config PCS_XPCS
 	tristate "Synopsys DesignWare XPCS controller"
-	select MDIO_BUS
-	depends on MDIO_DEVICE
+	depends on MDIO_DEVICE && MDIO_BUS
 	help
 	  This module provides helper functions for Synopsys DesignWare XPCS
 	  controllers.
-- 
2.17.1


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH net-next] net: pcs-xpcs: depend on MDIO_BUS instead of selecting it
  2020-10-15 20:00 [PATCH net-next] net: pcs-xpcs: depend on MDIO_BUS instead of selecting it Ioana Ciornei
@ 2020-10-16 23:56 ` Jakub Kicinski
  0 siblings, 0 replies; 2+ messages in thread
From: Jakub Kicinski @ 2020-10-16 23:56 UTC (permalink / raw)
  To: Ioana Ciornei; +Cc: davem, netdev, rdunlap, Jose.Abreu, andrew, sfr, linux-next

On Thu, 15 Oct 2020 23:00:23 +0300 Ioana Ciornei wrote:
> The below compile time error can be seen when PHYLIB is configured as a
> module.
> 
>  ld: drivers/net/pcs/pcs-xpcs.o: in function `xpcs_read':
>  pcs-xpcs.c:(.text+0x29): undefined reference to `mdiobus_read'
>  ld: drivers/net/pcs/pcs-xpcs.o: in function `xpcs_soft_reset.constprop.7':
>  pcs-xpcs.c:(.text+0x80): undefined reference to `mdiobus_write'
>  ld: drivers/net/pcs/pcs-xpcs.o: in function `xpcs_config_aneg':
>  pcs-xpcs.c:(.text+0x318): undefined reference to `mdiobus_write'
>  ld: pcs-xpcs.c:(.text+0x38e): undefined reference to `mdiobus_write'
>  ld: pcs-xpcs.c:(.text+0x3eb): undefined reference to `mdiobus_write'
>  ld: pcs-xpcs.c:(.text+0x437): undefined reference to `mdiobus_write'
>  ld: drivers/net/pcs/pcs-xpcs.o:pcs-xpcs.c:(.text+0xb1e): more undefined references to `mdiobus_write' follow
> 
> PHYLIB being a module leads to MDIO_BUS being a module as well while the
> XPCS is still built-in. What should happen in this configuration is that
> PCS_XPCS should be forced to build as module. However, that select only
> acts in the opposite way so we should turn it into a depends.
> 
> Fix this up by explicitly depending on MDIO_BUS.
> 
> Reported-by: Randy Dunlap <rdunlap@infradead.org>
> Acked-by: Randy Dunlap <rdunlap@infradead.org> # build-tested
> Fixes: 2fa4e4b799e1 ("net: pcs: Move XPCS into new PCS subdirectory")
> Signed-off-by: Ioana Ciornei <ioana.ciornei@nxp.com>

Applied, thanks!

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2020-10-17  0:04 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-10-15 20:00 [PATCH net-next] net: pcs-xpcs: depend on MDIO_BUS instead of selecting it Ioana Ciornei
2020-10-16 23:56 ` Jakub Kicinski

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).