1 From ddeacc4f6494e07cbb6f033627926623f3e7a9d0 Mon Sep 17 00:00:00 2001
2 From: =?UTF-8?q?Rafa=C5=82=20Mi=C5=82ecki?= <rafal@milecki.pl>
3 Date: Tue, 22 Jun 2021 07:24:15 +0200
4 Subject: [PATCH] net: broadcom: bcm4908_enet: reset DMA rings sw indexes
7 Content-Type: text/plain; charset=UTF-8
8 Content-Transfer-Encoding: 8bit
10 Resetting software indexes in bcm4908_dma_alloc_buf_descs() is not
11 enough as it's called during device probe only. Driver resets DMA on
12 every .ndo_open callback and it's required to reset indexes then.
14 This fixes inconsistent rings state and stalled traffic after interface
17 Fixes: 4feffeadbcb2 ("net: broadcom: bcm4908enet: add BCM4908 controller driver")
18 Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
19 Signed-off-by: David S. Miller <davem@davemloft.net>
21 drivers/net/ethernet/broadcom/bcm4908_enet.c | 6 +++---
22 1 file changed, 3 insertions(+), 3 deletions(-)
24 --- a/drivers/net/ethernet/broadcom/bcm4908_enet.c
25 +++ b/drivers/net/ethernet/broadcom/bcm4908_enet.c
26 @@ -174,9 +174,6 @@ static int bcm4908_dma_alloc_buf_descs(s
28 goto err_free_buf_descs;
31 - ring->write_idx = 0;
36 @@ -303,6 +300,9 @@ static void bcm4908_enet_dma_ring_init(s
38 enet_write(enet, ring->st_ram_block + ENET_DMA_CH_STATE_RAM_BASE_DESC_PTR,
39 (uint32_t)ring->dma_addr);
42 + ring->write_idx = 0;
45 static void bcm4908_enet_dma_uninit(struct bcm4908_enet *enet)