Skip to content

Commit cbcf099

Browse files
joabreudavem330
authored andcommitted
net: stmmac: RX Descriptors need to be clean before setting buffers
RX Descriptors are being cleaned after setting the buffers which may lead to buffer addresses being wiped out. Fix this by clearing earlier the RX Descriptors. Fixes: 2af6106 ("net: stmmac: Introducing support for Page Pool") Signed-off-by: Jose Abreu <[email protected]> Signed-off-by: David S. Miller <[email protected]>
1 parent f4e5f77 commit cbcf099

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

drivers/net/ethernet/stmicro/stmmac/stmmac_main.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1295,6 +1295,8 @@ static int init_dma_rx_desc_rings(struct net_device *dev, gfp_t flags)
12951295
"(%s) dma_rx_phy=0x%08x\n", __func__,
12961296
(u32)rx_q->dma_rx_phy);
12971297

1298+
stmmac_clear_rx_descriptors(priv, queue);
1299+
12981300
for (i = 0; i < DMA_RX_SIZE; i++) {
12991301
struct dma_desc *p;
13001302

@@ -1312,8 +1314,6 @@ static int init_dma_rx_desc_rings(struct net_device *dev, gfp_t flags)
13121314
rx_q->cur_rx = 0;
13131315
rx_q->dirty_rx = (unsigned int)(i - DMA_RX_SIZE);
13141316

1315-
stmmac_clear_rx_descriptors(priv, queue);
1316-
13171317
/* Setup the chained descriptor addresses */
13181318
if (priv->mode == STMMAC_CHAIN_MODE) {
13191319
if (priv->extend_desc)

0 commit comments

Comments
 (0)