Re: [PATCH net-next 5/7] net: hibmcge: Add mac link exception handling feature in this module

From: Jijie Shao
Date: Thu Feb 13 2025 - 21:40:06 EST



on 2025/2/14 4:05, Andrew Lunn wrote:
+int hbg_reset_phy(struct hbg_priv *priv)
+{
+ struct phy_device *phydev = priv->mac.phydev;
+
+ if (phydev->drv->soft_reset)
+ return phydev->drv->soft_reset(phydev);
+
+ return genphy_soft_reset(phydev);
+}
A MAC driver should not be doing a soft reset on a PHY. For some
devices, this clears out all the settings. I would suggest you use
phy_stop(), phy_start() which are functions a MAC driver is allowed to
use.

Andrew

Well, I think your advice is helpful.

It is also a good practice to restart the PHY, which also triggers link relinking.

Thank you. I'll test this method.

Thanks,
Jijie Shao