net: fec_mxc: Fix timeouts during tftp transfer

Performing tftp transfers on mx28 results in random timeouts.

Hector Palacios and Robert Hodaszi analyzed the root cause being related to the
wrong alignment of the 'buff' buffer inside fec_recv().

Benoît Thébaudeau provided an excellent analysis of the alignment bug that is
present on older versions, such as GCC 4.5.4:

http://marc.info/?l=u-boot&m=137942904906131&w=2

Use ALLOC_CACHE_ALIGN_BUFFER() to avoid alignment issues from older GCC
versions.

Reported-by: Hector Palacios <hector.palacios@digi.com>
Tested-by: Oliver Metz <oliver@freetz.org>
Tested-by: Hector Palacios <hector.palacios@digi.com>
Signed-off-by: Fabio Estevam <fabio.estevam@freescale.com>
Acked-by: Marek Vasut <marex@denx.de>
Tested-by: Marek Vasut <marex@denx.de>
This commit is contained in:
Fabio Estevam 2013-09-17 23:13:10 -03:00 committed by Stefano Babic
parent 1d58524126
commit fd37f195ca
1 changed files with 1 additions and 1 deletions

View File

@ -794,7 +794,7 @@ static int fec_recv(struct eth_device *dev)
uint16_t bd_status;
uint32_t addr, size, end;
int i;
uchar buff[FEC_MAX_PKT_SIZE] __aligned(ARCH_DMA_MINALIGN);
ALLOC_CACHE_ALIGN_BUFFER(uchar, buff, FEC_MAX_PKT_SIZE);
/*
* Check if any critical events have happened