Re: [net] net: ftgmac100: refactor getting phy device handle

From: Andrew Lunn
Date: Sat Oct 12 2024 - 13:18:32 EST


On Fri, Oct 11, 2024 at 04:16:33PM +0800, Jacky Chou wrote:
> The ftgmac100 supports NC-SI mode, dedicated PHY and fixed-link
> PHY. The dedicated PHY is using the phy_handle property to get
> phy device handle and the fixed-link phy is using the fixed-link
> property to register a fixed-link phy device.
>
> In of_phy_get_and_connect function, it help driver to get and register
> these PHYs handle.
> Therefore, here refactors this part by using of_phy_get_and_connect.
>
> Fixes: 38561ded50d0 ("net: ftgmac100: support fixed link")
> Fixes: 39bfab8844a0 ("net: ftgmac100: Add support for DT phy-handle property")

Fixes: implies something is broken. What is actually wrong with this
code? What sort of problem does a user see?

> - phy_support_asym_pause(phy);
> + if (of_get_property(np, "phy-handle", NULL))
> + phy_support_asym_pause(phy);

This is probably wrong. This is the MAC layer telling phylib that the
MAC supports asym pause. It should makes no difference to the MAC what
sort of PHY is being used, all the MAC is looking at/sending is pause
frames.

Andrew

---
pw-bot: cr