[PATCH] net: stmmac: dwmac-rk: fix unbalanced pm_runtime_enable warnings

Subsystems: arm/rockchip soc support, networking drivers, stmmac ethernet driver, the rest

STALE1800d

8 messages, 5 authors, 2021-08-30 · open the first message on its own page

[PATCH] net: stmmac: dwmac-rk: fix unbalanced pm_runtime_enable warnings

From: Michael Riesch <hidden>
Date: 2021-08-23 14:38:12

This reverts commit 2c896fb02e7f65299646f295a007bda043e0f382
"net: stmmac: dwmac-rk: add pd_gmac support for rk3399" and fixes
unbalanced pm_runtime_enable warnings.

In the commit to be reverted, support for power management was
introduced to the Rockchip glue code. Later, power management support
was introduced to the stmmac core code, resulting in multiple
invocations of pm_runtime_{enable,disable,get_sync,put_sync}.

The multiple invocations happen in rk_gmac_powerup and
stmmac_{dvr_probe, resume} as well as in rk_gmac_powerdown and
stmmac_{dvr_remove, suspend}, respectively, which are always called
in conjunction.

Signed-off-by: Michael Riesch <redacted>
---
 drivers/net/ethernet/stmicro/stmmac/dwmac-rk.c | 9 ---------
 1 file changed, 9 deletions(-)
diff --git a/drivers/net/ethernet/stmicro/stmmac/dwmac-rk.c b/drivers/net/ethernet/stmicro/stmmac/dwmac-rk.c
index 280ac0129572..ed817011a94a 100644
--- a/drivers/net/ethernet/stmicro/stmmac/dwmac-rk.c
+++ b/drivers/net/ethernet/stmicro/stmmac/dwmac-rk.c
@@ -21,7 +21,6 @@
 #include <linux/delay.h>
 #include <linux/mfd/syscon.h>
 #include <linux/regmap.h>
-#include <linux/pm_runtime.h>
 
 #include "stmmac_platform.h"
 
@@ -1529,9 +1528,6 @@ 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);
 
@@ -1540,14 +1536,9 @@ 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.17.1

Re: [PATCH] net: stmmac: dwmac-rk: fix unbalanced pm_runtime_enable warnings

From: Jakub Kicinski <kuba@kernel.org>
Date: 2021-08-23 16:44:29

On Mon, 23 Aug 2021 16:37:54 +0200 Michael Riesch wrote:
In the commit to be reverted, support for power management was
introduced to the Rockchip glue code. Later, power management support
was introduced to the stmmac core code, resulting in multiple
invocations of pm_runtime_{enable,disable,get_sync,put_sync}.
Can we get a Fixes tag? I.e. reference to the earliest commit where 
the warning can be triggered?
The multiple invocations happen in rk_gmac_powerup and
stmmac_{dvr_probe, resume} as well as in rk_gmac_powerdown and
stmmac_{dvr_remove, suspend}, respectively, which are always called
in conjunction.

Re: [PATCH] net: stmmac: dwmac-rk: fix unbalanced pm_runtime_enable warnings

From: Michael Riesch <hidden>
Date: 2021-08-25 08:08:00

Hi Jakub,

On 8/23/21 6:44 PM, Jakub Kicinski wrote:
On Mon, 23 Aug 2021 16:37:54 +0200 Michael Riesch wrote:
quoted
In the commit to be reverted, support for power management was
introduced to the Rockchip glue code. Later, power management support
was introduced to the stmmac core code, resulting in multiple
invocations of pm_runtime_{enable,disable,get_sync,put_sync}.
Can we get a Fixes tag? I.e. reference to the earliest commit where 
the warning can be triggered?
Of course :-)

