netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Simon Horman <simon.horman@corigine.com>
To: Andrew Lunn <andrew@lunn.ch>
Cc: David Miller <davem@davemloft.net>,
	Jakub Kicinski <kuba@kernel.org>, netdev <netdev@vger.kernel.org>,
	Florian Fainelli <f.fainelli@gmail.com>,
	Heiner Kallweit <hkallweit1@gmail.com>,
	Russell King <rmk+kernel@armlinux.org.uk>
Subject: Re: [PATCH] net: ethernet: Add missing depends on MDIO_DEVRES
Date: Mon, 10 Apr 2023 14:56:54 +0200	[thread overview]
Message-ID: <ZDQHlhU4c5YRk2yZ@corigine.com> (raw)
In-Reply-To: <741fc0ef-c94d-488e-86f8-436ab4582971@lunn.ch>

On Mon, Apr 10, 2023 at 02:11:39PM +0200, Andrew Lunn wrote:
> On Mon, Apr 10, 2023 at 11:07:58AM +0200, Simon Horman wrote:
> > On Sun, Apr 09, 2023 at 05:02:04PM +0200, Andrew Lunn wrote:
> > > 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.
> > > 
> > > Signed-off-by: Andrew Lunn <andrew@lunn.ch>
> > > ---
> > >  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(+)
> > > 
> > > diff --git a/drivers/net/ethernet/freescale/Kconfig b/drivers/net/ethernet/freescale/Kconfig
> > > index f1e80d6996ef..1c78f66a89da 100644
> > > --- a/drivers/net/ethernet/freescale/Kconfig
> > > +++ b/drivers/net/ethernet/freescale/Kconfig
> > > @@ -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.
> 
> 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.

Thanks Andrew,

I'm certainly not opposed to this patch.
More curious as to what situations (configs) the problems arise in.

  reply	other threads:[~2023-04-10 12:57 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-04-09 15:02 [PATCH] net: ethernet: Add missing depends on MDIO_DEVRES Andrew Lunn
2023-04-10  9:07 ` Simon Horman
2023-04-10 12:11   ` Andrew Lunn
2023-04-10 12:56     ` Simon Horman [this message]
2023-04-12 22:52     ` Jacob Keller
2023-04-12 22:53 ` Jacob Keller
2023-04-13  3:50 ` patchwork-bot+netdevbpf

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=ZDQHlhU4c5YRk2yZ@corigine.com \
    --to=simon.horman@corigine.com \
    --cc=andrew@lunn.ch \
    --cc=davem@davemloft.net \
    --cc=f.fainelli@gmail.com \
    --cc=hkallweit1@gmail.com \
    --cc=kuba@kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=rmk+kernel@armlinux.org.uk \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).