]> Git Repo - linux.git/commitdiff
net: phy: aquantia: wait for the GLOBAL_CFG to start returning real values
authorBartosz Golaszewski <[email protected]>
Mon, 8 Jul 2024 07:50:22 +0000 (09:50 +0200)
committerDavid S. Miller <[email protected]>
Wed, 10 Jul 2024 03:57:28 +0000 (04:57 +0100)
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]>
drivers/net/phy/aquantia/aquantia_main.c

index 974795bd0860abf8385f2ae1f6dc01210681c95c..2c8ba2725a919b66288c1ef1970275d69b36cbcd 100644 (file)
@@ -652,7 +652,13 @@ static int aqr107_fill_interface_modes(struct phy_device *phydev)
        unsigned long *possible = phydev->possible_interfaces;
        unsigned int serdes_mode, rate_adapt;
        phy_interface_t interface;
-       int i, val;
+       int i, val, ret;
+
+       ret = phy_read_mmd_poll_timeout(phydev, MDIO_MMD_VEND1,
+                                       VEND1_GLOBAL_CFG_10M, val, val != 0,
+                                       1000, 100000, false);
+       if (ret)
+               return ret;
 
        /* Walk the media-speed configuration registers to determine which
         * host-side serdes modes may be used by the PHY depending on the
This page took 0.065052 seconds and 4 git commands to generate.