]> 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)
commit0d48e3ed4a4c0768a96c7b4d2c8de9be21162e8c
treeb5106da438276ca96bc4f442350bf62de5843bfc
parent246677bf42c3c05444002ccd2de2d9fe88ef6b68
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