Permalink
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
net: xilinx: axiethernet: Add check for transmit data FIFO vacancy
In a scenario when the multiple iperf3 transmit streams are executed there is a high probability to overflow the transmit FIFO buffer and generate async abort(SError) which might lead to kernel panic. In the transmit path, add proper locking to ensure updates to TX FIFO are atomic and also check transmit data FIFO vacancy before writing to the TX FIFO. This is inline with recommended programming sequence for transmitting a packet using axistream FIFO and as a side effect it also fixes the below iperf3 crash: [ 283.692957] SError Interrupt on CPU1, code 0xbf000002 – SError [ 283.692960] CPU: 1 PID: 515 Comm: udhcpc Not tainted 5.4.0-xilinx-v2020.1 #1 [ 283.692961] Hardware name: xlnx,zynqmp (DT) [ 283.692963] pstate: 80000085 (Nzcv daIf -PAN -UAO) [ 283.692964] pc : dma_direct_map_page+0x20/0x130 [ 283.692966] lr : axienet_start_xmit+0x1ac/0x6b0 [ 283.692967] sp : ffffffc01000b860 [ 283.692968] x29: ffffffc01000b860 x28: 0000000000000001 [ 283.692971] x27: ffffffc0112c5400 x26: ffffff8876f047c0 [ 283.692974] x25: ffffffc0112c5000 x24: 0000000000000000 [ 283.692977] x23: ffffff8876f04000 x22: 0000000000000000 [ 283.692980] x21: ffffffc0112c5400 x20: ffffff8876012700 [ 283.692983] x19: ffffff887ab48c10 x18: 0000000000000000 [ 283.692985] x17: 0000000000000000 x16: 0000000000000000 [ 283.692988] x15: 0000000000000000 x14: 0000000000000000 [ 283.692991] x13: 0000000000000000 x12: 0000000000000000 [ 283.692994] x11: 0000000000000000 x10: 0000000000000000 [ 283.692997] x9 : 0000000000000000 x8 : 0000000000000000 [ 283.693000] x7 : 0000000000000000 x6 : fffffffeffe00000 [ 283.693002] x5 : 0000000000000000 x4 : 0000000000000001 [ 283.693005] x3 : 00000000000005ea x2 : 00000000000000ce [ 283.693008] x1 : 0000000021d86040 x0 : ffffff887ab48c10 [ 283.693012] SError Interrupt on CPU2, code 0xbf000002 – SError [ 283.693014] CPU: 2 PID: 622 Comm: iperf3 Not tainted 5.4.0-xilinx-v2020.1 #1 [ 283.693015] Hardware name: xlnx,zynqmp (DT) [ 283.693016] pstate: 80000085 (Nzcv daIf -PAN -UAO) [ 283.693018] pc : dma_direct_map_page+0x20/0x130 [ 283.693019] lr : axienet_start_xmit+0x1ac/0x6b0 [ 283.693020] sp : ffffffc011d4b4a0 [ 283.693021] x29: ffffffc011d4b4a0 x28: 0000000000000001 [ 283.693024] x27: ffffffc01130dd80 x26: ffffff8876f047c0 Signed-off-by: Radhey Shyam Pandey <radhey.shyam.pandey@xilinx.com> Reviewed-by: Harini Katakam <harini.katakam@xilinx.com> State: pending
- Loading branch information