Skip to content

Commit

Permalink
net: stmmac: dwmac-rk: fix unbalanced pm_runtime_enable warnings
Browse files Browse the repository at this point in the history
This reverts commit 2c896fb
"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: 5ec5582 ("net: stmmac: add clocks management for gmac driver")
Signed-off-by: Michael Riesch <[email protected]>
Signed-off-by: David S. Miller <[email protected]>
  • Loading branch information
mriesch-wv authored and davem330 committed Aug 25, 2021
1 parent 93100d6 commit 2d26f6e
Showing 1 changed file with 0 additions and 9 deletions.
9 changes: 0 additions & 9 deletions drivers/net/ethernet/stmicro/stmmac/dwmac-rk.c
Original file line number Diff line number Diff line change
Expand Up @@ -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"

Expand Down Expand Up @@ -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);

Expand All @@ -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);
}
Expand Down

0 comments on commit 2d26f6e

Please sign in to comment.