Commit e6a41c23 authored by Alexandre Belloni's avatar Alexandre Belloni Committed by David S. Miller

net: macb: ensure interface is not suspended on at91rm9200

Because of autosuspend, at91ether_start is called with clocks disabled.
Ensure that pm_runtime doesn't suspend the interface as soon as it is
opened as there is no pm_runtime support is the other relevant parts of the
platform support for at91rm9200.

Fixes: d54f89af ("net: macb: Add pm runtime support")
Signed-off-by: default avatarAlexandre Belloni <alexandre.belloni@bootlin.com>
Reviewed-by: default avatarClaudiu Beznea <claudiu.beznea@microchip.com>
Acked-by: default avatarNicolas Ferre <nicolas.ferre@microchip.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 540e585a
......@@ -3790,6 +3790,10 @@ static int at91ether_open(struct net_device *dev)
u32 ctl;
int ret;
ret = pm_runtime_get_sync(&lp->pdev->dev);
if (ret < 0)
return ret;
/* Clear internal statistics */
ctl = macb_readl(lp, NCR);
macb_writel(lp, NCR, ctl | MACB_BIT(CLRSTAT));
......@@ -3854,7 +3858,7 @@ static int at91ether_close(struct net_device *dev)
q->rx_buffers, q->rx_buffers_dma);
q->rx_buffers = NULL;
return 0;
return pm_runtime_put(&lp->pdev->dev);
}
/* Transmit packet */
......
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