Skip to content

Commit 2b45255

Browse files
ffainellidavem330
authored andcommitted
net: bcmgenet: Ensure all TX/RX queues DMAs are disabled
Make sure that we disable each of the TX and RX queues in the TDMA and RDMA control registers. This is a correctness change to be symmetrical with the code that enables the TX and RX queues. Tested-by: Maxime Ripard <[email protected]> Fixes: 1c1008c ("net: bcmgenet: add main driver file") Signed-off-by: Florian Fainelli <[email protected]> Signed-off-by: David S. Miller <[email protected]>
1 parent 5702b81 commit 2b45255

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

drivers/net/ethernet/broadcom/genet/bcmgenet.c

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3238,15 +3238,21 @@ static void bcmgenet_get_hw_addr(struct bcmgenet_priv *priv,
32383238
/* Returns a reusable dma control register value */
32393239
static u32 bcmgenet_dma_disable(struct bcmgenet_priv *priv)
32403240
{
3241+
unsigned int i;
32413242
u32 reg;
32423243
u32 dma_ctrl;
32433244

32443245
/* disable DMA */
32453246
dma_ctrl = 1 << (DESC_INDEX + DMA_RING_BUF_EN_SHIFT) | DMA_EN;
3247+
for (i = 0; i < priv->hw_params->tx_queues; i++)
3248+
dma_ctrl |= (1 << (i + DMA_RING_BUF_EN_SHIFT));
32463249
reg = bcmgenet_tdma_readl(priv, DMA_CTRL);
32473250
reg &= ~dma_ctrl;
32483251
bcmgenet_tdma_writel(priv, reg, DMA_CTRL);
32493252

3253+
dma_ctrl = 1 << (DESC_INDEX + DMA_RING_BUF_EN_SHIFT) | DMA_EN;
3254+
for (i = 0; i < priv->hw_params->rx_queues; i++)
3255+
dma_ctrl |= (1 << (i + DMA_RING_BUF_EN_SHIFT));
32503256
reg = bcmgenet_rdma_readl(priv, DMA_CTRL);
32513257
reg &= ~dma_ctrl;
32523258
bcmgenet_rdma_writel(priv, reg, DMA_CTRL);

0 commit comments

Comments
 (0)