[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <94b897a1-2f5a-f290-7d8c-333d61ca5e5c@gmail.com>
Date: Thu, 7 Apr 2022 10:57:25 -0700
From: Florian Fainelli <f.fainelli@...il.com>
To: Vladimir Oltean <vladimir.oltean@....com>, netdev@...r.kernel.org
Cc: Paolo Abeni <pabeni@...hat.com>, Jakub Kicinski <kuba@...nel.org>,
"David S. Miller" <davem@...emloft.net>,
Andrew Lunn <andrew@...n.ch>,
Heiner Kallweit <hkallweit1@...il.com>,
Russell King <linux@...linux.org.uk>,
Geert Uytterhoeven <geert+renesas@...der.be>,
Saravana Kannan <saravanak@...gle.com>,
Rob Herring <robh@...nel.org>,
Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
"Rafael J. Wysocki" <rafael@...nel.org>,
Robin Murphy <robin.murphy@....com>
Subject: Re: [PATCH v2 net] net: mdio: don't defer probe forever if PHY IRQ
provider is missing
On 4/7/22 09:55, Vladimir Oltean wrote:
> When a driver for an interrupt controller is missing, of_irq_get()
> returns -EPROBE_DEFER ad infinitum, causing
> fwnode_mdiobus_phy_device_register(), and ultimately, the entire
> of_mdiobus_register() call, to fail. In turn, any phy_connect() call
> towards a PHY on this MDIO bus will also fail.
>
> This is not what is expected to happen, because the PHY library falls
> back to poll mode when of_irq_get() returns a hard error code, and the
> MDIO bus, PHY and attached Ethernet controller work fine, albeit
> suboptimally, when the PHY library polls for link status. However,
> -EPROBE_DEFER has special handling given the assumption that at some
> point probe deferral will stop, and the driver for the supplier will
> kick in and create the IRQ domain.
>
> Reasons for which the interrupt controller may be missing:
>
> - It is not yet written. This may happen if a more recent DT blob (with
> an interrupt-parent for the PHY) is used to boot an old kernel where
> the driver didn't exist, and that kernel worked with the
> vintage-correct DT blob using poll mode.
>
> - It is compiled out. Behavior is the same as above.
>
> - It is compiled as a module. The kernel will wait for a number of
> seconds specified in the "deferred_probe_timeout" boot parameter for
> user space to load the required module. The current default is 0,
> which times out at the end of initcalls. It is possible that this
> might cause regressions unless users adjust this boot parameter.
>
> The proposed solution is to use the driver_deferred_probe_check_state()
> helper function provided by the driver core, which gives up after some
> -EPROBE_DEFER attempts, taking "deferred_probe_timeout" into consideration.
> The return code is changed from -EPROBE_DEFER into -ENODEV or
> -ETIMEDOUT, depending on whether the kernel is compiled with support for
> modules or not.
>
> Fixes: 66bdede495c7 ("of_mdio: Fix broken PHY IRQ in case of probe deferral")
> Suggested-by: Robin Murphy <robin.murphy@....com>
> Signed-off-by: Vladimir Oltean <vladimir.oltean@....com>
Reviewed-by: Florian Fainelli <f.fainelli@...il.com>
--
Florian
Powered by blists - more mailing lists