Skip to content

Commit 726927d

Browse files
alexandrebelloniclaudiubeznea
authored andcommitted
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: d54f89a ("net: macb: Add pm runtime support") Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com> Reviewed-by: Claudiu Beznea <claudiu.beznea@microchip.com> Acked-by: Nicolas Ferre <nicolas.ferre@microchip.com> Signed-off-by: David S. Miller <davem@davemloft.net>
1 parent 9e9ea84 commit 726927d

1 file changed

Lines changed: 5 additions & 1 deletion

File tree

drivers/net/ethernet/cadence/macb_main.c

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3752,6 +3752,10 @@ static int at91ether_open(struct net_device *dev)
37523752
u32 ctl;
37533753
int ret;
37543754

3755+
ret = pm_runtime_get_sync(&lp->pdev->dev);
3756+
if (ret < 0)
3757+
return ret;
3758+
37553759
/* Clear internal statistics */
37563760
ctl = macb_readl(lp, NCR);
37573761
macb_writel(lp, NCR, ctl | MACB_BIT(CLRSTAT));
@@ -3816,7 +3820,7 @@ static int at91ether_close(struct net_device *dev)
38163820
q->rx_buffers, q->rx_buffers_dma);
38173821
q->rx_buffers = NULL;
38183822

3819-
return 0;
3823+
return pm_runtime_put(&lp->pdev->dev);
38203824
}
38213825

38223826
/* Transmit packet */

0 commit comments

Comments
 (0)