]>
Commit | Line | Data |
---|---|---|
5520028e GKH |
1 | From da2c6cc3c1f3d2f6cab18352d00ab4a42c1ebee0 Mon Sep 17 00:00:00 2001 |
2 | From: Ricardo Ribalda <ricardo.ribalda@gmail.com> | |
3 | Date: Tue, 1 Oct 2013 08:17:10 +0200 | |
4 | Subject: ll_temac: Reset dma descriptors indexes on ndo_open | |
5 | ||
6 | From: Ricardo Ribalda <ricardo.ribalda@gmail.com> | |
7 | ||
8 | [ Upstream commit 7167cf0e8cd10287b7912b9ffcccd9616f382922 ] | |
9 | ||
10 | The dma descriptors indexes are only initialized on the probe function. | |
11 | ||
12 | If a packet is on the buffer when temac_stop is called, the dma | |
13 | descriptors indexes can be left on a incorrect state where no other | |
14 | package can be sent. | |
15 | ||
16 | So an interface could be left in an usable state after ifdow/ifup. | |
17 | ||
18 | This patch makes sure that the descriptors indexes are in a proper | |
19 | status when the device is open. | |
20 | ||
21 | Signed-off-by: Ricardo Ribalda Delgado <ricardo.ribalda@gmail.com> | |
22 | Signed-off-by: David S. Miller <davem@davemloft.net> | |
23 | Signed-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: |