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:
Liam Mark <lmark@codeaurora.org>
Loading
Please register or sign in to comment