From 7d73a731463cbb3c5567200a145f49d08c916f5c Mon Sep 17 00:00:00 2001 From: Bibhay Ranjan Date: Mon, 2 Dec 2024 13:36:34 +0000 Subject: [PATCH] nvethernet:set phy oldlink status correctly Issue: on resume the mac set speed is not called due to which the data transmissions are not happening in alternate suspend resume cycles. This is because the oldlink status is not set to 1 during the successful resume, in set_speed_work_func retries Fix: set oldlink to 1 once setspeed is successful in function set_speed_work_func, so that next time ether_adjust_link will call the set speed after resume Bug 4891730 Change-Id: Iadb426f2cada99387ce180dfa2d0c9ee57e7ccd5 Signed-off-by: Bibhay Ranjan Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3260342 Reviewed-by: Bhadram Varka Reviewed-by: svcacv GVS: buildbot_gerritrpt Reviewed-by: Ashutosh Jha --- drivers/net/ethernet/nvidia/nvethernet/ether_linux.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/drivers/net/ethernet/nvidia/nvethernet/ether_linux.c b/drivers/net/ethernet/nvidia/nvethernet/ether_linux.c index 6abf05b7..3a342c9e 100644 --- a/drivers/net/ethernet/nvidia/nvethernet/ether_linux.c +++ b/drivers/net/ethernet/nvidia/nvethernet/ether_linux.c @@ -1246,6 +1246,7 @@ static inline void set_speed_work_func(struct work_struct *work) struct phy_device *phydev = pdata->phydev; nveu32_t iface_mode = pdata->osi_core->phy_iface_mode; struct clk *mac_clk = NULL; + unsigned long val = 0; #ifndef OSI_STRIPPED_LIB unsigned int eee_enable = OSI_DISABLE; #endif /* !OSI_STRIPPED_LIB */ @@ -1304,6 +1305,12 @@ static inline void set_speed_work_func(struct work_struct *work) return; } + if (!pdata->oldlink) { + pdata->oldlink = 1; + val = pdata->xstats.link_connect_count; + pdata->xstats.link_connect_count = update_stats_counter(val, 1UL); + } + /* Set MGBE MAC_DIV/TX clk rate */ pdata->speed = speed; phy_print_status(phydev);