aboutsummaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorRicardo Ribalda <ricardo.ribalda@gmail.com>2013-10-01 08:17:10 +0200
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2013-10-13 14:51:07 -0700
commit67a8bceeb8f58b365104b0b35285205bff488727 (patch)
tree960aa160e3cddec43f4a9afc6c9f15b061af0e2e /drivers
parentdbe48e5b8c4f5f3096102d98cc53441178e67aa2 (diff)
downloadkernel_samsung_smdk4412-67a8bceeb8f58b365104b0b35285205bff488727.zip
kernel_samsung_smdk4412-67a8bceeb8f58b365104b0b35285205bff488727.tar.gz
kernel_samsung_smdk4412-67a8bceeb8f58b365104b0b35285205bff488727.tar.bz2
ll_temac: Reset dma descriptors indexes on ndo_open
[ 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: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/net/ll_temac_main.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/drivers/net/ll_temac_main.c b/drivers/net/ll_temac_main.c
index b7948cc..7ebb4c1 100644
--- a/drivers/net/ll_temac_main.c
+++ b/drivers/net/ll_temac_main.c
@@ -302,6 +302,12 @@ static int temac_dma_bd_init(struct net_device *ndev)
lp->rx_bd_p + (sizeof(*lp->rx_bd_v) * (RX_BD_NUM - 1)));
lp->dma_out(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;
out: