From patchwork Thu Feb 27 15:05:22 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Russell King (Oracle)" X-Patchwork-Id: 13995085 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 50E57C282C7 for ; Thu, 27 Feb 2025 19:37:45 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:List-Subscribe:List-Help :List-Post:List-Archive:List-Unsubscribe:List-Id:Date: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-Owner; bh=YCufWFd6G+xrz+BePjT03qTPZYQ4Xqveeaiwin3kBZY=; b=C1njU4ISTxAskZho+CpSAxT8pc v4BaPOnq96orkR0M0FlVZQ2GNLxMA+Cax94AZ3l6E45+epVScQV2eqsdzig8YLEtMWXtEFHM0YQ8/ BSeMFSf9V5CsfFQoxa8Owi5F5VV3d+Xb1n+ng8XyuV6Sjk85Gphe4cH+3++a24F4BG+7IPRnBtnJK uaJraWtZ3SBkt0xcAm2PURjFlSCkhe183mHA7AqEkLRSfpVbhA/H0IWi0hT5HK44xcMyAk0xQ5XqL dj8wsQCj0afmf0zAVzq9edCl1DR8tilcb4CNWPFidcCPiYGp/3Sue/SOnM2oCNmipwcWXOzV8I0lF NzAlzLjQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.98 #2 (Red Hat Linux)) id 1tnjhQ-00000008UGw-2A40; Thu, 27 Feb 2025 19:37:36 +0000 Received: from pandora.armlinux.org.uk ([2001:4d48:ad52:32c8:5054:ff:fe00:142]) by bombadil.infradead.org with esmtps (Exim 4.98 #2 (Red Hat Linux)) id 1tnfSN-00000007rJi-1oBx for linux-arm-kernel@lists.infradead.org; Thu, 27 Feb 2025 15:05: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=YCufWFd6G+xrz+BePjT03qTPZYQ4Xqveeaiwin3kBZY=; b=tlRKRqmfRq7SMY6gL21jv5t0mU qWtAohbIyGTYR85mQjfixnVJFbC2juOSSXj0NjQgKtr7wJkuXqcYJTRQ1FFywnnuqaWJ3H1UuzZ2F D8auRIOmrUdfIqgQZxBufhtUV4nt0czgVFfC9L1R+rdsm37G+bpDz1NRSebDiii7ecEH1MhGfP+81 ws8HsIdNNco/AZXDIOJY8xzOBS0tpu4tjcq0WeTG6dj7OB/EHW8XMxXwGIhw1MHmLyS1c2I6XUdcj /XcsoNotQahe9y5T+CYCs9X5LFLBzc49z1A3mdtER8BZZu1hoBIBlVTH4mXandvaEEM9vwyb0I+M0 SC1znplw==; Received: from e0022681537dd.dyn.armlinux.org.uk ([fd8f:7570:feb6:1:222:68ff:fe15:37dd]:41118 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 1tnfSI-0007Xj-2Q; Thu, 27 Feb 2025 15:05:42 +0000 Received: from rmk by rmk-PC.armlinux.org.uk with local (Exim 4.94.2) (envelope-from ) id 1tnfRy-0057SX-Lj; Thu, 27 Feb 2025 15:05:22 +0000 In-Reply-To: References: From: "Russell King (Oracle)" To: Andrew Lunn , Heiner Kallweit Cc: Alexandre Torgue , Andrew Lunn , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Jon Hunter , linux-arm-kernel@lists.infradead.org, linux-stm32@st-md-mailman.stormreply.com, Maxime Coquelin , netdev@vger.kernel.org, Paolo Abeni , Thierry Reding Subject: [PATCH RFC net-next 5/5] net: stmmac: leave enabling RE and TE to stmmac_mac_link_up() MIME-Version: 1.0 Content-Disposition: inline Message-Id: Date: Thu, 27 Feb 2025 15:05:22 +0000 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20250227_070547_467414_D2FBF35A X-CRM114-Status: GOOD ( 10.35 ) 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 We only need to enable the MAC receiver and transmiter only when the link has come up. With commit "net: stmmac: move phylink_resume() after resume setup is complete" we move the race between stmmac_mac_link_up() and stmmac_hw_setup(), ensuring that stmmac_mac_link_up() happens afterwards. This patch is a pre-requisit of this change. Remove the unnecessary call to stmmac_mac_set(, true) in stmmac_hw_setup(). Signed-off-by: Russell King (Oracle) Tested-by: Furong Xu <0x1207@gmail.com> --- drivers/net/ethernet/stmicro/stmmac/stmmac_main.c | 3 --- 1 file changed, 3 deletions(-) diff --git a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c b/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c index e47b702fb9f9..c80952349eb7 100644 --- a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c +++ b/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c @@ -3506,9 +3506,6 @@ static int stmmac_hw_setup(struct net_device *dev, bool ptp_register) priv->hw->rx_csum = 0; } - /* Enable the MAC Rx/Tx */ - stmmac_mac_set(priv, priv->ioaddr, true); - /* Set the HW DMA mode and the COE */ stmmac_dma_operation_mode(priv);