aboutsummaryrefslogtreecommitdiffstats
path: root/target/linux/ar71xx
diff options
context:
space:
mode:
authorFelix Fietkau <nbd@openwrt.org>2014-09-06 17:51:44 +0000
committerFelix Fietkau <nbd@openwrt.org>2014-09-06 17:51:44 +0000
commit3a2661330bf62f606711aeef497caefe75f555fb (patch)
tree86cd186c06d80d5160c16817edcd6330a52d0235 /target/linux/ar71xx
parentb083d521dfd1f1e3aae01f6fd30065f97d972e74 (diff)
downloadupstream-3a2661330bf62f606711aeef497caefe75f555fb.tar.gz
upstream-3a2661330bf62f606711aeef497caefe75f555fb.tar.bz2
upstream-3a2661330bf62f606711aeef497caefe75f555fb.zip
ar71xx: fix off-by-one error in packet descriptor splitting (patch from #13072)
Signed-off-by: Felix Fietkau <nbd@openwrt.org> git-svn-id: svn://svn.openwrt.org/openwrt/trunk@42428 3c298f89-4303-0410-b956-a3cf2f4a3e73
Diffstat (limited to 'target/linux/ar71xx')
-rw-r--r--target/linux/ar71xx/files/drivers/net/ethernet/atheros/ag71xx/ag71xx_main.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/target/linux/ar71xx/files/drivers/net/ethernet/atheros/ag71xx/ag71xx_main.c b/target/linux/ar71xx/files/drivers/net/ethernet/atheros/ag71xx/ag71xx_main.c
index ed04033341..c04fb94b94 100644
--- a/target/linux/ar71xx/files/drivers/net/ethernet/atheros/ag71xx/ag71xx_main.c
+++ b/target/linux/ar71xx/files/drivers/net/ethernet/atheros/ag71xx/ag71xx_main.c
@@ -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;
}