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 222C2145A1F; Tue, 21 Oct 2025 20:00:39 +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=1761076840; cv=none; b=sfURNpS1+fIpzlUbcy4cG+5AmW9+rC3bq5FkqQkw35nXZIa0+f66rLiL1ZbEJ+xdr0Ob4NYE9Y5pKcVM0vsjWUV2LS94XKSW85EWAWfCG3lKKsax7nDvX/o0CegsZ55z6nWSfd9eyDuYiydt2O1CAJP7VmreGDrVOenr88g/Nr0= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1761076840; c=relaxed/simple; bh=QCwgq/9iwQsOz5JV5leLcxsYLW5x1gpdTsa15gTvs44=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=cEGMF0z5q91/Phzdhdk7ZZRHZaj1T3hGU3GZpwoycatN+BNyXQGuL9dJzNqWSvZRdOzBzRLHHVXGAgAfScQalpXAW6ouAs8YBYCyWaXeaDVoeK+XY8welNQiyUU4x2g88Q9otlrr2q0LD/7M36WXrV62Rdq90YKJWtnHJgZVhts= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=Jw7rRTEk; 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="Jw7rRTEk" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 4FD47C4CEF5; Tue, 21 Oct 2025 20:00:39 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1761076839; bh=QCwgq/9iwQsOz5JV5leLcxsYLW5x1gpdTsa15gTvs44=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Jw7rRTEklv8tXZxT4P2VG+Pp+Mb4SmCb7iG9jL5ib+MOOi1DPg/r3SN4UX8FbpHY+ xInrnTbfqZ5gT7BB8pKs0D7vQ51/BuX588aVOm95Y7sLlw48amCzSOMX3YoQpaar0t qMMTTFbetWrh0Viiu3RF7uP+5gqITmlQrzLlu62k= 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 6.12 055/136] amd-xgbe: Avoid spurious link down messages during interface toggle Date: Tue, 21 Oct 2025 21:50:43 +0200 Message-ID: <20251021195037.304448641@linuxfoundation.org> X-Mailer: git-send-email 2.51.1 In-Reply-To: <20251021195035.953989698@linuxfoundation.org> References: <20251021195035.953989698@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 6.12-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 8bc49259d71af..32a6d52614242 100644 --- a/drivers/net/ethernet/amd/xgbe/xgbe-drv.c +++ b/drivers/net/ethernet/amd/xgbe/xgbe-drv.c @@ -1172,7 +1172,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 ed76a8df6ec6e..75e9cb3fc7aa6 100644 --- a/drivers/net/ethernet/amd/xgbe/xgbe-mdio.c +++ b/drivers/net/ethernet/amd/xgbe/xgbe-mdio.c @@ -1664,6 +1664,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