lkml.org 
[lkml]   [2014]   [May]   [11]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    Patch in this message
    /
    Date
    From
    Subject[ 045/143] ll_temac: Reset dma descriptors indexes on ndo_open
    2.6.32-longterm review patch.  If anyone has any objections, please let me know.

    ------------------

    From: Ricardo Ribalda <ricardo.ribalda@gmail.com>

    [ Upstream commit 7167cf0e8cd10287b7912b9ffcccd9616f382922 ]

    The dma descriptors indexes are only initialized on the probe function.

    If a packet is on the buffer when temac_stop is called, the dma
    descriptors indexes can be left on a incorrect state where no other
    package can be sent.

    So an interface could be left in an usable state after ifdow/ifup.

    This patch makes sure that the descriptors indexes are in a proper
    status when the device is open.

    Signed-off-by: Ricardo Ribalda Delgado <ricardo.ribalda@gmail.com>
    Signed-off-by: David S. Miller <davem@davemloft.net>
    Signed-off-by: Willy Tarreau <w@1wt.eu>
    ---
    drivers/net/ll_temac_main.c | 6 ++++++
    1 file changed, 6 insertions(+)

    diff --git a/drivers/net/ll_temac_main.c b/drivers/net/ll_temac_main.c
    index f2a197f..d2516dd 100644
    --- a/drivers/net/ll_temac_main.c
    +++ b/drivers/net/ll_temac_main.c
    @@ -190,6 +190,12 @@ static int temac_dma_bd_init(struct net_device *ndev)
    lp->rx_bd_p + (sizeof(*lp->rx_bd_v) * (RX_BD_NUM - 1)));
    temac_dma_out32(lp, TX_CURDESC_PTR, lp->tx_bd_p);

    + /* Init descriptor indexes */
    + lp->tx_bd_ci = 0;
    + lp->tx_bd_next = 0;
    + lp->tx_bd_tail = 0;
    + lp->rx_bd_ci = 0;
    +
    return 0;
    }

    --
    1.7.12.2.21.g234cd45.dirty




    \
     
     \ /
      Last update: 2014-05-12 04:41    [W:4.111 / U:0.152 seconds]
    ©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site