public inbox for netdev@vger.kernel.org 
 help / color / mirror / Atom feed
From: Meng Li <Meng.Li@windriver•com>
To: stable@vger•kernel.org, davem@davemloft•net, kuba@kernel•org,
	mcoquelin.stm32@gmail•com, linux@armlinux•org.uk, andrew@lunn•ch,
	qiangqing.zhang@nxp•com
Cc: linux-kernel@vger•kernel.org, netdev@vger•kernel.org,
	meng.li@windriver•com
Subject: [PATCH 6/6] net: stmmac: dwmac-rk: fix unbalanced pm_runtime_enable warnings
Date: Fri, 19 Nov 2021 10:53:59 +0800	[thread overview]
Message-ID: <20211119025359.30815-7-Meng.Li@windriver.com> (raw)
In-Reply-To: <20211119025359.30815-1-Meng.Li@windriver.com>

From: Michael Riesch <michael.riesch@wolfvision•net>

commit 2d26f6e39afb88d32b8f39e76a51b542c3c51674 upstream.

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.

Fixes: 5ec55823438e850c91c6b92aec93fb04ebde29e2 ("net: stmmac: add clocks management for gmac driver")
Signed-off-by: Michael Riesch <michael.riesch@wolfvision•net>
Signed-off-by: David S. Miller <davem@davemloft•net>
Signed-off-by: Meng Li <Meng.Li@windriver•com>
---
 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 6ef30252bfe0..143b2cb13bf9 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"
 
@@ -1336,9 +1335,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);
 
@@ -1347,14 +1343,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


  parent reply	other threads:[~2021-11-19  2:55 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-11-19  2:53 [PATCH 0/6] backport patches to improve clocks management for stmmac driver Meng Li
2021-11-19  2:53 ` [PATCH 1/6] net: stmmac: add clocks management for gmac driver Meng Li
2021-11-19  2:53 ` [PATCH 2/6] net: stmmac: platform: fix build error with !CONFIG_PM_SLEEP Meng Li
2021-11-19  2:53 ` [PATCH 3/6] net: stmmac: fix missing unlock on error in stmmac_suspend() Meng Li
2021-11-19  2:53 ` [PATCH 4/6] net: stmmac: fix system hang if change mac address after interface ifdown Meng Li
2021-11-19  2:53 ` [PATCH 5/6] net: stmmac: fix issue where clk is being unprepared twice Meng Li
2021-11-19  2:53 ` Meng Li [this message]
2021-11-19 13:29 ` [PATCH 0/6] backport patches to improve clocks management for stmmac driver Greg KH

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=20211119025359.30815-7-Meng.Li@windriver.com \
    --to=meng.li@windriver$(echo .)com \
    --cc=andrew@lunn$(echo .)ch \
    --cc=davem@davemloft$(echo .)net \
    --cc=kuba@kernel$(echo .)org \
    --cc=linux-kernel@vger$(echo .)kernel.org \
    --cc=linux@armlinux$(echo .)org.uk \
    --cc=mcoquelin.stm32@gmail$(echo .)com \
    --cc=netdev@vger$(echo .)kernel.org \
    --cc=qiangqing.zhang@nxp$(echo .)com \
    --cc=stable@vger$(echo .)kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html
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