|
36 | 36 |
|
37 | 37 | static int dp83tg720_config_aneg(struct phy_device *phydev)
|
38 | 38 | {
|
| 39 | + int ret; |
| 40 | + |
39 | 41 | /* Autoneg is not supported and this PHY supports only one speed.
|
40 | 42 | * We need to care only about master/slave configuration if it was
|
41 | 43 | * changed by user.
|
42 | 44 | */
|
43 |
| - return genphy_c45_pma_baset1_setup_master_slave(phydev); |
| 45 | + ret = genphy_c45_pma_baset1_setup_master_slave(phydev); |
| 46 | + if (ret) |
| 47 | + return ret; |
| 48 | + |
| 49 | + /* Re-read role configuration to make changes visible even if |
| 50 | + * the link is in administrative down state. |
| 51 | + */ |
| 52 | + return genphy_c45_pma_baset1_read_master_slave(phydev); |
44 | 53 | }
|
45 | 54 |
|
46 | 55 | static int dp83tg720_read_status(struct phy_device *phydev)
|
@@ -69,6 +78,8 @@ static int dp83tg720_read_status(struct phy_device *phydev)
|
69 | 78 | return ret;
|
70 | 79 |
|
71 | 80 | /* After HW reset we need to restore master/slave configuration.
|
| 81 | + * genphy_c45_pma_baset1_read_master_slave() call will be done |
| 82 | + * by the dp83tg720_config_aneg() function. |
72 | 83 | */
|
73 | 84 | ret = dp83tg720_config_aneg(phydev);
|
74 | 85 | if (ret)
|
@@ -168,8 +179,15 @@ static int dp83tg720_config_init(struct phy_device *phydev)
|
168 | 179 | /* In case the PHY is bootstrapped in managed mode, we need to
|
169 | 180 | * wake it.
|
170 | 181 | */
|
171 |
| - return phy_write_mmd(phydev, MDIO_MMD_VEND2, DP83TG720S_LPS_CFG3, |
172 |
| - DP83TG720S_LPS_CFG3_PWR_MODE_0); |
| 182 | + ret = phy_write_mmd(phydev, MDIO_MMD_VEND2, DP83TG720S_LPS_CFG3, |
| 183 | + DP83TG720S_LPS_CFG3_PWR_MODE_0); |
| 184 | + if (ret) |
| 185 | + return ret; |
| 186 | + |
| 187 | + /* Make role configuration visible for ethtool on init and after |
| 188 | + * rest. |
| 189 | + */ |
| 190 | + return genphy_c45_pma_baset1_read_master_slave(phydev); |
173 | 191 | }
|
174 | 192 |
|
175 | 193 | static struct phy_driver dp83tg720_driver[] = {
|
|
0 commit comments