[U-Boot] [PATCH 4/4] armv7: cache: remove flush on un-aligned invalidate

Aneesh V
2011-08-10T06:48:32Z

Hi Anton,

On Tuesday 09 August 2011 10:09 PM, Anton Staaf wrote:
> I'm not sure what the larger context of this change is, but it seems
> like a bad idea to me. There are a lot of locations in U-Boot that

Please see this thread for the context.
http://thread.gmane.org/gmane.comp.boot-loaders.u-boot/105113/focus=105135

> will end up causing an unaligned invalidate (ext2 and dos file system
> code in particular). And this change will cause those unaligned
> invalidates to possibly throw away stores to adjacent variables. If

No. Those partial cache-lines on the boundary are left alone. They are
not invalidated. So, it still affects only the party calling the
invalidate.

> you are going to make this change you should at least assert instead
> of just printing a warning. And there should be a concerted effort to
> clean up the buffer management in U-Boot so that invalidates will
> never be unaligned. This is also a departure from the cache
> management implementations in the Linux kernel, not that U-Boot has to
> do exactly what they do, but I feel they have the correct
> implementation, from the perspective of ensuring that all stores
> actually make it to main memory.

Yes, I had implemented it in line with the kernel apporach. However,
with un-aligned buffers there is no perfect solution anyway. So, I
don't have a strong opinion on this. Leaving alone the boundary
cache-lines and printing a big warning seems reasonable enough.

best regards,
Aneesh