提交 9d1400cf 编写于 作者: M Marek Szyprowski

ARM: DMA-mapping: add missing GFP_DMA flag for atomic buffer allocation

Atomic pool should always be allocated from DMA zone if such zone is
available in the system to avoid issues caused by limited dma mask of
any of the devices used for making an atomic allocation.
Reported-by: NKrzysztof Halasa <khc@pm.waw.pl>
Signed-off-by: NMarek Szyprowski <m.szyprowski@samsung.com>
Cc: Stable <stable@vger.kernel.org>	[v3.6+]
上级 6dbe51c2
...@@ -342,6 +342,7 @@ static int __init atomic_pool_init(void) ...@@ -342,6 +342,7 @@ static int __init atomic_pool_init(void)
{ {
struct dma_pool *pool = &atomic_pool; struct dma_pool *pool = &atomic_pool;
pgprot_t prot = pgprot_dmacoherent(pgprot_kernel); pgprot_t prot = pgprot_dmacoherent(pgprot_kernel);
gfp_t gfp = GFP_KERNEL | GFP_DMA;
unsigned long nr_pages = pool->size >> PAGE_SHIFT; unsigned long nr_pages = pool->size >> PAGE_SHIFT;
unsigned long *bitmap; unsigned long *bitmap;
struct page *page; struct page *page;
...@@ -361,8 +362,8 @@ static int __init atomic_pool_init(void) ...@@ -361,8 +362,8 @@ static int __init atomic_pool_init(void)
ptr = __alloc_from_contiguous(NULL, pool->size, prot, &page, ptr = __alloc_from_contiguous(NULL, pool->size, prot, &page,
atomic_pool_init); atomic_pool_init);
else else
ptr = __alloc_remap_buffer(NULL, pool->size, GFP_KERNEL, prot, ptr = __alloc_remap_buffer(NULL, pool->size, gfp, prot, &page,
&page, atomic_pool_init); atomic_pool_init);
if (ptr) { if (ptr) {
int i; int i;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册