net: phy: enhance GPY115 loopback disable function
Subsystems (4)
Xu Liang
maintainerPATCH v2 1/1 net: phy: enhance GPY115 loopback disable function
GPY115 need reset PHY when it comes out from loopback mode if the firmware version number (lower 8 bits) is equal to or below 0x76.
---
v2 changes:
Remove wrong comment.
Use genphy_soft_reset instead of modifying MII_BMCR register to trigger PHY reset.
drivers/net/phy/mxl-gpy.c | 23 +++++++++++++++++++++-- 1 file changed, 21 insertions(+), 2 deletions(-)
drivers/net/phy/mxl-gpy.c +21 -2
@@ -493,6 +493,25 @@ static int gpy_loopback(struct phy_device *phydev, bool enable)return ret; } +static int gpy115_loopback (struct phy_device *phydev,bool enable) +{ +int ret; +int fw_minor; + +if (enable) +return gpy_loopback (phydev, enable); + + ret =phy_read (phydev,PHY_FWV ); +if (ret <0 ) +return ret; + + fw_minor =FIELD_GET (PHY_FWV_MINOR_MASK , ret); +if (fw_minor >0x0076 ) +return gpy_loopback (phydev,0 ); + +return genphy_soft_reset (phydev); +} +static struct phy_driver gpy_drivers[] = { {PHY_ID_MATCH_MODEL (PHY_ID_GPY2xx),
@@ -527,7 +546,7 @@ static struct phy_driver gpy_drivers[] = { .handle_interrupt = gpy_handle_interrupt, .set_wol = gpy_set_wol, .get_wol = gpy_get_wol, - .set_loopback = gpy_loopback, + .set_loopback = gpy115_loopback, }, { PHY_ID_MATCH_MODEL(PHY_ID_GPY115C),
@@ -544,7 +563,7 @@ static struct phy_driver gpy_drivers[] = { .handle_interrupt = gpy_handle_interrupt, .set_wol = gpy_set_wol, .get_wol = gpy_get_wol, - .set_loopback = gpy_loopback, + .set_loopback = gpy115_loopback, }, { .phy_id = PHY_ID_GPY211B,
Signature · 1 line
2.17.1
Quoted 5 lines · Xu Liang
GPY115 need reset PHY when it comes out from loopback mode if the firmware version number (lower 8 bits) is equal to or below
0x76.Fixes 7d901a1e878a ("net: phy: add Maxlinear GPY115/21x/24x driver")Signed-off-by Xu Liang <[email protected]>
Andrew
This patch was applied to netdev/net.git (refs/heads/master):
Hello:
This patch was applied to netdev/net.git (refs/heads/master):
Quoted 11 lines · On Mon, 27 Sep 2021 15:03:02 +0800 you wrote:
GPY115 need reset PHY when it comes out from loopback mode if the firmware version number (lower 8 bits) is equal to or below
0x76.Fixes 7d901a1e878a ("net: phy: add Maxlinear GPY115/21x/24x driver")Signed-off-by Xu Liang <[email protected]>---
v2 changes:
Remove wrong comment.
Usegenphy_soft_resetinstead of modifyingMII_BMCRregister to trigger PHY reset.[...]
Here is the summary with links:
- [v2] net: phy: enhance GPY115 loopback disable function
https://git.kernel.org/netdev/net/c/3b1b6e82fb5e
You are awesome, thank you!
--
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html