lkml.org 
[lkml]   [2021]   [Jul]   [26]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    Patch in this message
    /
    From
    Subject[PATCH 4.4 12/47] net: bcmgenet: Ensure all TX/RX queues DMAs are disabled
    Date
    From: Florian Fainelli <f.fainelli@gmail.com>

    commit 2b452550a203d88112eaf0ba9fc4b750a000b496 upstream.

    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 <maxime@cerno.tech>
    Fixes: 1c1008c793fa ("net: bcmgenet: add main driver file")
    Signed-off-by: Florian Fainelli <f.fainelli@gmail.com>
    Signed-off-by: David S. Miller <davem@davemloft.net>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
    ---
    drivers/net/ethernet/broadcom/genet/bcmgenet.c | 6 ++++++
    1 file changed, 6 insertions(+)

    --- a/drivers/net/ethernet/broadcom/genet/bcmgenet.c
    +++ b/drivers/net/ethernet/broadcom/genet/bcmgenet.c
    @@ -2663,15 +2663,21 @@ static void bcmgenet_set_hw_addr(struct
    /* Returns a reusable dma control register value */
    static u32 bcmgenet_dma_disable(struct bcmgenet_priv *priv)
    {
    + unsigned int i;
    u32 reg;
    u32 dma_ctrl;

    /* disable DMA */
    dma_ctrl = 1 << (DESC_INDEX + DMA_RING_BUF_EN_SHIFT) | DMA_EN;
    + for (i = 0; i < priv->hw_params->tx_queues; i++)
    + dma_ctrl |= (1 << (i + DMA_RING_BUF_EN_SHIFT));
    reg = bcmgenet_tdma_readl(priv, DMA_CTRL);
    reg &= ~dma_ctrl;
    bcmgenet_tdma_writel(priv, reg, DMA_CTRL);

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

    \
     
     \ /
      Last update: 2021-07-26 17:41    [W:3.421 / U:0.012 seconds]
    ©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site