]> git.proxmox.com Git - mirror_ubuntu-artful-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)
commitcbe157b60c8e70d4b4dc937dfdd39525d8f47b46
tree8b60f94561cd4f481060bfc19b4e39a5e5a93bd1
parentca32723afedd65d612029705446bf44bde5eab14
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