From patchwork Tue Jan 30 09:28:38 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Romain Gantois X-Patchwork-Id: 13537089 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 13732C48285 for ; Tue, 30 Jan 2024 09:28:56 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:Cc:To:In-Reply-To:References:Message-Id :MIME-Version:Subject:Date:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=XksdEFHPrE3j2bpIkaMaNhy3Mwg0biLaM73I4ZSON6E=; b=AKCPm1BawXvOKk +ykshem/UZktJfLf8jRQKdFNhd27NH7tQaCpRxawrQKSLl74+iwzRzoiDuPqQdHf8cYsGZlxrRXFP LKrrIysaaL8gri4f7SqQCDLSGEiVw/W7As2Fi4hFzn3x0R1Ag35EDIf9fvFEhnlePO0skd+oNUX6l 3fYx0yuBSXiE+RgkwHwU9Vhnks/0/RCQvfW7+i+DN3nlydSsj0xWliaVjc6C4N3f8dIfNaqMkwIAH XxdO1ran8dRpLpkAxYYUVch1Etap8zxpOPi+z4H0fx44TX59x7QwS2CJq9FE45cr4GdSDGMN0gxtB yzgp7/U8Vo64N711e4Sg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1rUkQ7-0000000FvlE-1L7B; Tue, 30 Jan 2024 09:28:43 +0000 Received: from relay3-d.mail.gandi.net ([2001:4b98:dc4:8::223]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1rUkPj-0000000FvVW-0cGb for linux-arm-kernel@lists.infradead.org; Tue, 30 Jan 2024 09:28:22 +0000 Received: by mail.gandi.net (Postfix) with ESMTPSA id 3B95D6000E; Tue, 30 Jan 2024 09:28:16 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bootlin.com; s=gm1; t=1706606897; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=Z1rEc2x1Xw5kU2zMQPLLg1FffYOTNZVyoqaN2YLglyM=; b=m1T7nW+b5TG09bRQv/t3Olu40lXYDbburKAes2pyi2pN4ODnjTZjLMk4lIIIA6+BBdNEqN 0oGDUqEN4yktpP2fEYrCxhvp1Om9q9XZ7Bq04QPqJmwhsT1gaA5WfAMdm5zJUBZA4wxKzu yb05XBIIjvRSp83U5FYM0nC8aU6ugY6LZn0pMRVGTJglzGi/aD9gdPtnPm/IPgGn5iMuGJ jLfe1L//8Hmu+Dx9UknY/I0YsQntzZjT9etQypex2CpYGLk2Zk5BHF8HIqs6PBvYf40Inr 5UZzPzePY+ix4gZY+8nXOdgYxaE+rF7ETM+KaLIcosM0BvusobgYSBW2iX7+cQ== From: Romain Gantois Date: Tue, 30 Jan 2024 10:28:38 +0100 Subject: [PATCH net-next v2 3/7] net: stmmac: don't rely on lynx_pcs presence to check for a PHY MIME-Version: 1.0 Message-Id: <20240130-rxc_bugfix-v2-3-5e6c3168e5f0@bootlin.com> References: <20240130-rxc_bugfix-v2-0-5e6c3168e5f0@bootlin.com> In-Reply-To: <20240130-rxc_bugfix-v2-0-5e6c3168e5f0@bootlin.com> To: Russell King , Andrew Lunn , Heiner Kallweit , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Alexandre Torgue , Jose Abreu , Maxime Coquelin , =?utf-8?b?Q2zDqW1lbnQgTMOp?= =?utf-8?b?Z2Vy?= Cc: Maxime Chevallier , Miquel Raynal , Thomas Petazzoni , netdev@vger.kernel.org, linux-stm32@st-md-mailman.stormreply.com, linux-arm-kernel@lists.infradead.org, linux-renesas-soc@vger.kernel.org, Romain Gantois X-Mailer: b4 0.12.4 X-GND-Sasl: romain.gantois@bootlin.com X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240130_012819_571950_3F510CA7 X-CRM114-Status: GOOD ( 12.12 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org From: Maxime Chevallier When initializing attached PHYs, there are some cases where we don't expect any PHY to be connected. The logic uses conditions based on various local PCS configuration, but also calls-in phylink_expects_phy() via stmmac_init_phy(), which is enough to ensure we don't try to initialize a PHY when using a Lynx PCS, as long as we have the phy_interface set to a 802.3z mode and are using inband negociation. Drop the lynx check, making the stmmac generic code more pcs_lynx-agnostic. Signed-off-by: Maxime Chevallier [rgantois: commit log] Signed-off-by: Romain Gantois --- drivers/net/ethernet/stmicro/stmmac/stmmac_main.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c b/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c index b334eb16da23..7f0900f53248 100644 --- a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c +++ b/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c @@ -3918,8 +3918,7 @@ static int __stmmac_open(struct net_device *dev, if (priv->hw->pcs != STMMAC_PCS_TBI && priv->hw->pcs != STMMAC_PCS_RTBI && (!priv->hw->xpcs || - xpcs_get_an_mode(priv->hw->xpcs, mode) != DW_AN_C73) && - !priv->hw->lynx_pcs) { + xpcs_get_an_mode(priv->hw->xpcs, mode) != DW_AN_C73)) { ret = stmmac_init_phy(dev); if (ret) { netdev_err(priv->dev,