All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Aneesh Kumar K.V" <aneesh.kumar@linux.vnet.ibm.com>
To: Benjamin Herrenschmidt <benh@kernel.crashing.org>,
	linuxppc dev list <linuxppc-dev@lists.ozlabs.org>
Cc: Scott Wood <scottwood@freescale.com>,
	Anton Blanchard <anton@au1.ibm.com>,
	Brian J King <bjking1@us.ibm.com>
Subject: Re: [PATCH 3/3] powerpc/dma: Remove ZONE_DMA completely
Date: Wed, 18 Mar 2015 19:49:28 +0530	[thread overview]
Message-ID: <87zj7amlqn.fsf@linux.vnet.ibm.com> (raw)
In-Reply-To: <1424421344.27448.43.camel@kernel.crashing.org>

Benjamin Herrenschmidt <benh@kernel.crashing.org> writes:

> We don't initialize it, we don't use it, remove it.
>
> We can bring it back if we ever wish to have support for devices
> who have smaller than 32-bit DMA limitations but I don't think
> we care much anymore.
>
> Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
> ---
>  arch/powerpc/Kconfig      |    2 +-
>  arch/powerpc/kernel/dma.c |   10 +---------
>  2 files changed, 2 insertions(+), 10 deletions(-)
>
> diff --git a/arch/powerpc/Kconfig b/arch/powerpc/Kconfig
> index 22b0940..4efbfba 100644
> --- a/arch/powerpc/Kconfig
> +++ b/arch/powerpc/Kconfig
> @@ -712,7 +712,7 @@ config ISA
>  
>  config ZONE_DMA
>  	bool
> -	default y
> +	default n
>  
>  config NEED_DMA_MAP_STATE
>  	def_bool (PPC64 || NOT_COHERENT_CACHE)
> diff --git a/arch/powerpc/kernel/dma.c b/arch/powerpc/kernel/dma.c
> index e24e0ae..6306d4e 100644
> --- a/arch/powerpc/kernel/dma.c
> +++ b/arch/powerpc/kernel/dma.c
> @@ -63,16 +63,8 @@ void *dma_direct_alloc_coherent(struct device *dev, size_t size,
>  		return NULL;
>  	}
>  
> -	switch (zone) {
> -	case ZONE_DMA:
> -		flag |= GFP_DMA;
> -		break;
> -#ifdef CONFIG_ZONE_DMA32
> -	case ZONE_DMA32:
> +	if (zone == ZONE_DMA32)
>  		flag |= GFP_DMA32;
> -		break;
> -#endif
> -	};
>  

Why not do it also for DMA32 as below. We call limit_zone_pfn() only for few
platforms. They can select ZONE_DMA32. Everywhere else ZONE_DMA32 is
same as ZONE_NORMAL ? So instead of having confusing output for
show_mem(), we now have


Node 0 Normal: 6*64kB (UM) 566*128kB (UEM) 367*256kB (UM) 185*512kB (UM)59*1024kB (UEM) 11*2048kB (UM) 4*4096kB (UM) 3*8192kB (UEM) 4016*16384kB

Node 1 Normal: 42*64kB (UEM) 14*128kB (UEM) 10*256kB (UM) 2*512kB (UM) 6*1024kB (UM) 7*2048kB (UEM) 5*4096kB (UM) 2*8192kB (U) 3644*16384kB (MR) =

diff --git a/arch/powerpc/Kconfig b/arch/powerpc/Kconfig
index 38fe9c5409be..3a448cdaa22f 100644
--- a/arch/powerpc/Kconfig
+++ b/arch/powerpc/Kconfig
@@ -290,7 +290,7 @@ config PPC_EMULATE_SSTEP
 
 config ZONE_DMA32
 	bool
-	default y if PPC64
+	default n
 
 source "init/Kconfig"
 
diff --git a/arch/powerpc/kernel/dma.c b/arch/powerpc/kernel/dma.c
index 03511968a9c6..253222ddb308 100644
--- a/arch/powerpc/kernel/dma.c
+++ b/arch/powerpc/kernel/dma.c
@@ -71,6 +71,11 @@ void *dma_direct_alloc_coherent(struct device *dev, size_t size,
 	}
 
 	switch (zone) {
+#ifdef CONFIG_ZONE_DMA
+	case ZONE_DMA:
+		flag |= GFP_DMA;
+		break;
+#endif
 #ifdef CONFIG_ZONE_DMA32
 	case ZONE_DMA32:
 		flag |= GFP_DMA32;

  parent reply	other threads:[~2015-03-18 14:20 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-02-20  8:35 [PATCH 3/3] powerpc/dma: Remove ZONE_DMA completely Benjamin Herrenschmidt
2015-02-26  6:38 ` [3/3] " Michael Ellerman
2015-02-27  3:39   ` Michael Ellerman
2015-02-27  3:48     ` Benjamin Herrenschmidt
2015-03-18 14:19 ` Aneesh Kumar K.V [this message]
2015-03-18 20:38   ` [PATCH 3/3] " Benjamin Herrenschmidt
2015-03-20  5:26     ` Aneesh Kumar K.V

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87zj7amlqn.fsf@linux.vnet.ibm.com \
    --to=aneesh.kumar@linux.vnet.ibm.com \
    --cc=anton@au1.ibm.com \
    --cc=benh@kernel.crashing.org \
    --cc=bjking1@us.ibm.com \
    --cc=linuxppc-dev@lists.ozlabs.org \
    --cc=scottwood@freescale.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.