]> git.baikalelectronics.ru Git - uboot.git/commit
Make kmalloc'ed memory really DMA-safe
authorMasahiro Yamada <yamada.masahiro@socionext.com>
Fri, 24 Aug 2018 10:30:15 +0000 (19:30 +0900)
committerTom Rini <trini@konsulko.com>
Fri, 31 Aug 2018 15:59:44 +0000 (11:59 -0400)
commit1585f6472237f426b9e4517c13dd222156816379
tree8e1777b9ee2feb63c12ae19d7bd1aa01032bd4a9
parentc5cd1249d284a9ffad770f042b2e7933405827a0
Make kmalloc'ed memory really DMA-safe

In Linux, the memory returned by kmalloc() is DMA-capable.
However, it is not true in U-Boot.

At a glance, kmalloc() in U-Boot returns address aligned with
ARCH_DMA_MINALIGN.  However, it never pads the allocated memory.
This half-way house is completely useless because calling kmalloc()
and malloc() in this order causes a cache sharing problem.

Change the implementation to call malloc_cache_aligned(), which
allocates really DMA-capable memory.

Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
lib/linux_compat.c