From patchwork Tue Jan 28 15:46:49 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: 13952751 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 6874BC0218A for ; Tue, 28 Jan 2025 16:18:30 +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=ZMJJltXWTlPgnB8E7H4VZiWjG4lWjUspm9Wi3VxQZ7g=; b=0snoYpzLnvUZRzdYSoxliJwekI cDCW+g+7I4ZwFA3uzFqUolDLSUMXXAiWeCLwzlJWRwaNUNwwLWbA7NAJujK8ktUyG9uSQpYUAs8Vt LiTipij1uaZCg7Pmsd0N9s/cBBLYsoUaBcse+72SBWeq2Bf3xPkS8IJNFVz8ZZrLCkSZtQqysNL7Z 4XLM25otzB+tuVwX2EN0qHvRqo83F57r4dQHUAWcAGxFdNYf+lyK3F/haa+Lho6vUsUQDsLlunrxA vth7mOpme3Urso9ouuIcV+kV+kq0UOBspWokwGg+UUwx5vdQeAT5f3MzfyysHi9xxxA+MCZ1x36kS ajlPiAFQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.98 #2 (Red Hat Linux)) id 1tcoI4-00000005IV7-1La3; Tue, 28 Jan 2025 16:18:16 +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 1tcnq0-00000005BwJ-0Jhm for linux-arm-kernel@lists.infradead.org; Tue, 28 Jan 2025 15:49:17 +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=ZMJJltXWTlPgnB8E7H4VZiWjG4lWjUspm9Wi3VxQZ7g=; b=b4VKyTFa+0liIqI6J+5VQpjYld sHW4GloEcB++WR5BjxyTM1lnOn7gZN+ycy7PdvsrStbrhg2dyR5d2kpmW9oexlp9T7qrF1Ed8CvJk Uzxoo6fmw9yXhp2lhh0C/iTT/IN0ApkiFzdDr14s2C2JIQTYks3uimYk+MWCbRQosJf7CT3MPz/+d FyScdoQBXn70z5RAKpI+SXffh3O7ZUp2fItFP/dtCm9xuKA05i93Tpxqwx/alBxJU2n10VGA++boi qszaxTPgcLq3Z+/7y21cypruz8LJOngqmjWUCEJxuR5TarmyYVZaqD+RPO/H6m/dEgboZzQbIRt98 flmrpWoQ==; Received: from e0022681537dd.dyn.armlinux.org.uk ([fd8f:7570:feb6:1:222:68ff:fe15:37dd]:55496 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 1tcnnx-0007Sn-0q; Tue, 28 Jan 2025 15:47:09 +0000 Received: from rmk by rmk-PC.armlinux.org.uk with local (Exim 4.94.2) (envelope-from ) id 1tcnnd-0037G8-Vg; Tue, 28 Jan 2025 15:46:50 +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 , linux-arm-kernel@lists.infradead.org, linux-stm32@st-md-mailman.stormreply.com, Maxime Coquelin , netdev@vger.kernel.org, Paolo Abeni , Vladimir Oltean , Jiawen Wu Subject: [PATCH RFC net-next 01/22] net: stmmac: delete software timer before disabling LPI MIME-Version: 1.0 Content-Disposition: inline Message-Id: Date: Tue, 28 Jan 2025 15:46:49 +0000 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20250128_074916_107066_DBDA6317 X-CRM114-Status: GOOD ( 10.57 ) 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 Delete the software timer to ensure that the timer doesn't fire while we are modifying the LPI register state, potentially re-enabling LPI. Signed-off-by: Russell King (Oracle) --- drivers/net/ethernet/stmicro/stmmac/stmmac_main.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c b/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c index edbf8994455d..a1a788bbc75a 100644 --- a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c +++ b/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c @@ -447,8 +447,8 @@ static void stmmac_try_to_start_sw_lpi(struct stmmac_priv *priv) */ static void stmmac_stop_sw_lpi(struct stmmac_priv *priv) { - stmmac_reset_eee_mode(priv, priv->hw); del_timer_sync(&priv->eee_ctrl_timer); + stmmac_reset_eee_mode(priv, priv->hw); priv->tx_path_in_lpi_mode = false; } @@ -492,8 +492,8 @@ static void stmmac_eee_init(struct stmmac_priv *priv, bool active) if (priv->eee_enabled) { netdev_dbg(priv->dev, "disable EEE\n"); priv->eee_sw_timer_en = false; - stmmac_disable_hw_lpi_timer(priv); del_timer_sync(&priv->eee_ctrl_timer); + stmmac_disable_hw_lpi_timer(priv); stmmac_set_eee_timer(priv, priv->hw, 0, STMMAC_DEFAULT_TWT_LS); if (priv->hw->xpcs)