Skip to content

Commit 708405f

Browse files
Bartosz Golaszewskidavem330
authored andcommitted
net: phy: aquantia: wait for the GLOBAL_CFG to start returning real values
When the PHY is first coming up (or resuming from suspend), it's possible that although the FW status shows as running, we still see zeroes in the GLOBAL_CFG set of registers and cannot determine available modes. Since all models support 10M, add a poll and wait the config to become available. Signed-off-by: Bartosz Golaszewski <[email protected]> Signed-off-by: David S. Miller <[email protected]>
1 parent ad649a1 commit 708405f

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

drivers/net/phy/aquantia/aquantia_main.c

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

657663
/* Walk the media-speed configuration registers to determine which
658664
* host-side serdes modes may be used by the PHY depending on the

0 commit comments

Comments
 (0)