From: Sean Anderson <sean.anderson@linux.dev>
To: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Cc: Saravana Kannan <saravanak@google.com>,
"Rafael J . Wysocki" <rafael@kernel.org>,
Danilo Krummrich <dakr@kernel.org>,
linux-kernel@vger.kernel.org, devicetree@vger.kernel.org,
Christoph Hellwig <hch@lst.de>, Rob Herring <robh+dt@kernel.org>,
Grant Likely <grant.likely@linaro.org>
Subject: Re: [PATCH] driver core: Prevent deferred probe loops
Date: Thu, 12 Jun 2025 11:53:26 -0400 [thread overview]
Message-ID: <7d6d8789-e10b-4b06-aa99-5c1a1bdd3b4c@linux.dev> (raw)
In-Reply-To: <2025061147-squishier-oversleep-80cd@gregkh>
On 6/11/25 08:23, Greg Kroah-Hartman wrote:
> On Tue, Jun 10, 2025 at 07:44:27PM -0400, Sean Anderson wrote:
>> On 6/10/25 19:32, Saravana Kannan wrote:
>> > On Tue, Jun 10, 2025 at 11:35 AM Sean Anderson <sean.anderson@linux.dev> wrote:
>> >>
>> >> A deferred probe loop can occur when a device returns EPROBE_DEFER after
>> >> registering a bus with children:
>> >
>> > This is a broken driver. A parent device shouldn't register child
>> > devices unless it is fully read itself. It's not logical to say the
>> > child devices are available, if the parent itself isn't fully ready.
>> > So, adding child devices/the bus should be the last thing done in the
>> > parent's probe function.
>> >
>> > I know there are odd exceptions where the parent depends on the child,
>> > so they might add the child a bit earlier in the probe
>>
>> This is exactly the case here. So the bus probing cannot happen any
>> later than it already does.
>
> Please fix the driver not to do this.
How? The driver needs the PCS to work. And the PCS can live on the MDIO
bus.
>> > but in those cases, the parent's probe should still do all the checks
>> > ahead of time.
>>
>> Such as what? How is the parent going to know the resource is missing
>> without checking for it?
>>
>> > Can you be more specific about the actual failure you are seeing?
>>
>> MAC is looking for a PCS that's on its internal MDIO bus, but that PCS's
>> driver isn't loaded. The PCS has to be loaded at probe time because
>> phylink_create needs it, and phylink is necessary to register the
>> netdev. The latter situation is not ideal, but it would be quite a bit
>> of work to untangle.
>
> Please untangle, don't put stuff in the driver core for broken
> subsystems. That is just pushing the maintaince of this from the driver
> authors to the driver core maintainers for the next 20+ years :(
What makes it broken? The "mess" has already been made in netdev. The driver
authors have already pushed it off onto phylink.
And by "quite a bit of work to untangle" I mean the PCS affects settings
(ethtool ksettings, MII IOCTL) that are exposed to userspace as soon as
the netdev is registered. So we cannot move to a "delayed" lookup
without breaking reading/modifying the settings. We could of course fake
it, but what happens when e.g. userspace looks at the settings and
breaks because we are not reporting the right capabilities (which would
have been reported in the past)?
--Sean
next prev parent reply other threads:[~2025-06-12 15:53 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-06-09 23:57 [BUG] Deferred probe loop with child devices Sean Anderson
2025-06-10 18:34 ` [PATCH] driver core: Prevent deferred probe loops Sean Anderson
2025-06-10 23:32 ` Saravana Kannan
2025-06-10 23:44 ` Sean Anderson
2025-06-11 12:23 ` Greg Kroah-Hartman
2025-06-12 15:53 ` Sean Anderson [this message]
2025-06-12 17:56 ` Saravana Kannan
2025-06-12 20:40 ` Sean Anderson
2025-06-17 8:50 ` Greg Kroah-Hartman
2025-06-17 15:35 ` Sean Anderson
2025-06-17 15:49 ` Greg Kroah-Hartman
2025-06-17 17:14 ` Sean Anderson
2025-06-19 8:21 ` Greg Kroah-Hartman
2025-06-19 16:19 ` Sean Anderson
2025-06-19 16:33 ` Greg Kroah-Hartman
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=7d6d8789-e10b-4b06-aa99-5c1a1bdd3b4c@linux.dev \
--to=sean.anderson@linux.dev \
--cc=dakr@kernel.org \
--cc=devicetree@vger.kernel.org \
--cc=grant.likely@linaro.org \
--cc=gregkh@linuxfoundation.org \
--cc=hch@lst.de \
--cc=linux-kernel@vger.kernel.org \
--cc=rafael@kernel.org \
--cc=robh+dt@kernel.org \
--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 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.