[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <20200509155221.40e0e3b5@kicinski-fedora-pc1c0hjn.dhcp.thefacebook.com>
Date: Sat, 9 May 2020 15:52:21 -0700
From: Jakub Kicinski <kuba@...nel.org>
To: Florian Fainelli <f.fainelli@...il.com>
Cc: Arnd Bergmann <arnd@...db.de>,
"David S. Miller" <davem@...emloft.net>,
Madalin Bucur <madalin.bucur@....com>,
Rasmus Villemoes <linux@...musvillemoes.dk>,
Timur Tabi <timur@...nel.org>,
Networking <netdev@...r.kernel.org>,
"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
Andrew Lunn <andrew@...n.ch>
Subject: Re: [PATCH] net: freescale: select CONFIG_FIXED_PHY where needed
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@...nel.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@...db.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@...il.com>
Applied to net, thank y'all!
Powered by blists - more mailing lists