Skip to contentSkip to conversation

net: fec_mxc: Fix timeouts during tftp transfer

PATCH New Fabio Estevam 3 participants 3 messages Sep 18, 2013 – Sep 20, 2013 Network drivers

lore
Share & tools
lore
#0 lore raw

PATCH v2 1/1 net: fec_mxc: Fix timeouts during tftp transfer

From: Fabio Estevam <[email protected]>

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.

---
Changes since v1:
- Improve commit log
- Add Hector's Tested-by tag

 drivers/net/fec_mxc.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/net/fec_mxc.c +1 -1
index 690e572..b423ff6 100644
@@ -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
Signature · 1 line
1.8.1.2
#1 lore raw

PATCH v2 1/1 net: fec_mxc: Fix timeouts during tftp transfer

Dear Fabio Estevam,

Quoted 19 lines

From: Fabio Estevam <[email protected]>

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.

Quoted 7 lines

---
Changes since v1:
- Improve commit log
- Add Hector's Tested-by tag

 drivers/net/fec_mxc.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Stefano, can you please apply for .10 ?

Best regards,
Marek Vasut

#2 lore raw

PATCH v2 1/1 net: fec_mxc: Fix timeouts during tftp transfer

In reply to Fabio Estevam
Quoted 12 lines · Fabio Estevam

From: Fabio Estevam <[email protected]>

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

Quoted 8 lines

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

---

Applied to u-boot-imx, thanks!

Best regards,
Stefano Babic

Signature · 5 lines
=====================================================================
DENX Software Engineering GmbH,     MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: +49-8142-66989-53 Fax: +49-8142-66989-80 Email: sbabic at denx.de
=====================================================================