All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] net: freescale: select CONFIG_FIXED_PHY where needed
@ 2020-05-09 12:04 Arnd Bergmann
  2020-05-09 20:24 ` Jakub Kicinski
  0 siblings, 1 reply; 5+ messages in thread
From: Arnd Bergmann @ 2020-05-09 12:04 UTC (permalink / raw)
  To: David S. Miller, Madalin Bucur
  Cc: Arnd Bergmann, Rasmus Villemoes, Timur Tabi, netdev, linux-kernel

I ran into a randconfig build failure with CONFIG_FIXED_PHY=m
and CONFIG_GIANFAR=y:

x86_64-linux-ld: drivers/net/ethernet/freescale/gianfar.o:(.rodata+0x418): undefined reference to `fixed_phy_change_carrier'

It seems the same thing can happen with dpaa and ucc_geth, so change
all three to do an explicit 'select FIXED_PHY'.

The fixed-phy driver actually has an alternative stub function that
theoretically allows building network drivers when fixed-phy is
disabled, but I don't see how that would help here, as the drivers
presumably would not work then.

Signed-off-by: Arnd Bergmann <arnd@arndb.de>
---
 drivers/net/ethernet/freescale/Kconfig      | 2 ++
 drivers/net/ethernet/freescale/dpaa/Kconfig | 1 +
 2 files changed, 3 insertions(+)

diff --git a/drivers/net/ethernet/freescale/Kconfig b/drivers/net/ethernet/freescale/Kconfig
index 2bd7ace0a953..bfc6bfe94d0a 100644
--- a/drivers/net/ethernet/freescale/Kconfig
+++ b/drivers/net/ethernet/freescale/Kconfig
@@ -77,6 +77,7 @@ config UCC_GETH
 	depends on QUICC_ENGINE && PPC32
 	select FSL_PQ_MDIO
 	select PHYLIB
+	select FIXED_PHY
 	---help---
 	  This driver supports the Gigabit Ethernet mode of the QUICC Engine,
 	  which is available on some Freescale SOCs.
@@ -90,6 +91,7 @@ config GIANFAR
 	depends on HAS_DMA
 	select FSL_PQ_MDIO
 	select PHYLIB
+	select FIXED_PHY
 	select CRC32
 	---help---
 	  This driver supports the Gigabit TSEC on the MPC83xx, MPC85xx,
diff --git a/drivers/net/ethernet/freescale/dpaa/Kconfig b/drivers/net/ethernet/freescale/dpaa/Kconfig
index 3b325733a4f8..0a54c7e0e4ae 100644
--- a/drivers/net/ethernet/freescale/dpaa/Kconfig
+++ b/drivers/net/ethernet/freescale/dpaa/Kconfig
@@ -3,6 +3,7 @@ menuconfig FSL_DPAA_ETH
 	tristate "DPAA Ethernet"
 	depends on FSL_DPAA && FSL_FMAN
 	select PHYLIB
+	select FIXED_PHY
 	select FSL_FMAN_MAC
 	---help---
 	  Data Path Acceleration Architecture Ethernet driver,
-- 
2.26.0


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

* Re: [PATCH] net: freescale: select CONFIG_FIXED_PHY where needed
  2020-05-09 12:04 [PATCH] net: freescale: select CONFIG_FIXED_PHY where needed Arnd Bergmann
@ 2020-05-09 20:24 ` Jakub Kicinski
  2020-05-09 21:48   ` Arnd Bergmann
  0 siblings, 1 reply; 5+ messages in thread
From: Jakub Kicinski @ 2020-05-09 20:24 UTC (permalink / raw)
  To: Arnd Bergmann, Florian Fainelli
  Cc: David S. Miller, Madalin Bucur, Rasmus Villemoes, Timur Tabi,
	netdev, linux-kernel, Andrew Lunn

On Sat,  9 May 2020 14:04:52 +0200 Arnd Bergmann wrote:
> I ran into a randconfig build failure with CONFIG_FIXED_PHY=m
> and CONFIG_GIANFAR=y:
> 
> x86_64-linux-ld: drivers/net/ethernet/freescale/gianfar.o:(.rodata+0x418): undefined reference to `fixed_phy_change_carrier'
> 
> It seems the same thing can happen with dpaa and ucc_geth, so change
> all three to do an explicit 'select FIXED_PHY'.
> 
> The fixed-phy driver actually has an alternative stub function that
> theoretically allows building network drivers when fixed-phy is
> disabled, but I don't see how that would help here, as the drivers
> presumably would not work then.
> 
> Signed-off-by: Arnd Bergmann <arnd@arndb.de>

> +	select FIXED_PHY

I think FIXED_PHY needs to be optional, depends on what the board has
connected to the MAC it may not be needed, right PHY folks? We probably
need the

    depends on FIXED_PHY || !FIXED_PHY

dance.

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

* Re: [PATCH] net: freescale: select CONFIG_FIXED_PHY where needed
  2020-05-09 20:24 ` Jakub Kicinski
