[U-Boot] [PATCH 01/10] arm: Compile cache_disable() with -O2 to avoid failure

Wolfgang Denk wd at denx.de
Sat Nov 3 13:29:11 CET 2012


Dear Simon Glass,

In message <1351813330-23741-1-git-send-email-sjg at chromium.org> you wrote:
> It is good to have these functions written in C instead of assembler,
> but with -O0 the cache_disable() function doesn't return. Rather than
> revert to assembler, this fix just forces this to be built with -O2.

NAK.

This is vodoo programming to fix a problem which is obviously not
correctly understood (and fixed), so the real cause remains unfixed.

> +/*
> + * Big hack warning!
> + *
> + * Devs like to compile with -O0 to get a nice debugging illusion. But this

We don't use -O0 normally, and actually there are more places in the
code that are likely to cause problems or to actually break when
using -O0.

> + * function does not survive that since -O0 causes the compiler to read the
> + * PC back from the stack after the dcache flush. Might it be possible to fix
> + * this by flushing the write buffer?
> + */

"compiler to read the PC back from the stack after the dcache flush" -
can you please explain what exactly this means, and which exact
problem it causes?

> +static void cache_disable(uint32_t cache_bit) __attribute__ ((optimize(2)));

Sorry, I will not accept this.

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
backups: always in season, never out of style.


More information about the U-Boot mailing list