aboutsummaryrefslogtreecommitdiffstats
path: root/arch
diff options
context:
space:
mode:
authorJan Beulich <jbeulich@novell.com>2007-07-09 14:55:51 -0400
committerGreg Kroah-Hartman <gregkh@suse.de>2007-07-11 19:02:11 -0400
commitcaa5171622c8fef70fa20d2d74f4326866039df9 (patch)
treeeee98d71a3d57db4fcadd6bcca2612b64c367083 /arch
parentb7b095c154c50ee753832bbf78e8690c492fc8f6 (diff)
PCI: remove pci_dac_dma_... APIs
Based on replies to a respective query, remove the pci_dac_dma_...() APIs (except for pci_dac_dma_supported() on Alpha, where this function is used in non-DAC PCI DMA code). Signed-off-by: Jan Beulich <jbeulich@novell.com> Cc: Andi Kleen <ak@suse.de> Cc: Jesse Barnes <jesse.barnes@intel.com> Cc: Christoph Hellwig <hch@infradead.org> Acked-by: David Miller <davem@davemloft.net> Cc: Jeff Garzik <jeff@garzik.org> Cc: <linux-arch@vger.kernel.org> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'arch')
-rw-r--r--arch/alpha/kernel/pci_iommu.c32
-rw-r--r--arch/mips/pci/Makefile2
-rw-r--r--arch/mips/pci/pci-dac.c79
-rw-r--r--arch/x86_64/kernel/pci-dma.c3
4 files changed, 7 insertions, 109 deletions
diff --git a/arch/alpha/kernel/pci_iommu.c b/arch/alpha/kernel/pci_iommu.c
index 28c84e55feb9..6b07f89a72c7 100644
--- a/arch/alpha/kernel/pci_iommu.c
+++ b/arch/alpha/kernel/pci_iommu.c
@@ -207,6 +207,10 @@ iommu_arena_free(struct pci_iommu_arena *arena, long ofs, long n)
207 p[i] = 0; 207 p[i] = 0;
208} 208}
209 209
210/* True if the machine supports DAC addressing, and DEV can
211 make use of it given MASK. */
212static int pci_dac_dma_supported(struct pci_dev *hwdev, u64 mask);
213
210/* Map a single buffer of the indicated size for PCI DMA in streaming 214/* Map a single buffer of the indicated size for PCI DMA in streaming
211 mode. The 32-bit PCI bus mastering address to use is returned. 215 mode. The 32-bit PCI bus mastering address to use is returned.
212 Once the device is given the dma address, the device owns this memory 216 Once the device is given the dma address, the device owns this memory
@@ -897,7 +901,7 @@ iommu_unbind(struct pci_iommu_arena *arena, long pg_start, long pg_count)
897/* True if the machine supports DAC addressing, and DEV can 901/* True if the machine supports DAC addressing, and DEV can
898 make use of it given MASK. */ 902 make use of it given MASK. */
899 903
900int 904static int
901pci_dac_dma_supported(struct pci_dev *dev, u64 mask) 905pci_dac_dma_supported(struct pci_dev *dev, u64 mask)
902{ 906{
903 dma64_addr_t dac_offset = alpha_mv.pci_dac_offset; 907 dma64_addr_t dac_offset = alpha_mv.pci_dac_offset;
@@ -917,32 +921,6 @@ pci_dac_dma_supported(struct pci_dev *dev, u64 mask)
917 921
918 return ok; 922 return ok;
919} 923}
920EXPORT_SYMBOL(pci_dac_dma_supported);
921
922dma64_addr_t
923pci_dac_page_to_dma(struct pci_dev *pdev, struct page *page,
924 unsigned long offset, int direction)
925{
926 return (alpha_mv.pci_dac_offset
927 + __pa(page_address(page))
928 + (dma64_addr_t) offset);
929}
930EXPORT_SYMBOL(pci_dac_page_to_dma);
931
932struct page *
933pci_dac_dma_to_page(struct pci_dev *pdev, dma64_addr_t dma_addr)
934{
935 unsigned long paddr = (dma_addr & PAGE_MASK) - alpha_mv.pci_dac_offset;
936 return virt_to_page(__va(paddr));
937}
938EXPORT_SYMBOL(pci_dac_dma_to_page);
939
940unsigned long
941pci_dac_dma_to_offset(struct pci_dev *pdev, dma64_addr_t dma_addr)
942{
943 return (dma_addr & ~PAGE_MASK);
944}
945EXPORT_SYMBOL(pci_dac_dma_to_offset);
946 924
947/* Helper for generic DMA-mapping functions. */ 925/* Helper for generic DMA-mapping functions. */
948 926
diff --git a/arch/mips/pci/Makefile b/arch/mips/pci/Makefile
index f26ede001a0b..c58bd3d036f4 100644
--- a/arch/mips/pci/Makefile
+++ b/arch/mips/pci/Makefile
@@ -2,7 +2,7 @@
2# Makefile for the PCI specific kernel interface routines under Linux. 2# Makefile for the PCI specific kernel interface routines under Linux.
3# 3#
4 4
5obj-y += pci.o pci-dac.o 5obj-y += pci.o
6 6
7# 7#
8# PCI bus host bridge specific code 8# PCI bus host bridge specific code
diff --git a/arch/mips/pci/pci-dac.c b/arch/mips/pci/pci-dac.c
deleted file mode 100644
index 0f0ea1b7d4dd..000000000000
--- a/arch/mips/pci/pci-dac.c
+++ /dev/null
@@ -1,79 +0,0 @@
1/*
2 * This file is subject to the terms and conditions of the GNU General Public
3 * License. See the file "COPYING" in the main directory of this archive
4 * for more details.
5 *
6 * Copyright (C) 2000 Ani Joshi <ajoshi@unixbox.com>
7 * Copyright (C) 2000, 2001, 06 Ralf Baechle <ralf@linux-mips.org>
8 * swiped from i386, and cloned for MIPS by Geert, polished by Ralf.
9 */
10
11#include <linux/types.h>
12#include <linux/dma-mapping.h>
13#include <linux/mm.h>
14#include <linux/module.h>
15#include <linux/string.h>
16
17#include <asm/cache.h>
18#include <asm/io.h>
19
20#include <dma-coherence.h>
21
22#include <linux/pci.h>
23
24dma64_addr_t pci_dac_page_to_dma(struct pci_dev *pdev,
25 struct page *page, unsigned long offset, int direction)
26{
27 struct device *dev = &pdev->dev;
28
29 BUG_ON(direction == DMA_NONE);
30
31 if (!plat_device_is_coherent(dev)) {
32 unsigned long addr;
33
34 addr = (unsigned long) page_address(page) + offset;
35 dma_cache_wback_inv(addr, PAGE_SIZE);
36 }
37
38 return plat_map_dma_mem_page(dev, page) + offset;
39}
40
41EXPORT_SYMBOL(pci_dac_page_to_dma);
42
43struct page *pci_dac_dma_to_page(struct pci_dev *pdev,
44 dma64_addr_t dma_addr)
45{
46 return pfn_to_page(plat_dma_addr_to_phys(dma_addr) >> PAGE_SHIFT);
47}
48
49EXPORT_SYMBOL(pci_dac_dma_to_page);
50
51unsigned long pci_dac_dma_to_offset(struct pci_dev *pdev,
52 dma64_addr_t dma_addr)
53{
54 return dma_addr & ~PAGE_MASK;
55}
56
57EXPORT_SYMBOL(pci_dac_dma_to_offset);
58
59void pci_dac_dma_sync_single_for_cpu(struct pci_dev *pdev,
60 dma64_addr_t dma_addr, size_t len, int direction)
61{
62 BUG_ON(direction == PCI_DMA_NONE);
63
64 if (!plat_device_is_coherent(&pdev->dev))
65 dma_cache_wback_inv(dma_addr + PAGE_OFFSET, len);
66}
67
68EXPORT_SYMBOL(pci_dac_dma_sync_single_for_cpu);
69
70void pci_dac_dma_sync_single_for_device(struct pci_dev *pdev,
71 dma64_addr_t dma_addr, size_t len, int direction)
72{
73 BUG_ON(direction == PCI_DMA_NONE);
74
75 if (!plat_device_is_coherent(&pdev->dev))
76 dma_cache_wback_inv(dma_addr + PAGE_OFFSET, len);
77}
78
79EXPORT_SYMBOL(pci_dac_dma_sync_single_for_device);
diff --git a/arch/x86_64/kernel/pci-dma.c b/arch/x86_64/kernel/pci-dma.c
index 9f80aad3fe2d..90f6315d02d4 100644
--- a/arch/x86_64/kernel/pci-dma.c
+++ b/arch/x86_64/kernel/pci-dma.c
@@ -22,8 +22,7 @@ EXPORT_SYMBOL(bad_dma_address);
22int iommu_bio_merge __read_mostly = 0; 22int iommu_bio_merge __read_mostly = 0;
23EXPORT_SYMBOL(iommu_bio_merge); 23EXPORT_SYMBOL(iommu_bio_merge);
24 24
25int iommu_sac_force __read_mostly = 0; 25static int iommu_sac_force __read_mostly = 0;
26EXPORT_SYMBOL(iommu_sac_force);
27 26
28int no_iommu __read_mostly; 27int no_iommu __read_mostly;
29#ifdef CONFIG_IOMMU_DEBUG 28#ifdef CONFIG_IOMMU_DEBUG