Jump to content

Ethernet not working on kernel 5.14.* nanopc-t4 and other rk3399


ScottP

Recommended Posts

Armbianmonitor:

Edit: This is a duplicate already reported and a pull request in place. mods please delete

 

 

The solution is to revert a patch related to power management. Symptoms are that ethernet link comes up, but no ip, dhcp, cannot assign ip address. the following patch resolves the issue on my system. I did not raise this in bug tracker since its not allowed to put things in there that are not supported. Unsure what else to do with info, hopefully it will help someone else.

From ad63cb5d37f9634fc097249ddda4240c10f041d7 Mon Sep 17 00:00:00 2001
From: Dan Johansen <strit@manjaro.org>
Date: Tue, 7 Sep 2021 16:26:09 +0200
Subject: [PATCH] Revert "net: stmmac: dwmac-rk: fix unbalanced
 pm_runtime_enable warnings"

This reverts commit 2d26f6e39afb88d32b8f39e76a51b542c3c51674.
---
 drivers/net/ethernet/stmicro/stmmac/dwmac-rk.c | 9 +++++++++
 1 file changed, 9 insertions(+)

diff --git a/drivers/net/ethernet/stmicro/stmmac/dwmac-rk.c b/drivers/net/ethernet/stmicro/stmmac/dwmac-rk.c
index ed817011a94a..280ac0129572 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,9 @@ static int rk_gmac_powerup(struct rk_priv_data *bsp_priv)
                return ret;
        }

+       pm_runtime_enable(dev);
+       pm_runtime_get_sync(dev);
+
        if (bsp_priv->integrated_phy)
                rk_gmac_integrated_phy_powerup(bsp_priv);

@@ -1536,9 +1540,14 @@ static int rk_gmac_powerup(struct rk_priv_data *bsp_priv)

 static void rk_gmac_powerdown(struct rk_priv_data *gmac)
 {
+       struct device *dev = &gmac->pdev->dev;
+
        if (gmac->integrated_phy)
                rk_gmac_integrated_phy_powerdown(gmac);

+       pm_runtime_put_sync(dev);
+       pm_runtime_disable(dev);
+
        phy_power_on(gmac, false);
        gmac_clk_enable(gmac, false);
 }
--
2.33.0

 

Link to comment
Share on other sites

There is apparently a partial revert that was accepted: https://lore.kernel.org/linux-rockchip/20211001160238.4335a83d@kicinski-fedora-pc1c0hjn.dhcp.thefacebook.com/T/#t

 

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

 

I haven't tested it my self.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...

Important Information

Terms of Use - Privacy Policy - Guidelines