Skip to content

Commit 081156c

Browse files
dangowrtPaolo Abeni
authored andcommitted
net: phy: mxl-gpy: fix link properties on USXGMII and internal PHYs
gpy_update_interface() returns early in case the PHY is internal or connected via USXGMII. In this case the gigabit master/slave property as well as MDI/MDI-X status also won't be read which seems wrong. Always read those properties by moving the logic to retrieve them to gpy_read_status(). Fixes: fd8825c ("net: phy: mxl-gpy: Add PHY Auto/MDI/MDI-X set driver for GPY211 chips") Fixes: 311abcd ("net: phy: add support to get Master-Slave configuration") Suggested-by: "Russell King (Oracle)" <linux@armlinux.org.uk> Signed-off-by: Daniel Golle <daniel@makrotopia.org> Link: https://patch.msgid.link/71fccf3f56742116eb18cc070d2a9810479ea7f9.1763650701.git.daniel@makrotopia.org Signed-off-by: Paolo Abeni <pabeni@redhat.com>
1 parent 82fca3d commit 081156c

1 file changed

Lines changed: 11 additions & 7 deletions

File tree

drivers/net/phy/mxl-gpy.c

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -578,13 +578,7 @@ static int gpy_update_interface(struct phy_device *phydev)
578578
break;
579579
}
580580

581-
if (phydev->speed == SPEED_2500 || phydev->speed == SPEED_1000) {
582-
ret = genphy_read_master_slave(phydev);
583-
if (ret < 0)
584-
return ret;
585-
}
586-
587-
return gpy_update_mdix(phydev);
581+
return 0;
588582
}
589583

590584
static int gpy_read_status(struct phy_device *phydev)
@@ -639,6 +633,16 @@ static int gpy_read_status(struct phy_device *phydev)
639633
ret = gpy_update_interface(phydev);
640634
if (ret < 0)
641635
return ret;
636+
637+
if (phydev->speed == SPEED_2500 || phydev->speed == SPEED_1000) {
638+
ret = genphy_read_master_slave(phydev);
639+
if (ret < 0)
640+
return ret;
641+
}
642+
643+
ret = gpy_update_mdix(phydev);
644+
if (ret < 0)
645+
return ret;
642646
}
643647

644648
return 0;

0 commit comments

Comments
 (0)