mirror of
https://github.com/mmueller41/genode.git
synced 2026-01-21 20:42:56 +01:00
lx_emul: invalidate cache for DMA-read only
After a DMA transaction do only invalidate cachelines from the corresponding DMA buffers if data got transfered from device to CPU, and not vice versa. Otherwise it might result in data corruption. Ref #4268
This commit is contained in:
committed by
Norman Feske
parent
d8c344f6b9
commit
2ac8620f44
@@ -100,6 +100,9 @@ void dma_unmap_sg_attrs(struct device * dev,
|
||||
int i;
|
||||
struct scatterlist *sg;
|
||||
|
||||
if (dir != DMA_FROM_DEVICE)
|
||||
return;
|
||||
|
||||
for_each_sg(sgl, sg, nents, i) {
|
||||
lx_emul_mem_cache_invalidate(page_address(sg_page(sg)) + sg->offset,
|
||||
sg->length);
|
||||
|
||||
Reference in New Issue
Block a user