All of lore.kernel.org
 help / color / mirror / Atom feed
From: Benjamin Herrenschmidt <benh@kernel.crashing.org>
To: linuxppc-dev@ozlabs.org
Cc: Scott Wood <scottwood@freescale.com>,
	Anton Blanchard <anton@au1.ibm.com>,
	Brian J King <bjking1@us.ibm.com>
Subject: [PATCH 1/3] powerpc/dma: Always configure ZONE_DMA32 correctly
Date: Fri, 20 Feb 2015 19:35:25 +1100	[thread overview]
Message-ID: <1424421325.27448.41.camel@kernel.crashing.org> (raw)

We do this for consistency and also in order to support the use of a
consistent mask smaller than the dma mask in subsequent patches.

Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
---
 arch/powerpc/kernel/dma-swiotlb.c | 3 ---
 arch/powerpc/mm/mem.c             | 6 ++++++
 2 files changed, 6 insertions(+), 3 deletions(-)

diff --git a/arch/powerpc/kernel/dma-swiotlb.c b/arch/powerpc/kernel/dma-swiotlb.c
index 7359797..cb92f94 100644
--- a/arch/powerpc/kernel/dma-swiotlb.c
+++ b/arch/powerpc/kernel/dma-swiotlb.c
@@ -110,9 +110,6 @@ void __init swiotlb_detect_4g(void)
 {
 	if ((memblock_end_of_DRAM() - 1) > 0xffffffff) {
 		ppc_swiotlb_enable = 1;
-#ifdef CONFIG_ZONE_DMA32
-		limit_zone_pfn(ZONE_DMA32, (1ULL << 32) >> PAGE_SHIFT);
-#endif
 	}
 }
 
diff --git a/arch/powerpc/mm/mem.c b/arch/powerpc/mm/mem.c
index b7285a5..f146ef0 100644
--- a/arch/powerpc/mm/mem.c
+++ b/arch/powerpc/mm/mem.c
@@ -307,6 +307,12 @@ void __init paging_init(void)
 	printk(KERN_DEBUG "Memory hole size: %ldMB\n",
 	       (long int)((top_of_ram - total_ram) >> 20));
 
+#ifdef CONFIG_ZONE_DMA32
+	/* Default limit for ZONE_DMA32, platform might limit it
+	 * further due to PCI bridge addressing limitations
+	 */
+	limit_zone_pfn(ZONE_DMA32, (1ULL << 32) >> PAGE_SHIFT);
+#endif
 #ifdef CONFIG_HIGHMEM
 	top_zone = ZONE_HIGHMEM;
 	limit_zone_pfn(ZONE_NORMAL, lowmem_end_addr >> PAGE_SHIFT);

             reply	other threads:[~2015-02-20  8:35 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-02-20  8:35 Benjamin Herrenschmidt [this message]
2015-02-21 11:26 ` [PATCH 1/3] powerpc/dma: Always configure ZONE_DMA32 correctly Kevin Hao
2015-02-21 22:23   ` Benjamin Herrenschmidt
2015-02-21 23:17     ` Kevin Hao

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=1424421325.27448.41.camel@kernel.crashing.org \
    --to=benh@kernel.crashing.org \
    --cc=anton@au1.ibm.com \
    --cc=bjking1@us.ibm.com \
    --cc=linuxppc-dev@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.