Skip to content

Commit a7f3abc

Browse files
Bartosz Golaszewskikuba-moo
authored andcommitted
net: phy: aquantia: only poll GLOBAL_CFG regs on aqr113, aqr113c and aqr115c
Commit 708405f ("net: phy: aquantia: wait for the GLOBAL_CFG to start returning real values") introduced a workaround for an issue observed on aqr115c. However there were never any reports of it happening on other models and the workaround has been reported to cause and issue on aqr113c (and it may cause the same on any other model not supporting 10M mode). Let's limit the impact of the workaround to aqr113, aqr113c and aqr115c and poll the 100M GLOBAL_CFG register instead as both models are known to support it correctly. Reported-by: Jon Hunter <[email protected]> Closes: https://lore.kernel.org/lkml/[email protected]/ Fixes: 708405f ("net: phy: aquantia: wait for the GLOBAL_CFG to start returning real values") Tested-by: Jon Hunter <[email protected]> Signed-off-by: Bartosz Golaszewski <[email protected]> Reviewed-by: Antoine Tenart <[email protected]> Link: https://patch.msgid.link/[email protected] Signed-off-by: Jakub Kicinski <[email protected]>
1 parent 84383b5 commit a7f3abc

File tree

1 file changed

+21
-8
lines changed

1 file changed

+21
-8
lines changed

drivers/net/phy/aquantia/aquantia_main.c

Lines changed: 21 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -653,13 +653,7 @@ static int aqr107_fill_interface_modes(struct phy_device *phydev)
653653
unsigned long *possible = phydev->possible_interfaces;
654654
unsigned int serdes_mode, rate_adapt;
655655
phy_interface_t interface;
656-
int i, val, ret;
657-
658-
ret = phy_read_mmd_poll_timeout(phydev, MDIO_MMD_VEND1,
659-
VEND1_GLOBAL_CFG_10M, val, val != 0,
660-
1000, 100000, false);
661-
if (ret)
662-
return ret;
656+
int i, val;
663657

664658
/* Walk the media-speed configuration registers to determine which
665659
* host-side serdes modes may be used by the PHY depending on the
@@ -708,6 +702,25 @@ static int aqr107_fill_interface_modes(struct phy_device *phydev)
708702
return 0;
709703
}
710704

705+
static int aqr113c_fill_interface_modes(struct phy_device *phydev)
706+
{
707+
int val, ret;
708+
709+
/* It's been observed on some models that - when coming out of suspend
710+
* - the FW signals that the PHY is ready but the GLOBAL_CFG registers
711+
* continue on returning zeroes for some time. Let's poll the 100M
712+
* register until it returns a real value as both 113c and 115c support
713+
* this mode.
714+
*/
715+
ret = phy_read_mmd_poll_timeout(phydev, MDIO_MMD_VEND1,
716+
VEND1_GLOBAL_CFG_100M, val, val != 0,
717+
1000, 100000, false);
718+
if (ret)
719+
return ret;
720+
721+
return aqr107_fill_interface_modes(phydev);
722+
}
723+
711724
static int aqr113c_config_init(struct phy_device *phydev)
712725
{
713726
int ret;
@@ -725,7 +738,7 @@ static int aqr113c_config_init(struct phy_device *phydev)
725738
if (ret)
726739
return ret;
727740

728-
return aqr107_fill_interface_modes(phydev);
741+
return aqr113c_fill_interface_modes(phydev);
729742
}
730743

731744
static int aqr107_probe(struct phy_device *phydev)

0 commit comments

Comments
 (0)