[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <77c9849442e7e4a747aebd79747fd88c383c6b57.camel@ew.tq-group.com>
Date: Wed, 03 Nov 2021 12:59:16 +0100
From: Matthias Schiffer <matthias.schiffer@...tq-group.com>
To: Andrew Lunn <andrew@...n.ch>
Cc: Joakim Zhang <qiangqing.zhang@....com>,
"David S. Miller" <davem@...emloft.net>,
Jakub Kicinski <kuba@...nel.org>, netdev@...r.kernel.org,
linux-kernel@...r.kernel.org
Subject: Re: [PATCH] net: fec: defer probe if PHY on external MDIO bus is
not available
On Tue, 2021-10-26 at 13:54 +0200, Matthias Schiffer wrote:
> On Fri, 2021-10-22 at 14:56 +0200, Andrew Lunn wrote:
> > > Hmm, lots of network drivers? I tried to find an example, but all
> > > drivers that generate -EPROBE_DEFER for missing PHYs at all don't have
> > > an internal MDIO bus and thus avoid the circular dependency.
> >
> > Try drivers/net/dsa.
> >
> > These often have mdio busses which get registered and then
> > unregistered. There are also IRQ drivers which do the same.
> >
> > Andrew
>
>
> All drivers I looked at were careful to register the MDIO bus in the
> last part of the probe function, so that the only errors that could
> happen after that (and thus require to unregister the bus device again)
> would not be -EPROBE_DEFER.
>
> The documented infinite loop is easy to reproduce: You just need two
> separate device instances with misbehaving probe() functions that
> return -EPROBE_DEFER after registering and unregistering some
> subdevice. If the missing device that causes the deferral never appears
> (for example because its driver is not available), the two devices will
> be probed ad infinitum.
>
> I agree with the documentation that a driver should not do this, and
> thus we need another way to deal with the cyclic dependency between an
> Ethernet interface and a PHY on its internal MDIO bus.
>
> While I think that a generic solution would be theoretically possible
> by ensuring that the probing loop makes some kind of "progress", I
> think this would set a precedent for "expensive" operations happening
> before a -EPROBE_DEFER return, which should be avoided even when no
> infinite loop results.
>
> Matthias
Does anyone have a suggestion how to proceed with this issue?
Powered by blists - more mailing lists