linux-rockchip.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] net: stmmac: dwmac-rk: Fix ethernet on rk3399 based devices
@ 2021-09-29 13:50 Punit Agrawal
  2021-09-29 21:02 ` Heiko Stübner
  0 siblings, 1 reply; 9+ messages in thread
From: Punit Agrawal @ 2021-09-29 13:50 UTC (permalink / raw)
  To: netdev
  Cc: linux-rockchip, linux-arm-kernel, davem, peppe.cavallaro,
	alexandre.torgue, kuba, Punit Agrawal, Heiko Stuebner,
	Michael Riesch

Commit 2d26f6e39afb ("net: stmmac: dwmac-rk: fix unbalanced pm_runtime_enable warnings")
while getting rid of a runtime PM warning ended up breaking ethernet
on rk3399 based devices. By dropping an extra reference to the device,
the commit ends up enabling suspend / resume of the ethernet device -
which appears to be broken.

While the issue with runtime pm is being investigated, partially
revert commit 2d26f6e39afb to restore the network on rk3399.

Fixes: 2d26f6e39afb ("net: stmmac: dwmac-rk: fix unbalanced pm_runtime_enable warnings")
Suggested-by: Heiko Stuebner <heiko@sntech.de>
Signed-off-by: Punit Agrawal <punitagrawal@gmail.com>
Cc: Michael Riesch <michael.riesch@wolfvision.net>
---
Hi,

There's been a few reports of broken ethernet on rk3399 based
boards. The issue got introduced due to a late commit in the 5.14
cycle.

It would be great if this commit can be taken as a fix for the next rc
as well as applied to the 5.14 stable releases.

Thanks,
Punit

 drivers/net/ethernet/stmicro/stmmac/dwmac-rk.c | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/drivers/net/ethernet/stmicro/stmmac/dwmac-rk.c b/drivers/net/ethernet/stmicro/stmmac/dwmac-rk.c
index ed817011a94a..6924a6aacbd5 100644
--- a/drivers/net/ethernet/stmicro/stmmac/dwmac-rk.c
+++ b/drivers/net/ethernet/stmicro/stmmac/dwmac-rk.c
@@ -21,6 +21,7 @@
 #include <linux/delay.h>
 #include <linux/mfd/syscon.h>
 #include <linux/regmap.h>
+#include <linux/pm_runtime.h>
 
 #include "stmmac_platform.h"
 
@@ -1528,6 +1529,8 @@ static int rk_gmac_powerup(struct rk_priv_data *bsp_priv)
 		return ret;
 	}
 
+	pm_runtime_get_sync(dev);
+
 	if (bsp_priv->integrated_phy)
 		rk_gmac_integrated_phy_powerup(bsp_priv);
 
@@ -1539,6 +1542,8 @@ static void rk_gmac_powerdown(struct rk_priv_data *gmac)
 	if (gmac->integrated_phy)
 		rk_gmac_integrated_phy_powerdown(gmac);
 
+	pm_runtime_put_sync(&gmac->pdev->dev);
+
 	phy_power_on(gmac, false);
 	gmac_clk_enable(gmac, false);
 }
-- 
2.32.0


_______________________________________________
Linux-rockchip mailing list
Linux-rockchip@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-rockchip

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

end of thread, other threads:[~2021-10-05  9:09 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-09-29 13:50 [PATCH] net: stmmac: dwmac-rk: Fix ethernet on rk3399 based devices Punit Agrawal
2021-09-29 21:02 ` Heiko Stübner
2021-10-01 23:02   ` Jakub Kicinski
2021-10-02 21:33     ` Andreas Rammhold
2021-10-03  0:20       ` Jakub Kicinski
2021-10-03  0:41         ` Andreas Rammhold
2021-10-03  9:15           ` Heiko Stübner
2021-10-04 12:06           ` Punit Agrawal
2021-10-05  9:08             ` andreas

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