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 96FB7223339; Mon, 2 Jun 2025 14:12:26 +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=1748873546; cv=none; b=FoIxYf6zf4ZvaykQvbli+Hma3Ey0s1siY6f6Cqpj8HBwL5y3AZjI7xGvwSrNmFffmNevVW34ee4lsNtGrQi7He8xxDfN0RQpqffQa8IXJkHAaIKGOi+KD6mkbIt6Tvim/RQi4Y71obiXXLNUFY5kmmUx2a4hPDC9AzGCq/LTAPw= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1748873546; c=relaxed/simple; bh=GtvYb46f/QSxv1GsVRzUulmLWtuUqitocoqEelJz3aU=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=dJxwcB8D0yjf8h8n7UaY+RRyB3lGxz8i8Esxwjg3SKl+WRbqlzAtacrzItsd8OwEeGvqpV7uirtvp7x1noLkCTO9dz21WSaZOqBvsLHmX70C7JhYE22lwKxS5lVvlHv2Svjtl6wKWFrdGnUc6LyjU0+xIgIkRVlq5IWx9d19cLg= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=X27/Lj4h; 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="X27/Lj4h" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 1EC44C4CEEB; Mon, 2 Jun 2025 14:12:25 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1748873546; bh=GtvYb46f/QSxv1GsVRzUulmLWtuUqitocoqEelJz3aU=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=X27/Lj4hC12I0Jn5eWLnPD+ZjrJv+xUR3g5cIuiuHeT2Z8jUYZqWwwBSGNkQjH5S7 RLnrBtuVJ5ecXsYSPCJrFGhmxWOOkgkEExEqtpk00oY+DkjcGL2WTqY+O3tndszVwr FwjMCvb0L9qd0ANaxfXQnL2SY/THTEbHllSxS7Uc= 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.6 145/444] net: phylink: use pl->link_interface in phylink_expects_phy() Date: Mon, 2 Jun 2025 15:43:29 +0200 Message-ID: <20250602134346.796448818@linuxfoundation.org> X-Mailer: git-send-email 2.49.0 In-Reply-To: <20250602134340.906731340@linuxfoundation.org> References: <20250602134340.906731340@linuxfoundation.org> User-Agent: quilt/0.68 X-stable: review X-Patchwork-Hint: ignore Precedence: bulk X-Mailing-List: stable@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 6.6-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 b5f012619e42d..800e8b9eb4532 100644 --- a/drivers/net/phy/phylink.c +++ b/drivers/net/phy/phylink.c @@ -1718,7 +1718,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