Skip to content
/ linux Public

Commit 2ee1064

Browse files
haokexingregkh
authored andcommitted
net: macb: Reinitialize tx/rx queue pointer registers and rx ring during resume
[ Upstream commit 718d076 ] On certain platforms, such as AMD Versal boards, the tx/rx queue pointer registers are cleared after suspend, and the rx queue pointer register is also disabled during suspend if WOL is enabled. Previously, we assumed that these registers would be restored by macb_mac_link_up(). However, in commit bf9cf80, macb_init_buffers() was moved from macb_mac_link_up() to macb_open(). Therefore, we should call macb_init_buffers() to reinitialize the tx/rx queue pointer registers during resume. Due to the reset of these two registers, we also need to adjust the tx/rx rings accordingly. The tx ring will be handled by gem_shuffle_tx_rings() in macb_mac_link_up(), so we only need to initialize the rx ring here. Fixes: bf9cf80 ("net: macb: Fix tx/rx malfunction after phy link down and up") Reported-by: Quanyang Wang <quanyang.wang@windriver.com> Signed-off-by: Kevin Hao <haokexin@gmail.com> Tested-by: Quanyang Wang <quanyang.wang@windriver.com> Cc: stable@vger.kernel.org Reviewed-by: Simon Horman <horms@kernel.org> Link: https://patch.msgid.link/20260312-macb-versal-v1-2-467647173fa4@gmail.com Signed-off-by: Jakub Kicinski <kuba@kernel.org> Signed-off-by: Sasha Levin <sashal@kernel.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
1 parent f1cf617 commit 2ee1064

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

drivers/net/ethernet/cadence/macb_main.c

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5527,8 +5527,18 @@ static int __maybe_unused macb_resume(struct device *dev)
55275527
rtnl_unlock();
55285528
}
55295529

5530+
if (!(bp->caps & MACB_CAPS_MACB_IS_EMAC))
5531+
macb_init_buffers(bp);
5532+
55305533
for (q = 0, queue = bp->queues; q < bp->num_queues;
55315534
++q, ++queue) {
5535+
if (!(bp->caps & MACB_CAPS_MACB_IS_EMAC)) {
5536+
if (macb_is_gem(bp))
5537+
gem_init_rx_ring(queue);
5538+
else
5539+
macb_init_rx_ring(queue);
5540+
}
5541+
55325542
napi_enable(&queue->napi_rx);
55335543
napi_enable(&queue->napi_tx);
55345544
}

0 commit comments

Comments
 (0)