]> git.sur5r.net Git - u-boot/commitdiff
FEC: Do not pass unaligned buffer to network stack
authorMarek Vasut <marex@denx.de>
Sun, 26 Aug 2012 10:19:20 +0000 (10:19 +0000)
committerJoe Hershberger <joe.hershberger@ni.com>
Thu, 27 Sep 2012 17:22:09 +0000 (12:22 -0500)
Do not pass unaligned RX buffer to the upper layers. The upper layer,
especially in the ARP case, recycles the buffer and passes it back into
the FEC, into it's TX path. With caches enabled, the FEC hangs on this
from time to time.

Signed-off-by: Marek Vasut <marex@denx.de>
Cc: Benoit Thebaudeau <benoit.thebaudeau@advans>
Cc: Eric Nelson <eric.nelson@boundarydevices.com>
Cc: Fabio Estevam <festevam@gmail.com>
Cc: Joe Hershberger <joe.hershberger@ni.com>
Tested-by: Fabio Estevam <fabio.estevam@freescale.com>
drivers/net/fec_mxc.c

index fbfc842aca05a0faa7aecfab89a49f50b88bdba5..7b6a997cd05eeb2d1f748f3fd50f6d8cc244e80a 100644 (file)
@@ -31,6 +31,7 @@
 #include <asm/arch/imx-regs.h>
 #include <asm/io.h>
 #include <asm/errno.h>
+#include <linux/compiler.h>
 
 DECLARE_GLOBAL_DATA_PTR;
 
@@ -791,7 +792,7 @@ static int fec_recv(struct eth_device *dev)
        uint16_t bd_status;
        uint32_t addr, size;
        int i;
-       uchar buff[FEC_MAX_PKT_SIZE];
+       uchar buff[FEC_MAX_PKT_SIZE] __aligned(ARCH_DMA_MINALIGN);
 
        /*
         * Check if any critical events have happened