ARM: use flush_kernel_dcache_area() for dmabounce
After copying data from the bounce buffer to the real buffer, use flush_kernel_dcache_page() to ensure that data is written back in manner coherent with future userspace mappings. Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
This commit is contained in:
@@ -308,15 +308,11 @@ static inline void unmap_single(struct device *dev, dma_addr_t dma_addr,
|
|||||||
memcpy(ptr, buf->safe, size);
|
memcpy(ptr, buf->safe, size);
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* DMA buffers must have the same cache properties
|
* Since we may have written to a page cache page,
|
||||||
* as if they were really used for DMA - which means
|
* we need to ensure that the data will be coherent
|
||||||
* data must be written back to RAM. Note that
|
* with user mappings.
|
||||||
* we don't use dmac_flush_range() here for the
|
|
||||||
* bidirectional case because we know the cache
|
|
||||||
* lines will be coherent with the data written.
|
|
||||||
*/
|
*/
|
||||||
dmac_clean_range(ptr, ptr + size);
|
__cpuc_flush_kernel_dcache_area(ptr, size);
|
||||||
outer_clean_range(__pa(ptr), __pa(ptr) + size);
|
|
||||||
}
|
}
|
||||||
free_safe_buffer(dev->archdata.dmabounce, buf);
|
free_safe_buffer(dev->archdata.dmabounce, buf);
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user