netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] net: stmmac: don't stop RXC during LPI
@ 2022-01-23 14:12 Jisheng Zhang
  2022-01-23 15:52 ` Andrew Lunn
  2022-01-26  3:40 ` Jakub Kicinski
  0 siblings, 2 replies; 10+ messages in thread
From: Jisheng Zhang @ 2022-01-23 14:12 UTC (permalink / raw)
  To: Giuseppe Cavallaro, Alexandre Torgue, Jose Abreu,
	David S . Miller, Jakub Kicinski, Maxime Coquelin
  Cc: netdev, linux-stm32, linux-arm-kernel, linux-kernel

I met can't receive rx pkt issue with below steps:
0.plug in ethernet cable then boot normal and get ip from dhcp server
1.quickly hotplug out then hotplug in the ethernet cable
2.trigger the dhcp client to renew lease

tcpdump shows that the request tx pkt is sent out successfully,
but the mac can't receive the rx pkt.

The issue can easily be reproduced on platforms with PHY_POLL external
phy. If we don't allow the phy to stop the RXC during LPI, the issue
is gone. I think it's unsafe to stop the RXC during LPI because the mac
needs RXC clock to support RX logic.

And the 2nd param clk_stop_enable of phy_init_eee() is a bool, so use
false instead of 0.

Signed-off-by: Jisheng Zhang <jszhang@kernel.org>
---
 drivers/net/ethernet/stmicro/stmmac/stmmac_main.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c b/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c
index 6708ca2aa4f7..92a9b0b226b1 100644
--- a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c
+++ b/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c
@@ -1162,7 +1162,7 @@ static void stmmac_mac_link_up(struct phylink_config *config,
 
 	stmmac_mac_set(priv, priv->ioaddr, true);
 	if (phy && priv->dma_cap.eee) {
-		priv->eee_active = phy_init_eee(phy, 1) >= 0;
+		priv->eee_active = phy_init_eee(phy, false) >= 0;
 		priv->eee_enabled = stmmac_eee_init(priv);
 		priv->tx_lpi_enabled = priv->eee_enabled;
 		stmmac_set_eee_pls(priv, priv->hw, true);
-- 
2.34.1


^ permalink raw reply related	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2022-01-26 13:28 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-01-23 14:12 [PATCH] net: stmmac: don't stop RXC during LPI Jisheng Zhang
2022-01-23 15:52 ` Andrew Lunn
2022-01-23 16:08   ` Jisheng Zhang
2022-01-23 16:09     ` Jisheng Zhang
2022-01-23 18:29       ` Florian Fainelli
2022-01-24  6:25       ` Joakim Zhang
2022-01-23 17:39     ` Andrew Lunn
2022-01-26 12:55       ` Jisheng Zhang
2022-01-26 13:27         ` Russell King (Oracle)
2022-01-26  3:40 ` Jakub Kicinski

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).