From patchwork Tue May 28 11:48:37 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Russell King (Oracle)" X-Patchwork-Id: 13676543 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 26904C25B7C for ; Tue, 28 May 2024 11:49:00 +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:Date:Message-Id:MIME-Version:Subject:Cc :To:From:References:In-Reply-To:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=pvbQ5jp02t2WpDd4Zn0BmELkHzwHtR+cb4gmzcY7N5M=; b=B4blBA22Ked14R 4WAsHRaMbqQUex7FORSlEahUTTvUUBuVskHUfvmrlcU4X/eCzeAmtuZQgEpNyVNsK0zvbYnEkQS1H DdIFkZBTocs7HWR5jQAjbTXsi89SXGO1gsttGQygCyVF98sAgKWoqG5yHE2GfFQ24Df3SwgNoeW4s cWuuy2/izhDpJBazXhn3EfZ12QVm3uPTZDFm8T4iiUSTDDblcAEi6CD7gvUY1Z6gAWmFRtp65bSkn CmaXD4Nlc61GbpnCVG5qKi/i1JbT2uE/Zv2ih/xIfVoh0dB7DbRMKY3on9gR01E5b88DlhSLhD3or CFo8zxa21Ccwrh271aGQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1sBvJx-00000000R8s-17Z9; Tue, 28 May 2024 11:48:49 +0000 Received: from pandora.armlinux.org.uk ([2001:4d48:ad52:32c8:5054:ff:fe00:142]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1sBvJu-00000000R7A-3trz for linux-arm-kernel@lists.infradead.org; Tue, 28 May 2024 11:48:48 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=armlinux.org.uk; s=pandora-2019; h=Date:Sender:Message-Id:Content-Type: Content-Transfer-Encoding:MIME-Version:Subject:Cc:To:From:References: In-Reply-To:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help: List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=KVEmjIyZjwAf32hRUX+GaRO6qlU2SBQWPCvlwhyLLVM=; b=qPuJovhSET0wOA68BxvgPKNBSo r8BDwHEFlMezlAHYNvAL1uMK+wqvqjzIExn6p2Dycks9qqgD2zrgD9LhNMZZl7RzBmlL4bbnMIy4M 4h/spUKYF2zOD1fy+3cegYi/sYxbup9ddTkF3IU1E6wlHzfVnPkWzDZY6arRSUtH7LuauEuEMOJb1 OI4F1Ed0Sytov+9AbYyA4/Eqw5e+eFpeNBqd1hJGRypTnO6GYPxukIlAFt67T4Po0Ok7VurEiU3iQ nm62lkxk/XnYjG4JWrf13pjEj1/oVDMTRDIruYZr4r7tZgxBRa+aL+sPHYL5qVB6ZbMl+BeSiDTop I6lw8xxw==; Received: from e0022681537dd.dyn.armlinux.org.uk ([fd8f:7570:feb6:1:222:68ff:fe15:37dd]:55014 helo=rmk-PC.armlinux.org.uk) by pandora.armlinux.org.uk with esmtpsa (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from ) id 1sBvJj-0004hi-0P; Tue, 28 May 2024 12:48:35 +0100 Received: from rmk by rmk-PC.armlinux.org.uk with local (Exim 4.94.2) (envelope-from ) id 1sBvJl-00EHyQ-QG; Tue, 28 May 2024 12:48:37 +0100 In-Reply-To: References: From: Russell King (Oracle) To: Serge Semin Cc: Alexandre Torgue , Jose Abreu , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Maxime Coquelin , netdev@vger.kernel.org, linux-stm32@st-md-mailman.stormreply.com, linux-arm-kernel@lists.infradead.org Subject: [PATCH net-next 1/5] net: stmmac: Drop TBI/RTBI PCS flags MIME-Version: 1.0 Content-Disposition: inline Message-Id: Date: Tue, 28 May 2024 12:48:37 +0100 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240528_044846_992117_922EDACF X-CRM114-Status: GOOD ( 10.58 ) 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: Serge Semin First of all the flags are never set by any of the driver parts. If nobody have them set then the respective statements will always have the same result. Thus the statements can be simplified or even dropped with no risk to break things. Secondly shall any of the TBI or RTBI flag is set the MDIO-bus registration will be bypassed. Why? It really seems weird. It's perfectly fine to have a TBI/RTBI-capable PHY configured over the MDIO bus interface. Based on the notes above the TBI/RTBI PCS flags can be freely dropped thus simplifying the driver code. Signed-off-by: Serge Semin Signed-off-by: Russell King (Oracle) Signed-off-by: Serge Semin Signed-off-by: Russell King (Oracle) Reviewed-by: Andrew Halaney --- drivers/net/ethernet/stmicro/stmmac/stmmac_main.c | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c b/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c index b3afc7cb7d72..e01340034d50 100644 --- a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c +++ b/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c @@ -7833,10 +7833,7 @@ void stmmac_dvr_remove(struct device *dev) reset_control_assert(priv->plat->stmmac_ahb_rst); stmmac_pcs_clean(ndev); - - if (priv->hw->pcs != STMMAC_PCS_TBI && - priv->hw->pcs != STMMAC_PCS_RTBI) - stmmac_mdio_unregister(ndev); + stmmac_mdio_unregister(ndev); destroy_workqueue(priv->wq); mutex_destroy(&priv->lock); bitmap_free(priv->af_xdp_zc_qps);