OSDN Git Service

net: axienet: Fix race condition causing TX hang
authorRobert Hancock <hancock@sedsystems.ca>
Thu, 6 Jun 2019 22:28:17 +0000 (16:28 -0600)
committerDavid S. Miller <davem@davemloft.net>
Thu, 6 Jun 2019 23:24:29 +0000 (16:24 -0700)
commit7de44285c1f69ccfbe8be1d6a16fcd956681fee6
tree2fac1e4cb7bb3cea618763a87d1d33e32f9da499
parent522856cefaf09d1a06ddc02535c7e1e81730c278
net: axienet: Fix race condition causing TX hang

It is possible that the interrupt handler fires and frees up space in
the TX ring in between checking for sufficient TX ring space and
stopping the TX queue in axienet_start_xmit. If this happens, the
queue wake from the interrupt handler will occur before the queue is
stopped, causing a lost wakeup and the adapter's transmit hanging.

To avoid this, after stopping the queue, check again whether there is
sufficient space in the TX ring. If so, wake up the queue again.

Signed-off-by: Robert Hancock <hancock@sedsystems.ca>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/xilinx/xilinx_axienet_main.c