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)
commit34c2e4c9e9b3e434a31f67eecf603dc1496c8cc9
treeb5106da438276ca96bc4f442350bf62de5843bfc
parent13c822f6d468ca5a16da4d9432b067d54245c5b9
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