summaryrefslogtreecommitdiff
path: root/drivers/core/device.c
diff options
context:
space:
mode:
authorFaiz Abbas <faiz_abbas@ti.com>2017-09-19 11:23:50 (GMT)
committerSimon Glass <sjg@chromium.org>2017-10-09 02:41:09 (GMT)
commit5924da1dfe56d32a45b8adf29bdc8caf788bd4c8 (patch)
tree27f6dfd9254f78a745b11e252800415ff4cb2eaa /drivers/core/device.c
parentae06a1b9960aa97bd876840ebdb644c2952cd482 (diff)
downloadu-boot-5924da1dfe56d32a45b8adf29bdc8caf788bd4c8.tar.xz
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: Faiz Abbas <faiz_abbas@ti.com> Reviewed-by: Simon Glass <sjg@chromium.org>
Diffstat (limited to 'drivers/core/device.c')
-rw-r--r--drivers/core/device.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/drivers/core/device.c b/drivers/core/device.c
index de63e53..9a46a7b 100644
--- a/drivers/core/device.c
+++ b/drivers/core/device.c
@@ -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);