]> git.baikalelectronics.ru Git - kernel.git/commit
drivers: of: of_reserved_mem: fixup the alignment with CMA setup
authorJason Liu <r64343@freescale.com>
Tue, 10 Nov 2015 12:30:26 +0000 (20:30 +0800)
committerRob Herring <robh@kernel.org>
Tue, 10 Nov 2015 23:24:54 +0000 (17:24 -0600)
commit6b19894f454fdcb93434f7e52d4d3f7db17f4da2
tree18dc1f7196cd88a9fbc77ffda56b80b754389d9f
parent6053adaae45ee24a73ad241e0b3d7a43fd92b988
drivers: of: of_reserved_mem: fixup the alignment with CMA setup

There is an alignment mismatch issue between the of_reserved_mem and
the CMA setup requirement. The of_reserved_mem will try to get the
alignment value from the DTS and pass it to __memblock_alloc_base to
do the memory block base allocation, but the alignment value specified
in the DTS may not satisfy the CAM setup requirement since CMA setup
required the alignment as the following in the code:

align = PAGE_SIZE << max(MAX_ORDER - 1, pageblock_order);

The sanity check in the function of rmem_cma_setup will fail if the
alignment does not setup correctly and thus CMA will fail to setup.

This patch is to fixup the alignment to meet the CMA setup required.

Mailing-list-thread: https://lkml.org/lkml/2015/11/9/138
Signed-off-by: Jason Liu <r64343@freescale.com>
Acked-by: Marek Szyprowski <m.szyprowski@samsung.com>
Cc: Grant Likely <grant.likely@linaro.org>
Cc: Rob Herring <robh+dt@kernel.org>
Cc: stable@vger.kernel.org
Signed-off-by: Rob Herring <robh@kernel.org>
drivers/of/of_reserved_mem.c