Skip to content
Snippets Groups Projects
Commit 5924da1d authored by Faiz Abbas's avatar Faiz Abbas Committed by Simon Glass
Browse files

dm: core: Round up size when allocating so that it is cache line aligned


The size variable may not be always be a mulitple of
ARCH_DMA_MINALIGN and using it to flush cache leads to cache
misaligned warnings.

Therefore, round up the size to a multiple of ARCH_DMA_MINLAIGN
when allocating private data.

Signed-off-by: default avatarFaiz Abbas <faiz_abbas@ti.com>
Reviewed-by: default avatarSimon Glass <sjg@chromium.org>
parent ae06a1b9
No related branches found
No related tags found
No related merge requests found
......@@ -254,6 +254,7 @@ static void *alloc_priv(int size, uint flags)
void *priv;
if (flags & DM_FLAG_ALLOC_PRIV_DMA) {
size = ROUND(size, ARCH_DMA_MINALIGN);
priv = memalign(ARCH_DMA_MINALIGN, size);
if (priv) {
memset(priv, '\0', size);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment