Commit 84b45bf8 authored by Mitchel Humpherys's avatar Mitchel Humpherys Committed by Gerrit - the friendly Code Review server
Browse files

ion: invalidate buffers before zero'ing



Currently, we invalidate the cache for buffers being zero'd *after* we
zero them. However, this is racey since a dirty cache line from an
earlier mapping could be written out to memory between the zero'ing and
the invalidation. Fix this by invalidating the cache *before* zero'ing
the buffer.

Before this change, I was seeing corruption with:

    $ cat <<EOF | ./memory_prof -e -i -
    simple_alloc,1,ION_SYSTEM_HEAP_ID,ION_FLAG_CACHED,0x100000,1MB
    simple_basic_sanity,1
    simple_profile,1
    simple_free,1
    EOF

After this change, no corruption.

Change-Id: I1f2603604efc9be4ebf9112b06728e0aeca60ea0
Signed-off-by: default avatarMitchel Humpherys <mitchelh@codeaurora.org>
parent c34023fa
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment