]> git.baikalelectronics.ru Git - kernel.git/commit
net: calxedaxgmac: fix race with tx queue stop/wake
authorRob Herring <rob.herring@calxeda.com>
Fri, 30 Aug 2013 21:49:24 +0000 (16:49 -0500)
committerDavid S. Miller <davem@davemloft.net>
Wed, 4 Sep 2013 02:21:15 +0000 (22:21 -0400)
commit0bd8af12a9cc620fccd4c8df005c381864125c4f
tree8b60f94561cd4f481060bfc19b4e39a5e5a93bd1
parent8d056133fa546d9044e584dd0ca3dc7b1659bb57
net: calxedaxgmac: fix race with tx queue stop/wake

Since the xgmac transmit start and completion work locklessly, it is
possible for xgmac_xmit to stop the tx queue after the xgmac_tx_complete
has run resulting in the tx queue never being woken up. Fix this by
ensuring that ring buffer index updates are visible and recheck the ring
space after stopping the queue. Also fix an off-by-one bug where we need
to stop the queue when the ring buffer space is equal to MAX_SKB_FRAGS.

The implementation used here was copied from
drivers/net/ethernet/broadcom/tg3.c.

Signed-off-by: Rob Herring <rob.herring@calxeda.com>
Reviewed-by: Ben Hutchings <bhutchings@solarflare.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/calxeda/xgmac.c