“f9bd6733d3f11e24f3949becf277507d422ee1eb”上不存在“fs/git@gitcode.net:openeuler/kernel.git”
提交 c06e004c 编写于 作者: R Russell King

ARM: Use GFP_DMA only for masks _less_ than 32-bit

We were using GFP_DMA for masks other than 0xffffffff, which is
wrong when some masks are initialized to 0xffffffffffffffff.
This caused such masks to obtain memory from the precious DMA
pool.
Signed-off-by: NRussell King <rmk+kernel@arm.linux.org.uk>
上级 ce63e6bd
...@@ -205,7 +205,7 @@ __dma_alloc(struct device *dev, size_t size, dma_addr_t *handle, gfp_t gfp, ...@@ -205,7 +205,7 @@ __dma_alloc(struct device *dev, size_t size, dma_addr_t *handle, gfp_t gfp,
order = get_order(size); order = get_order(size);
if (mask != 0xffffffff) if (mask < 0xffffffffULL)
gfp |= GFP_DMA; gfp |= GFP_DMA;
page = alloc_pages(gfp, order); page = alloc_pages(gfp, order);
...@@ -289,7 +289,7 @@ __dma_alloc(struct device *dev, size_t size, dma_addr_t *handle, gfp_t gfp, ...@@ -289,7 +289,7 @@ __dma_alloc(struct device *dev, size_t size, dma_addr_t *handle, gfp_t gfp,
if (!mask) if (!mask)
goto error; goto error;
if (mask != 0xffffffff) if (mask < 0xffffffffULL)
gfp |= GFP_DMA; gfp |= GFP_DMA;
virt = kmalloc(size, gfp); virt = kmalloc(size, gfp);
if (!virt) if (!virt)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册