Re: [PATCH net-next v3] net: mdio: force deassert MDIO reset signal

From: Andrew Lunn
Date: Tue Jan 17 2023 - 08:47:31 EST


On Mon, Jan 16, 2023 at 05:01:14PM +0100, Pierluigi Passaro wrote:
> When the reset gpio is defined within the node of the device tree
> describing the PHY, the reset is initialized and managed only after
> calling the fwnode_mdiobus_phy_device_register function.
> However, before calling it, the MDIO communication is checked by the
> get_phy_device function.
> When this happens and the reset GPIO was somehow previously set down,
> the get_phy_device function fails, preventing the PHY detection.
> These changes force the deassert of the MDIO reset signal before
> checking the MDIO channel.
> The PHY may require a minimum deassert time before being responsive:
> use a reasonable sleep time after forcing the deassert of the MDIO
> reset signal.
> Once done, free the gpio descriptor to allow managing it later.
>
> Signed-off-by: Pierluigi Passaro <pierluigi.p@xxxxxxxxxxxxx>
> Signed-off-by: FrancescoFerraro <francesco.f@xxxxxxxxxxxxx>

FYI: There is still a discussion going on in v1 of this patch. Please
do not merge yet.

Andrew