* [PATCH] arm64: dma-mapping: check whether cma area is initialized or not
@ 2015-09-11 7:49 ` Jisheng Zhang
0 siblings, 0 replies; 6+ messages in thread
From: Jisheng Zhang @ 2015-09-11 7:49 UTC (permalink / raw)
To: linux-arm-kernel
If CMA is turned on and CMA size is set to zero, kernel should
behave as if CMA was not enabled at compile time.
Every dma allocation should check existence of cma area
before requesting memory.
Arm has done this by commit e464ef16c4f0 ("arm: dma-mapping: add
checking cma area initialized"), also do this for arm64.
Signed-off-by: Jisheng Zhang <jszhang@marvell.com>
---
arch/arm64/mm/dma-mapping.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/arch/arm64/mm/dma-mapping.c b/arch/arm64/mm/dma-mapping.c
index 0bcc4bc..99224dc 100644
--- a/arch/arm64/mm/dma-mapping.c
+++ b/arch/arm64/mm/dma-mapping.c
@@ -100,7 +100,7 @@ static void *__dma_alloc_coherent(struct device *dev, size_t size,
if (IS_ENABLED(CONFIG_ZONE_DMA) &&
dev->coherent_dma_mask <= DMA_BIT_MASK(32))
flags |= GFP_DMA;
- if (IS_ENABLED(CONFIG_DMA_CMA) && (flags & __GFP_WAIT)) {
+ if (dev_get_cma_area(dev) && (flags & __GFP_WAIT)) {
struct page *page;
void *addr;
--
2.5.1
^ permalink raw reply related [flat|nested] 6+ messages in thread* [PATCH] arm64: dma-mapping: check whether cma area is initialized or not
@ 2015-09-11 7:49 ` Jisheng Zhang
0 siblings, 0 replies; 6+ messages in thread
From: Jisheng Zhang @ 2015-09-11 7:49 UTC (permalink / raw)
To: catalin.marinas, will.deacon
Cc: linux-arm-kernel, linux-kernel, Jisheng Zhang
If CMA is turned on and CMA size is set to zero, kernel should
behave as if CMA was not enabled at compile time.
Every dma allocation should check existence of cma area
before requesting memory.
Arm has done this by commit e464ef16c4f0 ("arm: dma-mapping: add
checking cma area initialized"), also do this for arm64.
Signed-off-by: Jisheng Zhang <jszhang@marvell.com>
---
arch/arm64/mm/dma-mapping.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/arch/arm64/mm/dma-mapping.c b/arch/arm64/mm/dma-mapping.c
index 0bcc4bc..99224dc 100644
--- a/arch/arm64/mm/dma-mapping.c
+++ b/arch/arm64/mm/dma-mapping.c
@@ -100,7 +100,7 @@ static void *__dma_alloc_coherent(struct device *dev, size_t size,
if (IS_ENABLED(CONFIG_ZONE_DMA) &&
dev->coherent_dma_mask <= DMA_BIT_MASK(32))
flags |= GFP_DMA;
- if (IS_ENABLED(CONFIG_DMA_CMA) && (flags & __GFP_WAIT)) {
+ if (dev_get_cma_area(dev) && (flags & __GFP_WAIT)) {
struct page *page;
void *addr;
--
2.5.1
^ permalink raw reply related [flat|nested] 6+ messages in thread* [PATCH] arm64: dma-mapping: check whether cma area is initialized or not
2015-09-11 7:49 ` Jisheng Zhang
@ 2015-09-11 11:00 ` Catalin Marinas
-1 siblings, 0 replies; 6+ messages in thread
From: Catalin Marinas @ 2015-09-11 11:00 UTC (permalink / raw)
To: linux-arm-kernel
On Fri, Sep 11, 2015 at 03:49:47PM +0800, Jisheng Zhang wrote:
> If CMA is turned on and CMA size is set to zero, kernel should
> behave as if CMA was not enabled at compile time.
> Every dma allocation should check existence of cma area
> before requesting memory.
>
> Arm has done this by commit e464ef16c4f0 ("arm: dma-mapping: add
> checking cma area initialized"), also do this for arm64.
>
> Signed-off-by: Jisheng Zhang <jszhang@marvell.com>
Acked-by: Catalin Marinas <catalin.marinas@arm.com>
Will should pick this up for 4.3.
Thanks.
--
Catalin
^ permalink raw reply [flat|nested] 6+ messages in thread* Re: [PATCH] arm64: dma-mapping: check whether cma area is initialized or not
@ 2015-09-11 11:00 ` Catalin Marinas
0 siblings, 0 replies; 6+ messages in thread
From: Catalin Marinas @ 2015-09-11 11:00 UTC (permalink / raw)
To: Jisheng Zhang; +Cc: will.deacon, linux-kernel, linux-arm-kernel
On Fri, Sep 11, 2015 at 03:49:47PM +0800, Jisheng Zhang wrote:
> If CMA is turned on and CMA size is set to zero, kernel should
> behave as if CMA was not enabled at compile time.
> Every dma allocation should check existence of cma area
> before requesting memory.
>
> Arm has done this by commit e464ef16c4f0 ("arm: dma-mapping: add
> checking cma area initialized"), also do this for arm64.
>
> Signed-off-by: Jisheng Zhang <jszhang@marvell.com>
Acked-by: Catalin Marinas <catalin.marinas@arm.com>
Will should pick this up for 4.3.
Thanks.
--
Catalin
^ permalink raw reply [flat|nested] 6+ messages in thread* [PATCH] arm64: dma-mapping: check whether cma area is initialized or not
2015-09-11 11:00 ` Catalin Marinas
@ 2015-09-11 11:02 ` Will Deacon
-1 siblings, 0 replies; 6+ messages in thread
From: Will Deacon @ 2015-09-11 11:02 UTC (permalink / raw)
To: linux-arm-kernel
On Fri, Sep 11, 2015 at 12:00:37PM +0100, Catalin Marinas wrote:
> On Fri, Sep 11, 2015 at 03:49:47PM +0800, Jisheng Zhang wrote:
> > If CMA is turned on and CMA size is set to zero, kernel should
> > behave as if CMA was not enabled at compile time.
> > Every dma allocation should check existence of cma area
> > before requesting memory.
> >
> > Arm has done this by commit e464ef16c4f0 ("arm: dma-mapping: add
> > checking cma area initialized"), also do this for arm64.
> >
> > Signed-off-by: Jisheng Zhang <jszhang@marvell.com>
>
> Acked-by: Catalin Marinas <catalin.marinas@arm.com>
>
> Will should pick this up for 4.3.
Yup, queued already. I'll push out at -rc1.
Will
^ permalink raw reply [flat|nested] 6+ messages in thread* Re: [PATCH] arm64: dma-mapping: check whether cma area is initialized or not
@ 2015-09-11 11:02 ` Will Deacon
0 siblings, 0 replies; 6+ messages in thread
From: Will Deacon @ 2015-09-11 11:02 UTC (permalink / raw)
To: Catalin Marinas
Cc: Jisheng Zhang, linux-kernel@vger.kernel.org,
linux-arm-kernel@lists.infradead.org
On Fri, Sep 11, 2015 at 12:00:37PM +0100, Catalin Marinas wrote:
> On Fri, Sep 11, 2015 at 03:49:47PM +0800, Jisheng Zhang wrote:
> > If CMA is turned on and CMA size is set to zero, kernel should
> > behave as if CMA was not enabled at compile time.
> > Every dma allocation should check existence of cma area
> > before requesting memory.
> >
> > Arm has done this by commit e464ef16c4f0 ("arm: dma-mapping: add
> > checking cma area initialized"), also do this for arm64.
> >
> > Signed-off-by: Jisheng Zhang <jszhang@marvell.com>
>
> Acked-by: Catalin Marinas <catalin.marinas@arm.com>
>
> Will should pick this up for 4.3.
Yup, queued already. I'll push out at -rc1.
Will
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2015-09-11 11:02 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-09-11 7:49 [PATCH] arm64: dma-mapping: check whether cma area is initialized or not Jisheng Zhang
2015-09-11 7:49 ` Jisheng Zhang
2015-09-11 11:00 ` Catalin Marinas
2015-09-11 11:00 ` Catalin Marinas
2015-09-11 11:02 ` Will Deacon
2015-09-11 11:02 ` Will Deacon
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.