Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

ll_temac: Reset dma descriptors indexes on ndo_open

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>

authored by

Ricardo Ribalda and committed by
David S. Miller
7167cf0e 45906723

+6
+6
drivers/net/ethernet/xilinx/ll_temac_main.c
··· 297 297 lp->rx_bd_p + (sizeof(*lp->rx_bd_v) * (RX_BD_NUM - 1))); 298 298 lp->dma_out(lp, TX_CURDESC_PTR, lp->tx_bd_p); 299 299 300 + /* Init descriptor indexes */ 301 + lp->tx_bd_ci = 0; 302 + lp->tx_bd_next = 0; 303 + lp->tx_bd_tail = 0; 304 + lp->rx_bd_ci = 0; 305 + 300 306 return 0; 301 307 302 308 out: