]> git.baikalelectronics.ru Git - uboot.git/commit
MIPS: Ensure cache ops complete in cache maintenance functions
authorPaul Burton <paul.burton@mips.com>
Tue, 21 Nov 2017 19:18:37 +0000 (11:18 -0800)
committerDaniel Schwierzeck <daniel.schwierzeck@gmail.com>
Tue, 28 Nov 2017 20:59:30 +0000 (21:59 +0100)
commitd720cd56b978866064cf4e5d7edafe9b6d1db35d
tree3b78a0b912f65f5c8f096934e811633dc97d1d7a
parentcda187a1aeeae804e0a6f3e477a54486919322e2
MIPS: Ensure cache ops complete in cache maintenance functions

A typical use of cache maintenance functions is to force writeback of
data which a device is about to read using DMA - for example a
descriptor or command structure. Such users of cache maintenance
functions require that operations on the cache have completed before
they proceed to instruct a device to read memory. This requires that we
place a completion barrier (ie. sync instruction) between the cache ops
and whatever write informs the device to perform DMA.

Whilst strictly speaking this isn't all users of the cache maintenance
functions & we could instead place the barriers in the drivers that
require them, it would be much more invasive to do so than to just have
the barrier be the default by placing it in the cache functions
themselves. The cost is low enough that it shouldn't matter to us in any
rare cases that we use the cache functions when not performing DMA.

Signed-off-by: Paul Burton <paul.burton@mips.com>
Cc: Daniel Schwierzeck <daniel.schwierzeck@gmail.com>
Cc: u-boot@lists.denx.de
arch/mips/lib/cache.c