Skip to content

Commit

Permalink
net: stmmac: dwmac-rk: Fix ethernet on rk3399 based devices
Browse files Browse the repository at this point in the history
Commit 2d26f6e ("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 2d26f6e to restore the network on rk3399.

Fixes: 2d26f6e ("net: stmmac: dwmac-rk: fix unbalanced pm_runtime_enable warnings")
Suggested-by: Heiko Stuebner <[email protected]>
Signed-off-by: Punit Agrawal <[email protected]>
Cc: Michael Riesch <[email protected]>
Tested-by: Heiko Stuebner <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Jakub Kicinski <[email protected]>
  • Loading branch information
punitagrawal authored and kuba-moo committed Oct 1, 2021
1 parent 019d932 commit aec3f41
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions drivers/net/ethernet/stmicro/stmmac/dwmac-rk.c
Original file line number Diff line number Diff line change
Expand Up @@ -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"

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

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

0 comments on commit aec3f41

Please sign in to comment.