@ 2020-05-09 21:48   ` Arnd Bergmann
  2020-05-09 22:04     ` Florian Fainelli
  0 siblings, 1 reply; 5+ messages in thread
From: Arnd Bergmann @ 2020-05-09 21:48 UTC (permalink / raw)
  To: Jakub Kicinski
  Cc: Florian Fainelli, David S. Miller, Madalin Bucur,
	Rasmus Villemoes, Timur Tabi, Networking, linux-kernel,
	Andrew Lunn

On Sat, May 9, 2020 at 10:24 PM Jakub Kicinski <kuba@kernel.org> wrote:
>
> On Sat,  9 May 2020 14:04:52 +0200 Arnd Bergmann wrote:
> > I ran into a randconfig build failure with CONFIG_FIXED_PHY=m
> > and CONFIG_GIANFAR=y:
> >
> > x86_64-linux-ld: drivers/net/ethernet/freescale/gianfar.o:(.rodata+0x418): undefined reference to `fixed_phy_change_carrier'
> >
> > It seems the same thing can happen with dpaa and ucc_geth, so change
> > all three to do an explicit 'select FIXED_PHY'.
> >
> > The fixed-phy driver actually has an alternative stub function that
> > theoretically allows building network drivers when fixed-phy is
> > disabled, but I don't see how that would help here, as the drivers
> > presumably would not work then.
> >
> > Signed-off-by: Arnd Bergmann <arnd@arndb.de>
>
> > +     select FIXED_PHY
>
> I think FIXED_PHY needs to be optional, depends on what the board has
> connected to the MAC it may not be needed, right PHY folks? We probably
> need the
>
>     depends on FIXED_PHY || !FIXED_PHY

Unfortunately that does not work because it causes a circular dependency:

drivers/net/phy/Kconfig:415:error: recursive dependency detected!
drivers/net/phy/Kconfig:415: symbol FIXED_PHY depends on PHYLIB
drivers/net/phy/Kconfig:250: symbol PHYLIB is selected by FSL_PQ_MDIO
drivers/net/ethernet/freescale/Kconfig:60: symbol FSL_PQ_MDIO is
selected by UCC_GETH
drivers/net/ethernet/freescale/Kconfig:75: symbol UCC_GETH depends on FIXED_PHY

I now checked what other drivers use the fixed-phy interface, and found
that all others do select FIXED_PHY except for these three, and they
are also the only ones using fixed_phy_change_carrier().

The fixed-phy driver is fairly small, so it probably won't harm too much
to use the select, but maybe I missed another option.

        Arnd

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

* Re: [PATCH] net: freescale: select CONFIG_FIXED_PHY where needed
  2020-05-09 21:48   ` Arnd Bergmann
@ 2020-05-09 22:04     ` Florian Fainelli
  2020-05-09 22:52       ` Jakub Kicinski
  0 siblings, 1 reply; 5+ messages in thread
From: Florian Fainelli @ 2020-05-09 22:04 UTC (permalink / raw)
  To: Arnd Bergmann, Jakub Kicinski
  Cc: David S. Miller, Madalin Bucur, Rasmus Villemoes, Timur Tabi,
	Networking, linux-kernel, Andrew Lunn



On 5/9/2020 2:48 PM, Arnd Bergmann wrote:
> On Sat, May 9, 2020 at 10:24 PM Jakub Kicinski <kuba@kernel.org> wrote:
>>
>> On Sat,  9 May 2020 14:04:52 +0200 Arnd Bergmann wrote:
>>> I ran into a randconfig build failure with CONFIG_FIXED_PHY=m
>>> and CONFIG_GIANFAR=y:
>>>
>>> x86_64-linux-ld: drivers/net/ethernet/freescale/gianfar.o:(.rodata+0x418): undefined reference to `fixed_phy_change_carrier'
>>>
>>> It seems the same thing can happen with dpaa and ucc_geth, so change
>>> all three to do an explicit 'select FIXED_PHY'.
>>>
>>> The fixed-phy driver actually has an alternative stub function that
>>> theoretically allows building network drivers when fixed-phy is
>>> disabled, but I don't see how that would help here, as the drivers
>>> presumably would not work then.
>>>
>>> Signed-off-by: Arnd Bergmann <arnd@arndb.de>
>>
>>> +     select FIXED_PHY
>>
>> I think FIXED_PHY needs to be optional, depends on what the board has
>> connected to the MAC it may not be needed, right PHY folks? We probably
>> need the
>>
>>     depends on FIXED_PHY || !FIXED_PHY
> 
> Unfortunately that does not work because it causes a circular dependency:
> 
> drivers/net/phy/Kconfig:415:error: recursive dependency detected!
> drivers/net/phy/Kconfig:415: symbol FIXED_PHY depends on PHYLIB
> drivers/net/phy/Kconfig:250: symbol PHYLIB is selected by FSL_PQ_MDIO
> drivers/net/ethernet/freescale/Kconfig:60: symbol FSL_PQ_MDIO is
> selected by UCC_GETH
> drivers/net/ethernet/freescale/Kconfig:75: symbol UCC_GETH depends on FIXED_PHY
> 
> I now checked what other drivers use the fixed-phy interface, and found
> that all others do select FIXED_PHY except for these three, and they
> are also the only ones using fixed_phy_change_carrier().
> 
> The fixed-phy driver is fairly small, so it probably won't harm too much
> to use the select, but maybe I missed another option.

select FIXED_PHY appears the correct choice here we could think about
providing stubs if that is deemed useful, but in general these drivers
do tend to have a functional dependency on the fixed PHY and MDIO bus
subsystems.

Acked-by: Florian Fainelli <f.fainelli@gmail.com>
-- 
Florian

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

* Re: [PATCH] net: freescale: select CONFIG_FIXED_PHY where needed
  2020-05-09 22:04     ` Florian Fainelli