Fixes: 5ec55823438e850c91c6b92aec93fb04ebde29e2 ("net: stmmac: add
clocks management for gmac driver")

This commit introduces power management support to the stmmac core
(stmmac_{dvr_probe, dvr_remove, suspend, resume}).

Best regards,
Michael
quoted
The multiple invocations happen in rk_gmac_powerup and
stmmac_{dvr_probe, resume} as well as in rk_gmac_powerdown and
stmmac_{dvr_remove, suspend}, respectively, which are always called
in conjunction.

Re: [PATCH] net: stmmac: dwmac-rk: fix unbalanced pm_runtime_enable warnings

From: patchwork-bot+netdevbpf@kernel.org
Date: 2021-08-25 09:50:11

Hello:

This patch was applied to netdev/net.git (refs/heads/master):

On Mon, 23 Aug 2021 16:37:54 +0200 you wrote:
This reverts commit 2c896fb02e7f65299646f295a007bda043e0f382
"net: stmmac: dwmac-rk: add pd_gmac support for rk3399" and fixes
unbalanced pm_runtime_enable warnings.

In the commit to be reverted, support for power management was
introduced to the Rockchip glue code. Later, power management support
was introduced to the stmmac core code, resulting in multiple
invocations of pm_runtime_{enable,disable,get_sync,put_sync}.

[...]
Here is the summary with links:
  - net: stmmac: dwmac-rk: fix unbalanced pm_runtime_enable warnings
    https://git.kernel.org/netdev/net/c/2d26f6e39afb

You are awesome, thank you!
--
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html

Re: [PATCH] net: stmmac: dwmac-rk: fix unbalanced pm_runtime_enable warnings

From: Chen-Yu Tsai <wens@kernel.org>
Date: 2021-08-29 17:48:38

Hi,

On Mon, Aug 23, 2021 at 10:39 PM Michael Riesch
[off-list ref] wrote:
This reverts commit 2c896fb02e7f65299646f295a007bda043e0f382
"net: stmmac: dwmac-rk: add pd_gmac support for rk3399" and fixes
unbalanced pm_runtime_enable warnings.

In the commit to be reverted, support for power management was
introduced to the Rockchip glue code. Later, power management support
was introduced to the stmmac core code, resulting in multiple
invocations of pm_runtime_{enable,disable,get_sync,put_sync}.

The multiple invocations happen in rk_gmac_powerup and
stmmac_{dvr_probe, resume} as well as in rk_gmac_powerdown and
stmmac_{dvr_remove, suspend}, respectively, which are always called
in conjunction.

Signed-off-by: Michael Riesch <redacted>
I just found that Ethernet stopped working on my RK3399 devices,
and I bisected it down to this patch.

The symptom I see is no DHCP responses, either because the request
isn't getting sent over the wire, or the response isn't getting
received. The PHY seems to be working correctly.


ChenYu

Re: [PATCH] net: stmmac: dwmac-rk: fix unbalanced pm_runtime_enable warnings

From: Michael Riesch <hidden>
Date: 2021-08-30 07:58:00

Hi ChenYu,

On 8/29/21 7:48 PM, Chen-Yu Tsai wrote:
Hi,

On Mon, Aug 23, 2021 at 10:39 PM Michael Riesch
[off-list ref] wrote:
quoted
This reverts commit 2c896fb02e7f65299646f295a007bda043e0f382
"net: stmmac: dwmac-rk: add pd_gmac support for rk3399" and fixes
unbalanced pm_runtime_enable warnings.

In the commit to be reverted, support for power management was
introduced to the Rockchip glue code. Later, power management support
was introduced to the stmmac core code, resulting in multiple
invocations of pm_runtime_{enable,disable,get_sync,put_sync}.

The multiple invocations happen in rk_gmac_powerup and
stmmac_{dvr_probe, resume} as well as in rk_gmac_powerdown and
stmmac_{dvr_remove, suspend}, respectively, which are always called
in conjunction.

Signed-off-by: Michael Riesch <redacted>
I just found that Ethernet stopped working on my RK3399 devices,
and I bisected it down to this patch.
Oh dear. First patch in a kernel release for a while and I already break
things.

Cc: Sasha as this patch has just been applied to 5.13-stable.
The symptom I see is no DHCP responses, either because the request
isn't getting sent over the wire, or the response isn't getting
received. The PHY seems to be working correctly.
Unfortunately I don't have any RK3399 hardware. Is this a custom
board/special hardware or something that is readily available in the
shops? Maybe this is a good reason to buy a RK3399 based single-board
computer :-)

I am working on the RK3568 EVB1 and have not encountered faulty
behavior. DHCP works fine and I can boot via NFS. Therefore, not sure
whether I can be much of help in this matter, but in case you want to
discuss this further please do not hesitate to contact me off-list.
ChenYu
Best regards,
Michael

Re: [PATCH] net: stmmac: dwmac-rk: fix unbalanced pm_runtime_enable warnings

