From patchwork Thu Feb 27 14:38:03 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: 13994723 X-Patchwork-Delegate: kuba@kernel.org Received: from pandora.armlinux.org.uk (pandora.armlinux.org.uk [78.32.30.218]) (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 C90E9236441 for ; Thu, 27 Feb 2025 14:38:33 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=78.32.30.218 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1740667115; cv=none; b=Jd4qoP0yLnFLro6CwOERt1HV9JnaxcNIfcf7PqcmWt9u6lPVDhktIyBhdGm/nZh46Gk/LU5D3tI36QYYbPBJsYPdcBKV+e3WW1NhCjXTLO8uBzOreWXEKEkkqBYwL89xXXSdlZ/bCnX4t9/ylhmRs4PL0iRNRThw9FrnNwQf+kM= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1740667115; c=relaxed/simple; bh=x7zTaJhTMkR7PAQD21Wq36g3hKx26sKDeA3JOcKXS20=; h=In-Reply-To:References:From:To:Cc:Subject:MIME-Version: Content-Disposition:Content-Type:Message-Id:Date; b=bi9D9sHDbkzaDXhaJvYTYDbCv2TeO/tQnNvVf4Qu5K08C+ZYFibudv+yClkeSGKPWWNL4E1fN2jpcjqX536zjOxsA3MM5FOipDM3Mr6b86J4BOOHVCvo+vz/B9Zsn9YJR5ArPFPwB3ro4vFvhoW6CeVB4Q4CfVR2qcagl6h3I1k= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=armlinux.org.uk; spf=none smtp.mailfrom=armlinux.org.uk; dkim=pass (2048-bit key) header.d=armlinux.org.uk header.i=@armlinux.org.uk header.b=hhiZzwcz; arc=none smtp.client-ip=78.32.30.218 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=armlinux.org.uk Authentication-Results: smtp.subspace.kernel.org; spf=none smtp.mailfrom=armlinux.org.uk Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=armlinux.org.uk header.i=@armlinux.org.uk header.b="hhiZzwcz" 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=Z915uYURLS9YYBK3HUBsVHhjYSPFcN02eHGGjD1vORo=; b=hhiZzwczH9Jwtadlk7SMudUeFF XLSnG+YnH9bmqrRioM9+hniodnLIItH5IQk14TNZ4+Hbsa1kgzAylRWI1L0lNXz8QwWXXQJOU4o/u vHUg11YFlr88KC6I7w140r+cI83jfmFgGOFxx9tByGPC6UHsdmPrXsNiNkRxvNsCxgpe/nIfhQH4H op8/6arxw0G8A2P0eKaISlNJFq0v1fgsiYlxumE6cR8kpxgJGiwZEy4gyUlmKoA32iBOTmwtzgbB0 4kZrZTjqaTTi+oh6VhAJUeyXoe5SZAsgzcPSMqRATmFbne7xSb7CrAQnCRKjcE7thmWKcK6kLfM6Z ViGD3M5g==; Received: from e0022681537dd.dyn.armlinux.org.uk ([fd8f:7570:feb6:1:222:68ff:fe15:37dd]:35842 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 1tnf1r-0007R1-1z; Thu, 27 Feb 2025 14:38:23 +0000 Received: from rmk by rmk-PC.armlinux.org.uk with local (Exim 4.94.2) (envelope-from ) id 1tnf1X-0056LI-9i; Thu, 27 Feb 2025 14:38:03 +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 4/5] net: stmmac: move phylink_resume() after resume setup is complete Precedence: bulk X-Mailing-List: netdev@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Disposition: inline Message-Id: Sender: Russell King Date: Thu, 27 Feb 2025 14:38:03 +0000 X-Patchwork-Delegate: kuba@kernel.org X-Patchwork-State: RFC Move phylink_resume() to be after the setup in stmmac_resume() has completed, as phylink_resume() may result in an immediate call to the .mac_link_up method, which will enable the transmitter and receiver, and enable the transmit queues. This behaviour has been witnessed by Jon Hunter on the Jetson TX2 platform (Tegra 186). Signed-off-by: Russell King (Oracle) Reviewed-by: Andrew Lunn --- drivers/net/ethernet/stmicro/stmmac/stmmac_main.c | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c b/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c index fbcba6c71f12..23c610f7c779 100644 --- a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c +++ b/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c @@ -7924,12 +7924,6 @@ int stmmac_resume(struct device *dev) return ret; } - rtnl_lock(); - phylink_resume(priv->phylink); - if (device_may_wakeup(priv->device) && !priv->plat->pmt) - phylink_speed_up(priv->phylink); - rtnl_unlock(); - rtnl_lock(); mutex_lock(&priv->lock); @@ -7948,6 +7942,11 @@ int stmmac_resume(struct device *dev) stmmac_enable_all_dma_irq(priv); mutex_unlock(&priv->lock); + + phylink_resume(priv->phylink); + if (device_may_wakeup(priv->device) && !priv->plat->pmt) + phylink_speed_up(priv->phylink); + rtnl_unlock(); netif_device_attach(ndev);