From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 2B105330D43; Mon, 27 Oct 2025 18:45:53 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1761590753; cv=none; b=htHZr503Xk9ZQqszzmAp3JvXqw1DbBnY01GWj/hjtZjUXih88yo/p6FoFeZoQFjTGyNJIj+mVjol1b0N9Ty6DN4DlusWx/AOel68FR+broXFritKQeWpbEnswFciQmtumvsNgFOcMlhP7v8K9z/2w4FZePozB1ewbpD18kkSUFc= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1761590753; c=relaxed/simple; bh=Qh5Mb/WRR1dOTK8PvTcx5HsrAYDydjZ4M9qUmkz6Hbw=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=C1FobGzPtfSnDeIQxP8OLizKtU23oHKxzFsNZZqCppoY8Fv5NaVqKVMoGn7u65oHRmKrc4gepO/wUUXZWgV4dDzB+GFPNjMfXeh84uc4rJeKiV3McrGtpkGH4wij81JQR6cfKpqS4llIAs6RubS8L8zF7xTiXOGS2Vxtn9oc0tE= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=arPTDYPw; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b="arPTDYPw" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 96D20C4CEFD; Mon, 27 Oct 2025 18:45:52 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1761590752; bh=Qh5Mb/WRR1dOTK8PvTcx5HsrAYDydjZ4M9qUmkz6Hbw=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=arPTDYPwbZf2dG/BuKQ6VeLNiw0nOYj61f7oepvfdq5yU3k9SU5PRWLZzB77mhAvb IairX/OtyKt5Lmk1PWYN/2nrjYUzL9ZIaLezETbWFJI7kd2qMtAZzMkEa8zfSZ/Wsz eQEymcEHibBkhXseJ2jCL+plnpm8M890N8x7neW8= From: Greg Kroah-Hartman To: stable@vger.kernel.org Cc: Greg Kroah-Hartman , patches@lists.linux.dev, Raju Rangoju , Dawid Osuchowski , Paolo Abeni , Sasha Levin Subject: [PATCH 5.4 161/224] amd-xgbe: Avoid spurious link down messages during interface toggle Date: Mon, 27 Oct 2025 19:35:07 +0100 Message-ID: <20251027183513.240802904@linuxfoundation.org> X-Mailer: git-send-email 2.51.1 In-Reply-To: <20251027183508.963233542@linuxfoundation.org> References: <20251027183508.963233542@linuxfoundation.org> User-Agent: quilt/0.69 X-stable: review X-Patchwork-Hint: ignore Precedence: bulk X-Mailing-List: patches@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 5.4-stable review patch. If anyone has any objections, please let me know. ------------------ From: Raju Rangoju [ Upstream commit 2616222e423398bb374ffcb5d23dea4ba2c3e524 ] During interface toggle operations (ifdown/ifup), the driver currently resets the local helper variable 'phy_link' to -1. This causes the link state machine to incorrectly interpret the state as a link change event, resulting in spurious "Link is down" messages being logged when the interface is brought back up. Preserve the phy_link state across interface toggles to avoid treating the -1 sentinel value as a legitimate link state transition. Fixes: 88131a812b16 ("amd-xgbe: Perform phy connect/disconnect at dev open/stop") Signed-off-by: Raju Rangoju Reviewed-by: Dawid Osuchowski Link: https://patch.msgid.link/20251010065142.1189310-1-Raju.Rangoju@amd.com Signed-off-by: Paolo Abeni Signed-off-by: Sasha Levin --- drivers/net/ethernet/amd/xgbe/xgbe-drv.c | 1 - drivers/net/ethernet/amd/xgbe/xgbe-mdio.c | 1 + 2 files changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/net/ethernet/amd/xgbe/xgbe-drv.c b/drivers/net/ethernet/amd/xgbe/xgbe-drv.c index de10e7e3a68d0..1fa7eb75d1a39 100644 --- a/drivers/net/ethernet/amd/xgbe/xgbe-drv.c +++ b/drivers/net/ethernet/amd/xgbe/xgbe-drv.c @@ -1247,7 +1247,6 @@ static void xgbe_free_rx_data(struct xgbe_prv_data *pdata) static int xgbe_phy_reset(struct xgbe_prv_data *pdata) { - pdata->phy_link = -1; pdata->phy_speed = SPEED_UNKNOWN; return pdata->phy_if.phy_reset(pdata); diff --git a/drivers/net/ethernet/amd/xgbe/xgbe-mdio.c b/drivers/net/ethernet/amd/xgbe/xgbe-mdio.c index 3819b23c927d5..6dd95e7d81e41 100644 --- a/drivers/net/ethernet/amd/xgbe/xgbe-mdio.c +++ b/drivers/net/ethernet/amd/xgbe/xgbe-mdio.c @@ -1637,6 +1637,7 @@ static int xgbe_phy_init(struct xgbe_prv_data *pdata) pdata->phy.duplex = DUPLEX_FULL; } + pdata->phy_link = 0; pdata->phy.link = 0; pdata->phy.pause_autoneg = pdata->pause_autoneg; -- 2.51.0