Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Skip to content
Commit 11366a54 authored by Liam Mark's avatar Liam Mark
Browse files

staging: android: ion: Restrict cache maintenance to dma mapped memory



The ION begin_cpu_access and end_cpu_access functions use the
dma sync APIs to perform cache maintenance.

Currently it is possible to apply cache maintenance, via the
begin_cpu_access and end_cpu_access APIs, to ION buffers which are not
dma mapped.

The dma sync sg APIs should not be called on sg lists which have not been
dma mapped as this can result in cache maintenance being applied to the
wrong address. If an sg list has not been dma mapped then its dma_address
field has not been populated, some dma ops such as the swiotlb_dma_ops
ops use the dma_address field to calculate the address onto which to
apply the cache maintenance.

Fix the ION begin_cpu_access and end_cpu_access functions to only apply
cache maintenance to buffers which have been dma mapped.

Change-Id: Icd66660e68390e579628b6e7a01d18fd40d780c9
Signed-off-by: default avatarLiam Mark <lmark@codeaurora.org>
parent 55d1200a
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment