Skip to content

Commit 5c959b1

Browse files
alexandrebelloninoglitch
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. Signed-off-by: Alexandre Belloni <[email protected]>
1 parent 27484da commit 5c959b1

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

drivers/net/ethernet/cadence/macb_main.c

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

3695+
ret = pm_runtime_get_sync(&lp->pdev->dev);
3696+
if (ret < 0)
3697+
return ret;
3698+
36953699
/* Clear internal statistics */
36963700
ctl = macb_readl(lp, NCR);
36973701
macb_writel(lp, NCR, ctl | MACB_BIT(CLRSTAT));
@@ -3752,7 +3756,7 @@ static int at91ether_close(struct net_device *dev)
37523756
q->rx_buffers, q->rx_buffers_dma);
37533757
q->rx_buffers = NULL;
37543758

3755-
return 0;
3759+
return pm_runtime_put(&lp->pdev->dev);
37563760
}
37573761

37583762
/* Transmit packet */

0 commit comments

Comments
 (0)