mirror of
https://github.com/genodelabs/genode.git
synced 2025-02-21 02:01:38 +00: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:
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);
|
||||
|
Loading…
x
Reference in New Issue
Block a user