On Tue, Jun 20, 2023 at 1:46 AM Marek Vasut
<[email protected]> wrote:
>
> In case the PHY DT node describes GPIO reset and no other method
> of detecting the PHY succeeded, release the PHY from reset using
> its reset GPIO before reading out the PHY IDs as a last resort.
> This way there is slightly better chance of successful PHY ID
> readout.
>
> Signed-off-by: Marek Vasut <[email protected]>
> ---
> Cc: Joe Hershberger <[email protected]>
> Cc: Marek Vasut <[email protected]>
> Cc: Michal Simek <[email protected]>
> Cc: Nishanth Menon <[email protected]>
> Cc: Ramon Fried <[email protected]>
> ---
>  drivers/net/phy/phy.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/net/phy/phy.c b/drivers/net/phy/phy.c
> index 3d69c2c4d28..373006f8206 100644
> --- a/drivers/net/phy/phy.c
> +++ b/drivers/net/phy/phy.c
> @@ -969,7 +969,7 @@ struct phy_device *phy_connect(struct mii_dev *bus, int 
> addr,
>                 phydev = phy_connect_gmii2rgmii(bus, dev);
>  #endif
>
> -       if (!phydev)
> +       if (!phydev && !phy_gpio_reset(dev))
>                 phydev = phy_find_by_mask(bus, mask);
>
>         if (phydev)
> --
> 2.39.2
>
Reviewed-by: Ramon Fried <[email protected]>

Reply via email to