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 4DC541DC998; Tue, 27 May 2025 17:31:32 +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=1748367092; cv=none; b=rxy8EzAacYHoC3G14yHT52ynN44xGVr5IrZ/Ex34O7aqTKjxXhoUFnQlLqSlpoFx3GBPo469EFn0eNZwhpEYnpjjVGcbjz18jR61WgsgooA+2EenyFdFktLw3Css98EEz9i2DSOFwPFDbF9F1Wc7mi41raDjzK/eMNQwQe8hfYg= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1748367092; c=relaxed/simple; bh=VLVm+AMNUJp1v5fzwa6mXnuzySKXcTeP8hStWS9/q/I=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=MiJCaeSBsB6GybXW+W+CvY1N4U0zz+qL6rU2zm5THr6ZzU9liu7d2E9pSgZEKF44Cv/oHyhxkJlEh/IBn2cVc6say/T0ecl21SNW1SAzztyszYT7eQm5GlmBfWxyb+Ywdz1cpSxHLOyC/PaPr7uvNS0sNIQGzS6Q3tYQ2cmZiLY= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=H4+jpjP7; 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="H4+jpjP7" Received: by smtp.kernel.org (Postfix) with ESMTPSA id C8916C4CEE9; Tue, 27 May 2025 17:31:31 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1748367092; bh=VLVm+AMNUJp1v5fzwa6mXnuzySKXcTeP8hStWS9/q/I=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=H4+jpjP7SMGh7C4R7KUqeeXGDD7ChVwDu7He4Ni5gzwnJrsIk36xVx6Mzkn1M862B 4cfTyJWS2TtY56xmFk1SYm1kmxwdKNQCbfaP562pZZFOyvNwRZ/s6NwNa8IChg9ipt hwN8W27/mQpzQlP1yAXmY99CCu+fRwZNqUOxQbJk= From: Greg Kroah-Hartman To: stable@vger.kernel.org Cc: Greg Kroah-Hartman , patches@lists.linux.dev, "Russell King (Oracle)" , Choong Yong Liang , Jakub Kicinski , Sasha Levin Subject: [PATCH 6.14 275/783] net: phylink: use pl->link_interface in phylink_expects_phy() Date: Tue, 27 May 2025 18:21:12 +0200 Message-ID: <20250527162524.283536814@linuxfoundation.org> X-Mailer: git-send-email 2.49.0 In-Reply-To: <20250527162513.035720581@linuxfoundation.org> References: <20250527162513.035720581@linuxfoundation.org> User-Agent: quilt/0.68 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.14-stable review patch. If anyone has any objections, please let me know. ------------------ From: Choong Yong Liang [ Upstream commit b63263555eaafbf9ab1a82f2020bbee872d83759 ] The phylink_expects_phy() function allows MAC drivers to check if they are expecting a PHY to attach. The checking condition in phylink_expects_phy() aims to achieve the same result as the checking condition in phylink_attach_phy(). However, the checking condition in phylink_expects_phy() uses pl->link_config.interface, while phylink_attach_phy() uses pl->link_interface. Initially, both pl->link_interface and pl->link_config.interface are set to SGMII, and pl->cfg_link_an_mode is set to MLO_AN_INBAND. When the interface switches from SGMII to 2500BASE-X, pl->link_config.interface is updated by phylink_major_config(). At this point, pl->cfg_link_an_mode remains MLO_AN_INBAND, and pl->link_config.interface is set to 2500BASE-X. Subsequently, when the STMMAC interface is taken down administratively and brought back up, it is blocked by phylink_expects_phy(). Since phylink_expects_phy() and phylink_attach_phy() aim to achieve the same result, phylink_expects_phy() should check pl->link_interface, which never changes, instead of pl->link_config.interface, which is updated by phylink_major_config(). Reviewed-by: Russell King (Oracle) Signed-off-by: Choong Yong Liang Link: https://patch.msgid.link/20250227121522.1802832-2-yong.liang.choong@linux.intel.com Signed-off-by: Jakub Kicinski Signed-off-by: Sasha Levin --- drivers/net/phy/phylink.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/net/phy/phylink.c b/drivers/net/phy/phylink.c index 5be48eb810abb..8c4dfe9dc7650 100644 --- a/drivers/net/phy/phylink.c +++ b/drivers/net/phy/phylink.c @@ -2074,7 +2074,7 @@ bool phylink_expects_phy(struct phylink *pl) { if (pl->cfg_link_an_mode == MLO_AN_FIXED || (pl->cfg_link_an_mode == MLO_AN_INBAND && - phy_interface_mode_is_8023z(pl->link_config.interface))) + phy_interface_mode_is_8023z(pl->link_interface))) return false; return true; } -- 2.39.5