回覆: [net] net: ftgmac100: refactor getting phy device handle
From: Jacky Chou
Date: Sun Oct 13 2024 - 22:39:14 EST
Hi Andrew,
Thanks for the review.
> > 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?
I am apology what I am not sure if using fixes to send my patch.
I just refactor this part and let the relevant people know that I have adjusted
their code.
This patch is not a bug fix.
>
> > - 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.
Agree. It is MAC function, not PHY.
I will adjust it on next version.
Thank you.