From: Wolfgang Denk Date: Thu, 12 Sep 2013 19:50:14 +0200 Subject: [U-Boot] [PATCH] net: fec: Avoid MX28 bus sync issue In-Reply-To: <523195CA.3010305@digi.com> References: <1373583784-7129-1-git-send-email-marex@denx.de> <201307160644.53198.marex@denx.de> <51E6BE61.1020908@digi.com> <523195CA.3010305@digi.com> Message-ID: <20130912175014.91D0C38061E@gemini.denx.de> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de Dear Hector Palacios, In message <523195CA.3010305@digi.com> you wrote: > > Here is a patch: > > From: Robert Hodaszi > Date: Fri, 6 Sep 2013 09:50:52 +0200 > Subject: [PATCH] net: fec: fix invalid temporary RX buffer alignment because > of GCC bug > > Older GCC versions don't handle well alignment on stack variables. Can you please be specific - which exact versions of GCC are supposed to misbehave here? > To fix it, don't put the temporary onto the stack. This is not a good idea, as it wastes a memory for no good reason. > Signed-off-by: Robert Hodaszi > Signed-off-by: Hector Palacios > --- > drivers/net/fec_mxc.c | 5 ++++- > 1 file changed, 4 insertions(+), 1 deletion(-) > > diff --git a/drivers/net/fec_mxc.c b/drivers/net/fec_mxc.c > index f4f72b7..315017e 100644 > --- a/drivers/net/fec_mxc.c > +++ b/drivers/net/fec_mxc.c > @@ -828,7 +828,10 @@ 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); > + /* Don't place this variable on the stack, because older GCC version > + * doesn't handle alignement on stack well. > + */ > + static uchar buff[FEC_MAX_PKT_SIZE] __aligned(ARCH_DMA_MINALIGN); I have to admit that I doubt the explanation - somthing else is probaly wrong instead. I would really like to know which compiler version misbehaves, and what the generated code looks like, both in the working and in the broken case. Thanks. Best regards, Wolfgang Denk -- DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de I had the rare misfortune of being one of the first people to try and implement a PL/1 compiler. -- T. Cheatham