From: "Arnd Bergmann" <arnd@arndb.de>
To: "Andrew Lunn" <andrew@lunn.ch>
Cc: "kernel test robot" <lkp@intel.com>,
llvm@lists.linux.dev, oe-kbuild-all@lists.linux.dev,
"Christian Marangi" <ansuelsmth@gmail.com>,
Netdev <netdev@vger.kernel.org>,
linux-kernel@vger.kernel.org,
"Florian Fainelli" <f.fainelli@gmail.com>,
"David S . Miller" <davem@davemloft.net>,
"Jakub Kicinski" <kuba@kernel.org>
Subject: Re: [lunn:v6.3-rc2-net-next-phy-leds 5/15] ld.lld: error: undefined symbol: devm_mdiobus_alloc_size
Date: Thu, 20 Apr 2023 15:37:38 +0200 [thread overview]
Message-ID: <91c716f0-bf7f-4fdf-8cb7-83f1bdc0cbd4@app.fastmail.com> (raw)
In-Reply-To: <758fff85-aefc-4e0a-97b1-fe7179fafac6@lunn.ch>
On Thu, Apr 20, 2023, at 15:07, Andrew Lunn wrote:
> On Thu, Apr 20, 2023 at 08:31:17AM +0200, Arnd Bergmann wrote:
>>
>> It looks like this has hit linux-next now, I'm seeing the same problem in
>> my own randconfig builds after Andrew's 01e5b728e9e4 ("net: phy: Add a
>> binding for PHY LEDs").
>
> Hi Arnd
>
> I tried to fix this with:
>
> commit 37f9b2a6c086bb28487a0682b8098f907861c4a1
> Author: Andrew Lunn <andrew@lunn.ch>
> Date: Thu Mar 30 20:13:29 2023 -0500
>
> 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.
>
> All the failures i've seen have CONFIG_MDIO_DEVRES set to disabled. So
> i added either depends on, or select to the drivers which use it. I
> missed the LAN743x.
I've sent a different patch now. From what I can tell, your patch does
not address the actual problem, it just works around one of the symptoms:
When you have a driver that selects PHYLIB, but PHYLIB itself
depends on something that is not enabled, Kconfig just gives up
and stops handling any other 'select' statements from that chain.
selecting MDIO_DEVRES from each of the drivers works around this
one thing, but it does not solve the actual dependency, for that you
would have to add 'depends on LED_CLASS' on each of the network
drivers as well, which is clearly not the intention.
>> The problem here is that both PHYLIB and LEDS_CLASS are user-visible
>> tristate symbols that are referenced from other Kconfig symbols with
>> both 'depends on' and 'select'. Having the two interact introduces a
>> number of ways that lead to circular dependencies.
>
> I was getting circular dependencies with first versions of the above
> patch. I initially tried depends on everywhere, and then had to drop
> back to select for a few cases.
>
>> It might be ok to use 'select LEDS_CLASS' from PHYLIB, but I have not
>> tried that yet and I expect this will result in other build failures.
>>
>> A better solution would be to change all drivers that currently use
>> 'select PHYLIB' to 'depends on PHYLIB' and have PHYLIB itself
>> 'default ETHERNET' to avoid most of the regressions, but doing this
>> for 6.4 is a bit risky and can cause other problems.
>
> For 6.4, will adding more depend on/select MDIO_DEVRES help? That
> should be low risk.
I think the best way is to drop your MDIO_DEVRES patch and instead
apply mine (or some variation of that) from
https://lore.kernel.org/lkml/20230420084624.3005701-1-arnd@kernel.org/
Once any missing or recursive dependencies are handled, the devres
problem should be fixed as well. I have completed around 150
randconfig builds with that patch and have not seen any further
problems.
Arnd
next prev parent reply other threads:[~2023-04-20 13:38 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <202303241935.xRMa6mc6-lkp@intel.com>
2023-04-20 6:31 ` Arnd Bergmann
2023-04-20 13:07 ` Andrew Lunn
2023-04-20 13:37 ` Arnd Bergmann [this message]
2023-04-20 15:26 ` Andrew Lunn
2023-04-20 15:39 ` Arnd Bergmann
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=91c716f0-bf7f-4fdf-8cb7-83f1bdc0cbd4@app.fastmail.com \
--to=arnd@arndb.de \
--cc=andrew@lunn.ch \
--cc=ansuelsmth@gmail.com \
--cc=davem@davemloft.net \
--cc=f.fainelli@gmail.com \
--cc=kuba@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=lkp@intel.com \
--cc=llvm@lists.linux.dev \
--cc=netdev@vger.kernel.org \
--cc=oe-kbuild-all@lists.linux.dev \
/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
all inboxes | Powered by JetHome®