From 888939cc5f0f869d4a8134a64a77518d1a39eb87 Mon Sep 17 00:00:00 2001 From: Revanth Kumar Uppala Date: Wed, 19 Feb 2025 09:49:30 +0000 Subject: [PATCH] NVIDIA: SAUCE: net: phy: aquantia: Poll for valid FW ID. Ethernet link up fails after SC7 resume as ethernet settings are configured before phy firmware is completely loaded. 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 http://nvbugs/4980644 Signed-off-by: Revanth Kumar Uppala Reviewed-by: Bhadram Varka Reviewed-by: Pohsun Su Reviewed-by: Narayan Reddy Reviewed-by: Bibek Basu Reviewed-by: Jon Hunter Signed-off-by: Vishwaroop A Acked-by: Noah Wager Acked-by: Jacob Martin Signed-off-by: Noah Wager --- drivers/net/phy/aquantia/aquantia_main.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/drivers/net/phy/aquantia/aquantia_main.c b/drivers/net/phy/aquantia/aquantia_main.c index 69a4636018f1..d7b6220e7bdd 100644 --- a/drivers/net/phy/aquantia/aquantia_main.c +++ b/drivers/net/phy/aquantia/aquantia_main.c @@ -683,7 +683,9 @@ int aqr_wait_reset_complete(struct phy_device *phydev) { int ret, val; - ret = read_poll_timeout(phy_read_mmd, val, val != 0, + ret = read_poll_timeout(phy_read_mmd, val, + ((val & VEND1_GLOBAL_FW_ID_MASK) != 0 && + (val & VEND1_GLOBAL_FW_ID_MASK) != VEND1_GLOBAL_FW_ID_MASK), AQR_FW_WAIT_SLEEP_US, AQR_FW_WAIT_TIMEOUT_US, false, phydev, MDIO_MMD_VEND1, VEND1_GLOBAL_FW_ID);