]> git.baikalelectronics.ru Git - kernel.git/commit
net: mediatek: fix TX locking
authorJohn Crispin <blogic@openwrt.org>
Thu, 7 Apr 2016 22:54:08 +0000 (00:54 +0200)
committerDavid S. Miller <davem@davemloft.net>
Wed, 13 Apr 2016 02:41:32 +0000 (22:41 -0400)
commit7e828568eaaf6347acceda9185e9149743f13233
treeb5106da438276ca96bc4f442350bf62de5843bfc
parent8b57cc894838574f6362a7c2c318694eea7a219c
net: mediatek: fix TX locking

Inside the TX path there is a lock inside the tx_map function. This is
however too late. The patch moves the lock to the start of the xmit
function right before the free count check of the DMA ring happens.
If we do not do this, the code becomes racy leading to TX stalls and
dropped packets. This happens as there are 2 netdevs running on the
same physical DMA ring.

Signed-off-by: John Crispin <blogic@openwrt.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/mediatek/mtk_eth_soc.c