linuxppc-dev.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
From: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
To: linux-kernel@vger.kernel.org
Cc: tony.luck@intel.com, linux-ia64@vger.kernel.org, x86@kernel.org,
	fujita.tomonori@lab.ntt.co.jp, linuxppc-dev@ozlabs.org
Subject: [PATCH 10/15] powerpc: remove unncesary swiotlb_arch_address_needs_mapping
Date: Fri, 10 Jul 2009 10:04:59 +0900	[thread overview]
Message-ID: <1247187904-31999-11-git-send-email-fujita.tomonori@lab.ntt.co.jp> (raw)
In-Reply-To: <1247187904-31999-1-git-send-email-fujita.tomonori@lab.ntt.co.jp>

swiotlb doesn't use swiotlb_arch_address_needs_mapping(); it uses
dma_capalbe(). We can remove unnecessary
swiotlb_arch_address_needs_mapping().

We can remove swiotlb_addr_needs_map() and is_buffer_dma_capable() in
swiotlb_pci_addr_needs_map() too; dma_capable() handles the features
that both provide.

Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
---
 arch/powerpc/kernel/dma-swiotlb.c |   27 +--------------------------
 1 files changed, 1 insertions(+), 26 deletions(-)

diff --git a/arch/powerpc/kernel/dma-swiotlb.c b/arch/powerpc/kernel/dma-swiotlb.c
index 41534ae..a3bbe02 100644
--- a/arch/powerpc/kernel/dma-swiotlb.c
+++ b/arch/powerpc/kernel/dma-swiotlb.c
@@ -36,28 +36,11 @@ phys_addr_t swiotlb_bus_to_phys(struct device *hwdev, dma_addr_t baddr)
 }
 
 /*
- * Determine if an address needs bounce buffering via swiotlb.
- * Going forward I expect the swiotlb code to generalize on using
- * a dma_ops->addr_needs_map, and this function will move from here to the
- * generic swiotlb code.
- */
-int
-swiotlb_arch_address_needs_mapping(struct device *hwdev, dma_addr_t addr,
-				   size_t size)
-{
-	struct dma_mapping_ops *dma_ops = get_dma_ops(hwdev);
-
-	BUG_ON(!dma_ops);
-	return dma_ops->addr_needs_map(hwdev, addr, size);
-}
-
-/*
  * Determine if an address is reachable by a pci device, or if we must bounce.
  */
 static int
 swiotlb_pci_addr_needs_map(struct device *hwdev, dma_addr_t addr, size_t size)
 {
-	u64 mask = dma_get_mask(hwdev);
 	dma_addr_t max;
 	struct pci_controller *hose;
 	struct pci_dev *pdev = to_pci_dev(hwdev);
@@ -69,16 +52,9 @@ swiotlb_pci_addr_needs_map(struct device *hwdev, dma_addr_t addr, size_t size)
 	if ((addr + size > max) | (addr < hose->dma_window_base_cur))
 		return 1;
 
-	return !is_buffer_dma_capable(mask, addr, size);
-}
-
-static int
-swiotlb_addr_needs_map(struct device *hwdev, dma_addr_t addr, size_t size)
-{
-	return !is_buffer_dma_capable(dma_get_mask(hwdev), addr, size);
+	return 0;
 }
 
-
 /*
  * At the moment, all platforms that use this code only require
  * swiotlb to be used if we're operating on HIGHMEM.  Since
@@ -94,7 +70,6 @@ struct dma_mapping_ops swiotlb_dma_ops = {
 	.dma_supported = swiotlb_dma_supported,
 	.map_page = swiotlb_map_page,
 	.unmap_page = swiotlb_unmap_page,
-	.addr_needs_map = swiotlb_addr_needs_map,
 	.sync_single_range_for_cpu = swiotlb_sync_single_range_for_cpu,
 	.sync_single_range_for_device = swiotlb_sync_single_range_for_device,
 	.sync_sg_for_cpu = swiotlb_sync_sg_for_cpu,
-- 
1.6.0.6

  parent reply	other threads:[~2009-07-10  1:20 UTC|newest]

Thread overview: 33+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-07-10  1:04 [00/15] swiotlb cleanup FUJITA Tomonori
2009-07-10  1:04 ` [PATCH 01/15] swiotlb: remove unused swiotlb_alloc_boot() FUJITA Tomonori
2009-07-10  1:04 ` [PATCH 02/15] swiotlb: remove unused swiotlb_alloc() FUJITA Tomonori
2009-07-10  1:04 ` [PATCH 03/15] swiotlb: remove swiotlb_arch_range_needs_mapping FUJITA Tomonori
2009-07-10  1:04 ` [PATCH 04/15] swiotlb: remove unnecessary swiotlb_bus_to_virt FUJITA Tomonori
2009-07-14  2:17   ` Becky Bruce
2009-07-14  5:08     ` FUJITA Tomonori
2009-07-16  3:40     ` Benjamin Herrenschmidt
2009-07-10  1:04 ` [PATCH 05/15] x86: add dma_capable() to replace is_buffer_dma_capable() FUJITA Tomonori
2009-07-10  1:04 ` [PATCH 06/15] x86: replace is_buffer_dma_capable() with dma_capable FUJITA Tomonori
2009-07-10  1:04 ` [PATCH 07/15] ia64: add dma_capable() to replace is_buffer_dma_capable() FUJITA Tomonori
2009-07-10  1:04 ` [PATCH 08/15] powerpc: " FUJITA Tomonori
2009-07-10  1:04 ` [PATCH 09/15] swiotlb: use dma_capable() FUJITA Tomonori
2009-07-10  1:04 ` FUJITA Tomonori [this message]
2009-07-10  1:05 ` [PATCH 11/15] remove is_buffer_dma_capable() FUJITA Tomonori
2009-07-10  1:05 ` [PATCH 12/15] x86, IA64, powerpc: add phys_to_dma() and dma_to_phys() FUJITA Tomonori
2009-07-10  1:05 ` [PATCH 13/15] swiotlb: use phys_to_dma and dma_to_phys FUJITA Tomonori
2009-07-10  1:05 ` [PATCH 14/15] powerpc: remove unused swiotlb_phys_to_bus() and swiotlb_bus_to_phys() FUJITA Tomonori
2009-07-10  1:05 ` [PATCH 15/15] x86: " FUJITA Tomonori
2009-07-10  5:12 ` [00/15] swiotlb cleanup Ingo Molnar
2009-07-10  5:35   ` FUJITA Tomonori
2009-07-10 14:02     ` Ian Campbell
2009-07-13  4:20       ` FUJITA Tomonori
2009-07-13  9:40         ` Ian Campbell
2009-07-13  9:53           ` FUJITA Tomonori
2009-07-13 10:05             ` Ian Campbell
2009-07-10 14:01   ` Ian Campbell
2009-07-10 14:12     ` Ingo Molnar
2009-07-13  4:20       ` FUJITA Tomonori
2009-07-13  9:16         ` FUJITA Tomonori
2009-07-18 10:41           ` Ingo Molnar
2009-07-14  3:13   ` Becky Bruce
2009-07-15 20:24     ` Becky Bruce

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=1247187904-31999-11-git-send-email-fujita.tomonori@lab.ntt.co.jp \
    --to=fujita.tomonori@lab.ntt.co.jp \
    --cc=linux-ia64@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linuxppc-dev@ozlabs.org \
    --cc=tony.luck@intel.com \
    --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;
as well as URLs for NNTP newsgroup(s).