From: Sean Anderson <sean.anderson@linux.dev>
To: Andrew Lunn <andrew@lunn.ch>
Cc: Radhey Shyam Pandey <radhey.shyam.pandey@amd.com>,
Andrew Lunn <andrew+netdev@lunn.ch>,
"David S . Miller" <davem@davemloft.net>,
Eric Dumazet <edumazet@google.com>,
Jakub Kicinski <kuba@kernel.org>, Paolo Abeni <pabeni@redhat.com>,
netdev@vger.kernel.org,
Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
Michal Simek <michal.simek@amd.com>,
Saravana Kannan <saravanak@google.com>,
Leon Romanovsky <leon@kernel.org>,
Dave Ertman <david.m.ertman@intel.com>,
linux-kernel@vger.kernel.org, Ira Weiny <ira.weiny@intel.com>,
linux-arm-kernel@lists.infradead.org
Subject: Re: [PATCH net 4/4] net: axienet: Split into MAC and MDIO drivers
Date: Mon, 23 Jun 2025 19:16:53 -0400 [thread overview]
Message-ID: <d87ab382-cc6c-46df-bd7e-1200154dd84f@linux.dev> (raw)
In-Reply-To: <3e2acebe-a9db-494b-bca8-2e1bbc3c1eaf@lunn.ch>
On 6/23/25 18:45, Andrew Lunn wrote:
> On Mon, Jun 23, 2025 at 02:48:53PM -0400, Sean Anderson wrote:
>> On 6/23/25 14:27, Andrew Lunn wrote:
>> > On Mon, Jun 23, 2025 at 11:16:08AM -0400, Sean Anderson wrote:
>> >> On 6/21/25 03:33, Andrew Lunn wrote:
>> >> > On Thu, Jun 19, 2025 at 04:05:37PM -0400, Sean Anderson wrote:
>> >> >> Returning EPROBE_DEFER after probing a bus may result in an infinite
>> >> >> probe loop if the EPROBE_DEFER error is never resolved.
>> >> >
>> >> > That sounds like a core problem. I also thought there was a time
>> >> > limit, how long the system will repeat probes for drivers which defer.
>> >> >
>> >> > This seems like the wrong fix to me.
>> >>
>> >> I agree. My first attempt to fix this did so by ignoring deferred probes
>> >> from child devices, which would prevent "recursive" loops like this one
>> >> [1]. But I was informed that failing with EPROBE_DEFER after creating a
>> >> bus was not allowed at all, hence this patch.
>> >
>> > O.K. So why not change the order so that you know you have all the
>> > needed dependencies before registering the MDIO bus?
>> >
>> > Quoting your previous email:
>> >
>> >> Returning EPROBE_DEFER after probing a bus may result in an infinite
>> >> probe loop if the EPROBE_DEFER error is never resolved. For example,
>> >> if the PCS is located on another MDIO bus and that MDIO bus is
>> >> missing its driver then we will always return EPROBE_DEFER.
>> >
>> > Why not get a reference on the PCS device before registering the MDIO
>> > bus?
>>
>> Because the PCS may be on the MDIO bus. This is probably the most-common
>> case.
>
> So you are saying the PCS is physically there, but the driver is
> missing because of configuration errors? Then it sounds like a kconfig
> issue?
>
> Or are you saying the driver has been built but then removed from
> /lib/modules/
The latter. Or maybe someone just forgot to install it (or include it
with their initramfs). Or maybe there was some error with the MDIO bus.
There are two mutually-exclusive scenarios (that can both occur in the
same system). First, the PCS can be attached to our own MDIO bus:
MAC
|
+->MDIO
|
+->PCS
+->PHY (etc)
In this scenario, we have to probe the MDIO bus before we can look up
the PCS, since otherwise the PCS will always be missing when we look for
it. But if we do things in the right order then we can't get
EPROBE_DEFER, and so there's no risk of a probe loop.
Second, the PCS can be attached to some other MDIO bus:
MAC MDIO
| |
+->MDIO +->PCS
|
+->PHY (etc)
In this scenario, the MDIO bus might not be present for whatever reason
and we have the possibility of an EPROBE_DEFER error. If that happens,
we will end up in a probe loop because the PHY on the MDIO bus
incremented deferred_trigger_count when it probed successfully:
deferred_probe_work_func()
driver_probe_device(MAC)
axienet_probe(MAC)
mdiobus_register(MDIO)
device_add(PHY)
(probe successful)
driver_bound(PHY)
driver_deferred_probe_trigger()
return -EPROBE_DEFER
driver_deferred_probe_add(MAC)
// deferred_trigger_count changed, so...
driver_deferred_probe_trigger()
--Sean
next prev parent reply other threads:[~2025-06-23 23:17 UTC|newest]
Thread overview: 25+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-06-19 20:05 [PATCH net 0/4] net: axienet: Fix deferred probe loop Sean Anderson
2025-06-19 20:05 ` [PATCH net 1/4] auxiliary: Allow empty id Sean Anderson
2025-06-20 5:13 ` Greg Kroah-Hartman
2025-06-20 15:37 ` Sean Anderson
2025-06-20 16:02 ` Greg Kroah-Hartman
2025-06-20 16:09 ` Sean Anderson
2025-06-20 16:15 ` Greg Kroah-Hartman
2025-06-20 16:33 ` Sean Anderson
2025-06-19 20:05 ` [PATCH net 2/4] net: axienet: Fix resource release ordering Sean Anderson
2025-06-19 20:05 ` [PATCH net 3/4] net: axienet: Rearrange lifetime functions Sean Anderson
2025-06-19 20:05 ` [PATCH net 4/4] net: axienet: Split into MAC and MDIO drivers Sean Anderson
2025-06-19 23:10 ` Jakub Kicinski
2025-06-19 23:19 ` Sean Anderson
2025-06-20 14:03 ` kernel test robot
2025-06-21 7:33 ` Andrew Lunn
2025-06-23 15:16 ` Sean Anderson
2025-06-23 18:27 ` Andrew Lunn
2025-06-23 18:48 ` Sean Anderson
2025-06-23 22:45 ` Andrew Lunn
2025-06-23 23:16 ` Sean Anderson [this message]
2025-07-10 23:37 ` Sean Anderson
2025-06-20 5:10 ` [PATCH net 0/4] net: axienet: Fix deferred probe loop Greg Kroah-Hartman
2025-06-20 15:41 ` Sean Anderson
2025-06-20 16:01 ` Greg Kroah-Hartman
2025-06-20 16:34 ` Sean Anderson
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=d87ab382-cc6c-46df-bd7e-1200154dd84f@linux.dev \
--to=sean.anderson@linux.dev \
--cc=andrew+netdev@lunn.ch \
--cc=andrew@lunn.ch \
--cc=davem@davemloft.net \
--cc=david.m.ertman@intel.com \
--cc=edumazet@google.com \
--cc=gregkh@linuxfoundation.org \
--cc=ira.weiny@intel.com \
--cc=kuba@kernel.org \
--cc=leon@kernel.org \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=michal.simek@amd.com \
--cc=netdev@vger.kernel.org \
--cc=pabeni@redhat.com \
--cc=radhey.shyam.pandey@amd.com \
--cc=saravanak@google.com \
/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).