]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/blame - releases/3.10.16/ll_temac-reset-dma-descriptors-indexes-on-ndo_open.patch
Linux 4.14.95
[thirdparty/kernel/stable-queue.git] / releases / 3.10.16 / ll_temac-reset-dma-descriptors-indexes-on-ndo_open.patch
CommitLineData
5520028e
GKH
1From da2c6cc3c1f3d2f6cab18352d00ab4a42c1ebee0 Mon Sep 17 00:00:00 2001
2From: Ricardo Ribalda <ricardo.ribalda@gmail.com>
3Date: Tue, 1 Oct 2013 08:17:10 +0200
4Subject: ll_temac: Reset dma descriptors indexes on ndo_open
5
6From: Ricardo Ribalda <ricardo.ribalda@gmail.com>
7
8[ Upstream commit 7167cf0e8cd10287b7912b9ffcccd9616f382922 ]
9
10The dma descriptors indexes are only initialized on the probe function.
11
12If a packet is on the buffer when temac_stop is called, the dma
13descriptors indexes can be left on a incorrect state where no other
14package can be sent.
15
16So an interface could be left in an usable state after ifdow/ifup.
17
18This patch makes sure that the descriptors indexes are in a proper
19status when the device is open.
20
21Signed-off-by: Ricardo Ribalda Delgado <ricardo.ribalda@gmail.com>
22Signed-off-by: David S. Miller <davem@davemloft.net>
23Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
24---
25 drivers/net/ethernet/xilinx/ll_temac_main.c | 6 ++++++
26 1 file changed, 6 insertions(+)
27
28--- a/drivers/net/ethernet/xilinx/ll_temac_main.c
29+++ b/drivers/net/ethernet/xilinx/ll_temac_main.c
30@@ -297,6 +297,12 @@ static int temac_dma_bd_init(struct net_
31 lp->rx_bd_p + (sizeof(*lp->rx_bd_v) * (RX_BD_NUM - 1)));
32 lp->dma_out(lp, TX_CURDESC_PTR, lp->tx_bd_p);
33
34+ /* Init descriptor indexes */
35+ lp->tx_bd_ci = 0;
36+ lp->tx_bd_next = 0;
37+ lp->tx_bd_tail = 0;
38+ lp->rx_bd_ci = 0;
39+
40 return 0;
41
42 out: