Gregory Fong b5be83e308 mm: cma: align to physical address, not CMA region position
The alignment in cma_alloc() was done w.r.t. the bitmap.  This is a
problem when, for example:

- a device requires 16M (order 12) alignment
- the CMA region is not 16 M aligned

In such a case, can result with the CMA region starting at, say,
0x2f800000 but any allocation you make from there will be aligned from
there.  Requesting an allocation of 32 M with 16 M alignment will result
in an allocation from 0x2f800000 to 0x31800000, which doesn't work very
well if your strange device requires 16M alignment.

Change to use bitmap_find_next_zero_area_off() to account for the
difference in alignment at reserve-time and alloc-time.

Signed-off-by: Gregory Fong <gregory.0xf0@gmail.com>
Acked-by: Michal Nazarewicz <mina86@mina86.com>
Cc: Marek Szyprowski <m.szyprowski@samsung.com>
Cc: Joonsoo Kim <iamjoonsoo.kim@lge.com>
Cc: Kukjin Kim <kgene.kim@samsung.com>
Cc: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Cc: Laura Abbott <lauraa@codeaurora.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2014-12-13 12:42:46 -08:00
..
2012-01-03 22:54:56 -05:00
2014-12-13 12:42:45 -08:00
2014-12-13 12:42:45 -08:00
2014-12-13 12:42:45 -08:00
2011-07-26 16:49:47 -07:00
2014-12-08 20:25:23 -05:00
2014-10-09 22:26:00 -04:00
2014-12-13 12:42:46 -08:00
2014-01-27 21:02:39 -08:00
2014-12-13 12:42:45 -08:00
2014-09-24 14:07:58 +02:00
2014-12-13 12:42:45 -08:00
2014-12-13 12:42:46 -08:00
2014-10-09 22:25:58 -04:00
2014-10-29 10:34:34 -04:00
2014-12-13 12:42:45 -08:00
2014-10-24 00:14:37 +02:00
2014-10-09 22:26:02 -04:00
2014-08-29 16:28:16 -07:00