]> rtime.felk.cvut.cz Git - zynq/linux.git/commit
xilinx_axienet: Handle 0 packet receive gracefully
authorPeter Crosthwaite <peter.crosthwaite@xilinx.com>
Mon, 3 Dec 2012 08:11:09 +0000 (18:11 +1000)
committerMichal Simek <michal.simek@xilinx.com>
Tue, 4 Dec 2012 08:41:56 +0000 (09:41 +0100)
commit0685f6c393b5c0769439ca0ac5819709a59145e4
tree723eaa34fd9b48475c1506b5ac187778537694ac
parent8b431de51e7d74fc474009ea2a0f44faf3129cdb
xilinx_axienet: Handle 0 packet receive gracefully

The AXI-DMA rx-delay interrupt can sometimes be triggered when there are 0
outstanding packets received. This is due to the fact that the receive function
will greedily consume as many packets as possible on interrupt. So if two
packets (with a very particular timing) arrive in succession they will each
cause the rx-delay interrupt, but the first interrupt will consume both packets.
This means the second interrupt is a 0 packet receive.

This is mostly OK, except that the tail pointer register is updated
unconditionally on receive. Currently the tail pointer is always set to the
current bd-ring descriptor under the assumption that the hardware has moved onto
the next descriptor. What this means for length 0 recv is the current descriptor
that the hardware is potentially yet to use will be marked as the tail. This
causes the hardware to think its run out of descriptors deadlocking the whole rx
path.

Fixed by updating the tail pointer to the most recent successfully consumed
descriptor.

Reported-by: Wendy Liang <wendy.liang@xilinx.com>
Signed-off-by: Peter Crosthwaite <peter.crosthwaite@xilinx.com>
Tested-by: Jason Wu <huanyu@xilinx.com>
Acked-by: Michal Simek <michal.simek@xilinx.com>
drivers/net/ethernet/xilinx/xilinx_axienet_main.c