@ 2020-05-09 22:52       ` Jakub Kicinski
  0 siblings, 0 replies; 5+ messages in thread
From: Jakub Kicinski @ 2020-05-09 22:52 UTC (permalink / raw)
  To: Florian Fainelli
  Cc: Arnd Bergmann, David S. Miller, Madalin Bucur, Rasmus Villemoes,
	Timur Tabi, Networking, linux-kernel, Andrew Lunn

On Sat, 9 May 2020 15:04:04 -0700 Florian Fainelli wrote:
> On 5/9/2020 2:48 PM, Arnd Bergmann wrote:
> > On Sat, May 9, 2020 at 10:24 PM Jakub Kicinski <kuba@kernel.org> wrote:  
> >>
> >> On Sat,  9 May 2020 14:04:52 +0200 Arnd Bergmann wrote:  
> >>> I ran into a randconfig build failure with CONFIG_FIXED_PHY=m
> >>> and CONFIG_GIANFAR=y:
> >>>
> >>> x86_64-linux-ld: drivers/net/ethernet/freescale/gianfar.o:(.rodata+0x418): undefined reference to `fixed_phy_change_carrier'
> >>>
> >>> It seems the same thing can happen with dpaa and ucc_geth, so change
> >>> all three to do an explicit 'select FIXED_PHY'.
> >>>
> >>> The fixed-phy driver actually has an alternative stub function that
> >>> theoretically allows building network drivers when fixed-phy is
> >>> disabled, but I don't see how that would help here, as the drivers
> >>> presumably would not work then.
> >>>
> >>> Signed-off-by: Arnd Bergmann <arnd@arndb.de>  
> >>  
> >>> +     select FIXED_PHY  
> >>
> >> I think FIXED_PHY needs to be optional, depends on what the board has
> >> connected to the MAC it may not be needed, right PHY folks? We probably
> >> need the
> >>
> >>     depends on FIXED_PHY || !FIXED_PHY  
> > 
> > Unfortunately that does not work because it causes a circular dependency:
> > 
> > drivers/net/phy/Kconfig:415:error: recursive dependency detected!
> > drivers/net/phy/Kconfig:415: symbol FIXED_PHY depends on PHYLIB
> > drivers/net/phy/Kconfig:250: symbol PHYLIB is selected by FSL_PQ_MDIO
> > drivers/net/ethernet/freescale/Kconfig:60: symbol FSL_PQ_MDIO is
> > selected by UCC_GETH
> > drivers/net/ethernet/freescale/Kconfig:75: symbol UCC_GETH depends on FIXED_PHY

:(

> > I now checked what other drivers use the fixed-phy interface, and found
> > that all others do select FIXED_PHY except for these three, and they
> > are also the only ones using fixed_phy_change_carrier().
> > 
> > The fixed-phy driver is fairly small, so it probably won't harm too much
> > to use the select, but maybe I missed another option.  
> 
> select FIXED_PHY appears the correct choice here we could think about
> providing stubs if that is deemed useful, but in general these drivers
> do tend to have a functional dependency on the fixed PHY and MDIO bus
> subsystems.

The sad thing is - the stubs already exist, it seems we just can't
express the dependencies in Kconfig well enough to prevent driver 
to be built in when fixed_phy is a module. Anyway..

> Acked-by: Florian Fainelli <f.fainelli@gmail.com>

Applied to net, thank y'all!

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

end of thread, other threads:[~2020-05-09 22:52 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-05-09 12:04 [PATCH] net: freescale: select CONFIG_FIXED_PHY where needed Arnd Bergmann
2020-05-09 20:24 ` Jakub Kicinski
2020-05-09 21:48   ` Arnd Bergmann
2020-05-09 22:04     ` Florian Fainelli
2020-05-09 22:52       ` Jakub Kicinski

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.