Merge branch 'net-macb-fix-ethernet-malfunction-on-amd-versal-board-after-suspend'

Kevin Hao says:

====================
net: macb: Fix Ethernet malfunction on AMD Versal board after suspend

On Versal boards, the tx/rx queue pointer registers are cleared after suspend,
which causes Ethernet malfunction. This patch series addresses this issue by
reinitializing the tx/rx queue pointer registers and the rx ring.
====================

Link: https://patch.msgid.link/20260312-macb-versal-v1-0-467647173fa4@gmail.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
This commit is contained in:
Jakub Kicinski
2026-03-14 12:19:48 -07:00

View File

@@ -2669,6 +2669,14 @@ static void macb_init_tieoff(struct macb *bp)
desc->ctrl = 0;
}
static void gem_init_rx_ring(struct macb_queue *queue)
{
queue->rx_tail = 0;
queue->rx_prepared_head = 0;
gem_rx_refill(queue);
}
static void gem_init_rings(struct macb *bp)
{
struct macb_queue *queue;
@@ -2686,10 +2694,7 @@ static void gem_init_rings(struct macb *bp)
queue->tx_head = 0;
queue->tx_tail = 0;
queue->rx_tail = 0;
queue->rx_prepared_head = 0;
gem_rx_refill(queue);
gem_init_rx_ring(queue);
}
macb_init_tieoff(bp);
@@ -5947,8 +5952,18 @@ static int __maybe_unused macb_resume(struct device *dev)
rtnl_unlock();
}
if (!(bp->caps & MACB_CAPS_MACB_IS_EMAC))
macb_init_buffers(bp);
for (q = 0, queue = bp->queues; q < bp->num_queues;
++q, ++queue) {
if (!(bp->caps & MACB_CAPS_MACB_IS_EMAC)) {
if (macb_is_gem(bp))
gem_init_rx_ring(queue);
else
macb_init_rx_ring(queue);
}
napi_enable(&queue->napi_rx);
napi_enable(&queue->napi_tx);
}