netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "Russell King (Oracle)" <rmk+kernel@armlinux.org.uk>
To: Andrew Lunn <andrew@lunn.ch>, Heiner Kallweit <hkallweit1@gmail.com>
Cc: Alexandre Torgue <alexandre.torgue@foss.st.com>,
	Andrew Lunn <andrew+netdev@lunn.ch>,
	"David S. Miller" <davem@davemloft.net>,
	Eric Dumazet <edumazet@google.com>,
	Jakub Kicinski <kuba@kernel.org>,
	Jon Hunter <jonathanh@nvidia.com>,
	linux-arm-kernel@lists.infradead.org,
	linux-stm32@st-md-mailman.stormreply.com,
	Maxime Coquelin <mcoquelin.stm32@gmail.com>,
	netdev@vger.kernel.org, Paolo Abeni <pabeni@redhat.com>,
	Thierry Reding <treding@nvidia.com>
Subject: [PATCH RFC net-next 5/5] net: stmmac: fix resume when media is in low-power mode
Date: Thu, 27 Feb 2025 14:38:08 +0000	[thread overview]
Message-ID: <E1tnf1c-0056LO-DN@rmk-PC.armlinux.org.uk> (raw)
In-Reply-To: <Z8B4tVd4nLUKXdQ4@shell.armlinux.org.uk>

The Synopsys Designwavre GMAC core databook requires all clocks to be
active in order to complete software reset.

This means if the PHY receive clock has been stopped due to the media
being in EEE low-power state, and the PHY being permitted to stop its
clock, then software reset will not complete.

Phylink now provides a way to work around this by calling
phylink_prepare_resume() before attempting to issue a reset. This will
prepare any attached PHY by disabling its permission to stop the clock.
phylink_resume() will restore the receive clock stop setting according
to the configuration passed from the netdev driver.

Signed-off-by: Russell King (Oracle) <rmk+kernel@armlinux.org.uk>
---
 drivers/net/ethernet/stmicro/stmmac/stmmac_main.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c b/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c
index 23c610f7c779..13796b1c8d7c 100644
--- a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c
+++ b/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c
@@ -7925,6 +7925,8 @@ int stmmac_resume(struct device *dev)
 	}
 
 	rtnl_lock();
+	phylink_prepare_resume(priv->phylink);
+
 	mutex_lock(&priv->lock);
 
 	stmmac_reset_queues_param(priv);
-- 
2.30.2


  parent reply	other threads:[~2025-02-27 14:38 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-02-27 14:37 [PATCH RFC 0/5] net: stmmac: fix resume failures due to RX clock Russell King (Oracle)
2025-02-27 14:37 ` [PATCH RFC net-next 1/5] net: phylink: add config of PHY receive clock-stop in phylink_resume() Russell King (Oracle)
2025-02-27 16:39   ` Andrew Lunn
2025-02-27 14:37 ` [PATCH RFC net-next 2/5] net: phylink: add phylink_prepare_resume() Russell King (Oracle)
2025-02-27 16:40   ` Andrew Lunn
2025-02-27 14:37 ` [PATCH RFC net-next 3/5] net: stmmac: simplify phylink_suspend() and phylink_resume() calls Russell King (Oracle)
2025-02-27 16:45   ` Andrew Lunn
2025-02-27 17:25     ` Russell King (Oracle)
2025-02-27 14:38 ` [PATCH RFC net-next 4/5] net: stmmac: move phylink_resume() after resume setup is complete Russell King (Oracle)
2025-02-27 16:46   ` Andrew Lunn
2025-02-27 14:38 ` Russell King (Oracle) [this message]
2025-02-27 16:47   ` [PATCH RFC net-next 5/5] net: stmmac: fix resume when media is in low-power mode Andrew Lunn
2025-03-06 11:30 ` [PATCH RFC 0/5] net: stmmac: fix resume failures due to RX clock Jon Hunter
2025-03-06 15:44   ` Russell King (Oracle)

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=E1tnf1c-0056LO-DN@rmk-PC.armlinux.org.uk \
    --to=rmk+kernel@armlinux.org.uk \
    --cc=alexandre.torgue@foss.st.com \
    --cc=andrew+netdev@lunn.ch \
    --cc=andrew@lunn.ch \
    --cc=davem@davemloft.net \
    --cc=edumazet@google.com \
    --cc=hkallweit1@gmail.com \
    --cc=jonathanh@nvidia.com \
    --cc=kuba@kernel.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-stm32@st-md-mailman.stormreply.com \
    --cc=mcoquelin.stm32@gmail.com \
    --cc=netdev@vger.kernel.org \
    --cc=pabeni@redhat.com \
    --cc=treding@nvidia.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).