NVIDIA: SAUCE: net: phy: aquantia: Poll for valid FW ID.
BugLink: https://bugs.launchpad.net/bugs/2072591 Firmware ID will be shown as 0xFFFF if firmware is not yet loaded. So, add this too in the exit condition of the poll so that poll won't exit for 0xFFFF and continues till init completion with valid FW ID. http://nvbugs/4382502 Signed-off-by: Pohsun Su <pohsuns@nvidia.com> Signed-off-by: Satish Seelamsetti <sseelamsetti@nvidia.com> Reviewed-by: Revanth Kumar Uppala <ruppala@nvidia.com> Reviewed-by: Bitan Biswas <bbiswas@nvidia.com> Signed-off-by: Laxman Dewangan <ldewangan@nvidia.com> Acked-by: Jacob Martin <jacob.martin@canonical.com> Acked-by: Noah Wager <noah.wager@canonical.com> Signed-off-by: Noah Wager <noah.wager@canonical.com>
This commit is contained in:
@@ -124,6 +124,7 @@
|
||||
/* Vendor specific 1, MDIO_MMD_VEND1 */
|
||||
#define VEND1_GLOBAL_FW_ID 0x0020
|
||||
#define VEND1_GLOBAL_FW_ID_MAJOR GENMASK(15, 8)
|
||||
#define VEND1_GLOBAL_FW_ID_MASK GENMASK(15, 0)
|
||||
#define VEND1_GLOBAL_FW_ID_MINOR GENMASK(7, 0)
|
||||
|
||||
#define VEND1_GLOBAL_GEN_STAT2 0xc831
|
||||
@@ -688,7 +689,9 @@ static int aqr107_wait_reset_complete(struct phy_device *phydev)
|
||||
int val;
|
||||
|
||||
return phy_read_mmd_poll_timeout(phydev, MDIO_MMD_VEND1,
|
||||
VEND1_GLOBAL_FW_ID, val, val != 0,
|
||||
VEND1_GLOBAL_FW_ID, val,
|
||||
((val & VEND1_GLOBAL_FW_ID_MASK) != 0 &&
|
||||
(val & VEND1_GLOBAL_FW_ID_MASK) != VEND1_GLOBAL_FW_ID_MASK),
|
||||
20000, 2000000, false);
|
||||
}
|
||||
|
||||
@@ -964,7 +967,7 @@ static int aqr107_suspend(struct phy_device *phydev)
|
||||
int err;
|
||||
|
||||
if (priv->skip_lpm)
|
||||
return 0;
|
||||
return 0;
|
||||
|
||||
err = phy_set_bits_mmd(phydev, MDIO_MMD_VEND1, MDIO_CTRL1,
|
||||
MDIO_CTRL1_LPOWER);
|
||||
@@ -980,7 +983,7 @@ static int aqr107_resume(struct phy_device *phydev)
|
||||
int err;
|
||||
|
||||
if (priv->skip_lpm)
|
||||
return 0;
|
||||
return 0;
|
||||
|
||||
err = phy_clear_bits_mmd(phydev, MDIO_MMD_VEND1, MDIO_CTRL1,
|
||||
MDIO_CTRL1_LPOWER);
|
||||
|
||||
Reference in New Issue
Block a user