Commit c72a0bc0 authored by Andrew Lunn's avatar Andrew Lunn Committed by David S. Miller

net: freescale: fec: Fix ethtool -d runtime PM

In order to dump the FECs registers the clocks have to be ticking,
otherwise a data abort occurs.  Add calls to runtime PM so they are
enabled and later disabled.

Fixes: e8fcfcd5 ("net: fec: optimize the clock management to save power")
Reported-by: default avatarChris Healy <Chris.Healy@zii.aero>
Signed-off-by: default avatarAndrew Lunn <andrew@lunn.ch>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 71130f29
...@@ -2199,8 +2199,14 @@ static void fec_enet_get_regs(struct net_device *ndev, ...@@ -2199,8 +2199,14 @@ static void fec_enet_get_regs(struct net_device *ndev,
{ {
struct fec_enet_private *fep = netdev_priv(ndev); struct fec_enet_private *fep = netdev_priv(ndev);
u32 __iomem *theregs = (u32 __iomem *)fep->hwp; u32 __iomem *theregs = (u32 __iomem *)fep->hwp;
struct device *dev = &fep->pdev->dev;
u32 *buf = (u32 *)regbuf; u32 *buf = (u32 *)regbuf;
u32 i, off; u32 i, off;
int ret;
ret = pm_runtime_get_sync(dev);
if (ret < 0)
return;
regs->version = fec_enet_register_version; regs->version = fec_enet_register_version;
...@@ -2216,6 +2222,9 @@ static void fec_enet_get_regs(struct net_device *ndev, ...@@ -2216,6 +2222,9 @@ static void fec_enet_get_regs(struct net_device *ndev,
off >>= 2; off >>= 2;
buf[off] = readl(&theregs[off]); buf[off] = readl(&theregs[off]);
} }
pm_runtime_mark_last_busy(dev);
pm_runtime_put_autosuspend(dev);
} }
static int fec_enet_get_ts_info(struct net_device *ndev, static int fec_enet_get_ts_info(struct net_device *ndev,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment