dde_linux: use CACHED dma buffers

On x86, DMA buffers are actually always mapped as cached. We should
therefore actually ask for a cached buffer in order to avoid confusion.

genodelabs/genode#5000
This commit is contained in:
Johannes Schlatow
2023-10-05 21:12:36 +02:00
committed by Christian Helmuth
parent 686b9d44f4
commit c738f4b029
2 changed files with 9 additions and 0 deletions

View File

@ -32,7 +32,11 @@ void * dma_alloc_attrs(struct device * dev,
} }
#endif #endif
#ifdef CONFIG_X86
addr = lx_emul_mem_alloc_aligned(size, PAGE_SIZE);
#else
addr = lx_emul_mem_alloc_aligned_uncached(size, PAGE_SIZE); addr = lx_emul_mem_alloc_aligned_uncached(size, PAGE_SIZE);
#endif
*dma_handle = lx_emul_mem_dma_addr(addr); *dma_handle = lx_emul_mem_dma_addr(addr);
return addr; return addr;
} }

View File

@ -24,8 +24,13 @@ struct dma_pool
void * dma_pool_alloc(struct dma_pool * pool, gfp_t mem_flags, dma_addr_t * handle) void * dma_pool_alloc(struct dma_pool * pool, gfp_t mem_flags, dma_addr_t * handle)
{ {
#ifdef CONFIG_X86
void * ret =
lx_emul_mem_alloc_aligned(pool->size, pool->align);
#else
void * ret = void * ret =
lx_emul_mem_alloc_aligned_uncached(pool->size, pool->align); lx_emul_mem_alloc_aligned_uncached(pool->size, pool->align);
#endif
*handle = lx_emul_mem_dma_addr(ret); *handle = lx_emul_mem_dma_addr(ret);
return ret; return ret;
} }