public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: "Andi Kleen" <ak@suse.de>
To: torvalds@osdl.org
Cc: linux-kernel@vger.kernel.org, discuss@x86-64.org
Subject: [3/3] Use the DMA32 zone for  dma_alloc_coherent()/pci_alloc_consistent on x86-64
Date: Sun, 11 Sep 2005 18:59:19 +0200	[thread overview]
Message-ID: <43246267.mailL4Y1GM1RI@suse.de> (raw)

Use the DMA32 zone for dma_alloc_coherent()/pci_alloc_consistent on x86-64

Signed-off-by: Andi Kleen <ak@suse.de>

Index: linux/arch/x86_64/kernel/pci-gart.c
===================================================================
--- linux.orig/arch/x86_64/kernel/pci-gart.c
+++ linux/arch/x86_64/kernel/pci-gart.c
@@ -219,6 +219,8 @@ dma_alloc_coherent(struct device *dev, s
 	/* Kludge to make it bug-to-bug compatible with i386. i386
 	   uses the normal dma_mask for alloc_coherent. */
 	dma_mask &= *dev->dma_mask;
+	if (dma_mask <= 0xffffffff)
+		gfp |= GFP_DMA32;
 
  again:
 	memory = dma_alloc_pages(dev, gfp, get_order(size));
@@ -245,7 +247,7 @@ dma_alloc_coherent(struct device *dev, s
 				}
 
 				if (!(gfp & GFP_DMA)) { 
-					gfp |= GFP_DMA; 
+					gfp = (gfp & ~GFP_DMA32) | GFP_DMA;
 					goto again;
 				}
 				return NULL;

             reply	other threads:[~2005-09-11 16:59 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-09-11 16:59 Andi Kleen [this message]
2005-09-12 17:41 ` [3/3] Use the DMA32 zone for dma_alloc_coherent()/pci_alloc_consistent on x86-64 Linus Torvalds
2005-09-12 17:59   ` Andi Kleen

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=43246267.mailL4Y1GM1RI@suse.de \
    --to=ak@suse.de \
    --cc=discuss@x86-64.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=torvalds@osdl.org \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox