ar71xx: fix off-by-one error in packet descriptor splitting (patch from #13072)
authorFelix Fietkau <nbd@openwrt.org>
Sat, 6 Sep 2014 17:51:44 +0000 (17:51 +0000)
committerFelix Fietkau <nbd@openwrt.org>
Sat, 6 Sep 2014 17:51:44 +0000 (17:51 +0000)
Signed-off-by: Felix Fietkau <nbd@openwrt.org>
SVN-Revision: 42428

target/linux/ar71xx/files/drivers/net/ethernet/atheros/ag71xx/ag71xx_main.c

index ed0403334139f561b7ddbabacb38e535130f9dac..c04fb94b94e30b757d877c1b621c513193336665 100644 (file)
@@ -704,7 +704,12 @@ static int ag71xx_fill_dma_desc(struct ag71xx_ring *ring, u32 addr, int len)
 
                if (cur_len > split) {
                        cur_len = split;
-                       if (len < split + 4)
+
+                       /*
+                        * TX will hang if DMA transfers <= 4 bytes,
+                        * make sure next segment is more than 4 bytes long.
+                        */
+                       if (len <= split + 4)
                                cur_len -= 4;
                }