From: Marek Vasut Date: Sun, 26 Aug 2012 10:19:20 +0000 (+0000) Subject: FEC: Do not pass unaligned buffer to network stack X-Git-Tag: v2012.10-rc2~12^2~6 X-Git-Url: https://git.librecmc.org/?a=commitdiff_plain;h=e2a66e609745470b1157fe6b6663c804ee44b0b9;p=oweals%2Fu-boot.git FEC: Do not pass unaligned buffer to network stack 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 Cc: Benoit Thebaudeau Cc: Eric Nelson Cc: Fabio Estevam Cc: Joe Hershberger Tested-by: Fabio Estevam --- diff --git a/drivers/net/fec_mxc.c b/drivers/net/fec_mxc.c index fbfc842aca..7b6a997cd0 100644 --- a/drivers/net/fec_mxc.c +++ b/drivers/net/fec_mxc.c @@ -31,6 +31,7 @@ #include #include #include +#include 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