From: Chen-Yu Tsai <wens@kernel.org>
Date: 2021-08-30 16:03:30

Hi,

On Mon, Aug 30, 2021 at 3:57 PM Michael Riesch
[off-list ref] wrote:
Hi ChenYu,

On 8/29/21 7:48 PM, Chen-Yu Tsai wrote:
quoted
Hi,

On Mon, Aug 23, 2021 at 10:39 PM Michael Riesch
[off-list ref] wrote:
quoted
This reverts commit 2c896fb02e7f65299646f295a007bda043e0f382
"net: stmmac: dwmac-rk: add pd_gmac support for rk3399" and fixes
unbalanced pm_runtime_enable warnings.

In the commit to be reverted, support for power management was
introduced to the Rockchip glue code. Later, power management support
was introduced to the stmmac core code, resulting in multiple
invocations of pm_runtime_{enable,disable,get_sync,put_sync}.

The multiple invocations happen in rk_gmac_powerup and
stmmac_{dvr_probe, resume} as well as in rk_gmac_powerdown and
stmmac_{dvr_remove, suspend}, respectively, which are always called
in conjunction.

Signed-off-by: Michael Riesch <redacted>
I just found that Ethernet stopped working on my RK3399 devices,
and I bisected it down to this patch.
Oh dear. First patch in a kernel release for a while and I already break
things.

Cc: Sasha as this patch has just been applied to 5.13-stable.
quoted
The symptom I see is no DHCP responses, either because the request
isn't getting sent over the wire, or the response isn't getting
received. The PHY seems to be working correctly.
Unfortunately I don't have any RK3399 hardware. Is this a custom
board/special hardware or something that is readily available in the
shops? Maybe this is a good reason to buy a RK3399 based single-board
computer :-)
I hit this on an ROC-RK3399-PC first, then bisected it on a NanoPi M4V2.
They both should be easy to get from their respective vendors. AFAIK
all the RK3399 devices have pretty much the same setup for Ethernet.

BTW, Don't get the Nanopi in the M4V2 variant. Get the original M4, or
the M4B (but the WiFi on the M4B doesn't seem to work lately).
I am working on the RK3568 EVB1 and have not encountered faulty
behavior. DHCP works fine and I can boot via NFS. Therefore, not sure
whether I can be much of help in this matter, but in case you want to
discuss this further please do not hesitate to contact me off-list.
My gut is telling me (without looking at the code) that maybe the GRF
access was not going through, and so the RGMII delays and stuff weren't
set properly, hence no traffic getting to/from the PHY. Otherwise there
were no error messages. I don't think I'll be able to squeeze out more
cycles to track down what actually went wrong though.


Regards
ChenYu

Re: [PATCH] net: stmmac: dwmac-rk: fix unbalanced pm_runtime_enable warnings

From: Sasha Levin <sashal@kernel.org>
Date: 2021-08-30 19:22:37

On Mon, Aug 30, 2021 at 09:57:51AM +0200, Michael Riesch wrote:
Hi ChenYu,

On 8/29/21 7:48 PM, Chen-Yu Tsai wrote:
quoted
Hi,

On Mon, Aug 23, 2021 at 10:39 PM Michael Riesch
[off-list ref] wrote:
quoted
This reverts commit 2c896fb02e7f65299646f295a007bda043e0f382
"net: stmmac: dwmac-rk: add pd_gmac support for rk3399" and fixes
unbalanced pm_runtime_enable warnings.

In the commit to be reverted, support for power management was
introduced to the Rockchip glue code. Later, power management support
was introduced to the stmmac core code, resulting in multiple
invocations of pm_runtime_{enable,disable,get_sync,put_sync}.

The multiple invocations happen in rk_gmac_powerup and
stmmac_{dvr_probe, resume} as well as in rk_gmac_powerdown and
stmmac_{dvr_remove, suspend}, respectively, which are always called
in conjunction.

Signed-off-by: Michael Riesch <redacted>
I just found that Ethernet stopped working on my RK3399 devices,
and I bisected it down to this patch.
Oh dear. First patch in a kernel release for a while and I already break
things.

Cc: Sasha as this patch has just been applied to 5.13-stable.
I'll drop it for now, thanks for letting me know!

-- 
Thanks,
Sasha
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help