public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
* [U-Boot] [PATCH] net: fec_mxc: Fix timeouts during tftp transfer
@ 2013-09-16  1:10 Fabio Estevam
  2013-09-16  7:40 ` Hector Palacios
  2013-09-17  3:00 ` Marek Vasut
  0 siblings, 2 replies; 8+ messages in thread
From: Fabio Estevam @ 2013-09-16  1:10 UTC (permalink / raw)
  To: u-boot

From: Fabio Estevam <fabio.estevam@freescale.com>

Performing tftp transfers on mx28 results in random timeouts.

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

GCC versions such as 4.4/4.5 are more likely to exhibit such problem.

Use ALLOC_CACHE_ALIGN_BUFFER() for making the proper alignment of buffer.

Reported-by: Hector Palacios <hector.palacios@digi.com>
Tested-by: Oliver Metz <oliver@freetz.org> 
Signed-off-by: Fabio Estevam <fabio.estevam@freescale.com>
---
 drivers/net/fec_mxc.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/net/fec_mxc.c b/drivers/net/fec_mxc.c
index 690e572..b423ff6 100644
--- a/drivers/net/fec_mxc.c
+++ b/drivers/net/fec_mxc.c
@@ -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
-- 
1.8.1.2

^ permalink raw reply related	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2013-09-17 19:30 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-09-16  1:10 [U-Boot] [PATCH] net: fec_mxc: Fix timeouts during tftp transfer Fabio Estevam
2013-09-16  7:40 ` Hector Palacios
2013-09-17  3:00 ` Marek Vasut
2013-09-17 10:59   ` Benoît Thébaudeau
2013-09-17 11:47     ` Wolfgang Denk
2013-09-17 14:42       ` Benoît Thébaudeau
2013-09-17 19:27         ` Wolfgang Denk
2013-09-17 19:30           ` Fabio Estevam

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox