mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Ian Campbell <ian.campbell@citrix.com>
To: <linux-kernel@vger.kernel.org>
Cc: Ian Campbell <ian.campbell@citrix.com>,
	FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>,
	Jeremy Fitzhardinge <jeremy@goop.org>, <x86@kernel.org>
Subject: [PATCH 5/9] x86: use dma_map_range when allocating PCI GART memory
Date: Fri, 29 May 2009 09:43:59 +0100	[thread overview]
Message-ID: <1243586643-5554-6-git-send-email-ian.campbell@citrix.com> (raw)
In-Reply-To: <1243586643-5554-1-git-send-email-ian.campbell@citrix.com>

This function is intended to replaces is_buffer_dma_capable with a
more generic interface.

Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
Cc: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
Cc: Jeremy Fitzhardinge <jeremy@goop.org>
Cc: x86@kernel.org
---
 arch/x86/kernel/pci-gart_64.c |    6 ++++--
 1 files changed, 4 insertions(+), 2 deletions(-)

diff --git a/arch/x86/kernel/pci-gart_64.c b/arch/x86/kernel/pci-gart_64.c
index 1e8920d..eb043bd 100644
--- a/arch/x86/kernel/pci-gart_64.c
+++ b/arch/x86/kernel/pci-gart_64.c
@@ -190,14 +190,16 @@ static void iommu_full(struct device *dev, size_t size, int dir)
 static inline int
 need_iommu(struct device *dev, unsigned long addr, size_t size)
 {
+	dma_addr_t dma_addr;
 	return force_iommu ||
-		!is_buffer_dma_capable(*dev->dma_mask, addr, size);
+	       !dma_map_range(dev, *dev->dma_mask, addr, size, &dma_addr);
 }
 
 static inline int
 nonforced_iommu(struct device *dev, unsigned long addr, size_t size)
 {
-	return !is_buffer_dma_capable(*dev->dma_mask, addr, size);
+	dma_addr_t dma_addr;
+	return !dma_map_range(dev, *dev->dma_mask, addr, size, &dma_addr);
 }
 
 /* Map a single continuous physical area into the IOMMU.
-- 
1.5.6.5


  parent reply	other threads:[~2009-05-29  8:45 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-05-29  8:43 Ian Campbell
2009-05-29  8:43 ` [PATCH 1/9] ia64: introduce arch-specific dma-mapping interfaces Ian Campbell
2009-05-29  8:43 ` [PATCH 2/9] x86: introduce arch-specific dma-mapping interface Ian Campbell
2009-05-29  8:43 ` [PATCH 3/9] x86: use dma_map_range when allocating PCI DMA memory Ian Campbell
2009-05-29  8:43 ` [PATCH 4/9] x86: use dma_map_range when allocating PCI DMA memory with no IOMMU Ian Campbell
2009-05-29  8:43 ` Ian Campbell [this message]
2009-05-29  8:44 ` [PATCH 6/9] swiotlb: use dma_to_phys and phys_to_dma Ian Campbell
2009-05-29 21:09   ` Jeremy Fitzhardinge
2009-05-30 13:02     ` Ian Campbell
2009-05-29  8:44 ` [PATCH 7/9] swiotlb: use dma_map_range Ian Campbell
2009-05-29  8:44 ` [PATCH 8/9] swiotlb: support HIGHMEM in swiotlb_bus_to_virt Ian Campbell
2009-05-29 15:58   ` Jeremy Fitzhardinge
2009-05-30 13:02     ` Ian Campbell
2009-05-29  8:44 ` [PATCH 9/9] swiotlb: rename swiotlb_virt_to_bus as virt_to_dma Ian Campbell
2009-05-29  9:06 ` swiotlb: Introduce architecture-specific APIs to replace __weak functions Ian Campbell

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=1243586643-5554-6-git-send-email-ian.campbell@citrix.com \
    --to=ian.campbell@citrix.com \
    --cc=fujita.tomonori@lab.ntt.co.jp \
    --cc=jeremy@goop.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=x86@kernel.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

Powered by JetHome