* [PATCH v2 -mm 00/14] adds include/linux/pci-dma.h
@ 2010-02-10 1:34 FUJITA Tomonori
2010-02-10 1:34 ` [PATCH v2 -mm 01/14] " FUJITA Tomonori
` (13 more replies)
0 siblings, 14 replies; 26+ messages in thread
From: FUJITA Tomonori @ 2010-02-10 1:34 UTC (permalink / raw)
To: linux-kernel
Cc: akpm, fujita.tomonori, x86, Richard Henderson, Ivan Kokshaysky,
Matt Turner, Russell King, David Howells, Tony Luck, Ralf Baechle,
Kyle McMartin, Helge Deller, James Bottomley,
Benjamin Herrenschmidt, Paul Mundt, David S. Miller, Chris Zankel,
Arnd Bergmann
This patch adds include/linux/pci-dma.h that defines the pci_unmap
state API to remove the duplication in architecture implementations:
DECLARE_PCI_UNMAP_ADDR(ADDR_NAME)
DECLARE_PCI_UNMAP_LEN(LEN_NAME)
pci_unmap_addr(PTR, ADDR_NAME)
pci_unmap_addr_set(PTR, ADDR_NAME, VAL)
pci_unmap_len(PTR, LEN_NAME)
pci_unmap_len_set(PTR, LEN_NAME, VAL)
This enables us to remove lots of the duplication in architecture
implementations since there are only two ways to define the API.
If architectures define CONFIG_NEED_DMA_MAP_STATE, they get the real
definition of pci_unmap state API. If not, they get the noop
definition.
In the long term, it's better to replace the API with the generic
device model API such as DECLARE_DMA_UNMAP_ADDR. We can map the API to
the generic one (like dma-mapping-compat.h does). This patch also
makes the migration process easier. We can remove this file after the
migration.
It might be simpler to add the API to include/linux/pci.h but looks
it's already too large. We'll remove pci-dma.h after finishing moving
to the generic device model. So I put the API to a separate file.
This is the second version of:
http://marc.info/?l=linux-kernel&m=126572502029999&w=2
=
arch/alpha/Kconfig | 3 +++
arch/alpha/include/asm/pci.h | 14 --------------
arch/arm/Kconfig | 3 +++
arch/arm/include/asm/pci.h | 11 -----------
arch/cris/include/asm/pci.h | 8 --------
arch/frv/include/asm/pci.h | 8 --------
arch/ia64/Kconfig | 3 +++
arch/ia64/include/asm/pci.h | 14 --------------
arch/mips/Kconfig | 4 ++--
arch/mips/include/asm/pci.h | 22 ----------------------
arch/parisc/Kconfig | 3 +++
arch/parisc/include/asm/pci.h | 14 --------------
arch/powerpc/Kconfig | 3 +++
arch/powerpc/include/asm/pci.h | 32 --------------------------------
arch/sh/Kconfig | 3 +++
arch/sh/include/asm/pci.h | 19 -------------------
arch/sparc/Kconfig | 3 +++
arch/sparc/include/asm/pci_32.h | 14 --------------
arch/sparc/include/asm/pci_64.h | 14 --------------
arch/x86/Kconfig | 3 +++
arch/x86/include/asm/pci.h | 28 ----------------------------
arch/xtensa/include/asm/pci.h | 8 --------
include/linux/pci-dma.h | 20 ++++++++++++++++++++
include/linux/pci.h | 1 +
24 files changed, 47 insertions(+), 208 deletions(-)
^ permalink raw reply [flat|nested] 26+ messages in thread
* [PATCH v2 -mm 01/14] adds include/linux/pci-dma.h
2010-02-10 1:34 [PATCH v2 -mm 00/14] adds include/linux/pci-dma.h FUJITA Tomonori
@ 2010-02-10 1:34 ` FUJITA Tomonori
2010-02-10 6:57 ` Arnd Bergmann
` (2 more replies)
2010-02-10 1:34 ` [PATCH v2 -mm 02/14] x86: use include/linux/pci-dma.h FUJITA Tomonori
` (12 subsequent siblings)
13 siblings, 3 replies; 26+ messages in thread
From: FUJITA Tomonori @ 2010-02-10 1:34 UTC (permalink / raw)
To: linux-kernel
Cc: akpm, fujita.tomonori, x86, Richard Henderson, Ivan Kokshaysky,
Matt Turner, Russell King, David Howells, Tony Luck, Ralf Baechle,
Kyle McMartin, Helge Deller, James Bottomley,
Benjamin Herrenschmidt, Paul Mundt, David S. Miller, Chris Zankel,
Arnd Bergmann
This patch adds include/linux/pci-dma.h that defines the pci_unmap
state API:
DECLARE_PCI_UNMAP_ADDR(ADDR_NAME)
DECLARE_PCI_UNMAP_LEN(LEN_NAME)
pci_unmap_addr(PTR, ADDR_NAME)
pci_unmap_addr_set(PTR, ADDR_NAME, VAL)
pci_unmap_len(PTR, LEN_NAME)
pci_unmap_len_set(PTR, LEN_NAME, VAL)
This enables us to remove lots of the duplication in architecture
implementations since there are only two ways to define the API.
If architectures define CONFIG_NEED_DMA_MAP_STATE, they get the real
definition of pci_unmap state API. If not, they get the noop
definition.
In the long term, it's better to replace the API with the generic
device model API such as DECLARE_DMA_UNMAP_ADDR. We can map the API to
the generic one (like dma-mapping-compat.h does). This patch also
makes the migration process easier. We can remove this file after the
migration.
It might be simpler to add the API to include/linux/pci.h but looks
it's already too large. We'll remove pci-dma.h after finishing moving
to the generic device model. So I put the API to a separate file.
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
Cc: x86@kernel.org
Cc: Richard Henderson <rth@twiddle.net>
Cc: Ivan Kokshaysky <ink@jurassic.park.msu.ru>
Cc: Matt Turner <mattst88@gmail.com>
Cc: Russell King <linux@arm.linux.org.uk>
Cc: David Howells <dhowells@redhat.com>
Cc: Tony Luck <tony.luck@intel.com>
Cc: Ralf Baechle <ralf@linux-mips.org>
Cc: Kyle McMartin <kyle@mcmartin.ca>
Cc: Helge Deller <deller@gmx.de>
Cc: James Bottomley <James.Bottomley@suse.de>
Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Cc: Paul Mundt <lethal@linux-sh.org>
Cc: David S. Miller <davem@davemloft.net>
Cc: Chris Zankel <chris@zankel.net>
Cc: Arnd Bergmann <arnd@arndb.de>
---
include/linux/pci-dma.h | 20 ++++++++++++++++++++
1 files changed, 20 insertions(+), 0 deletions(-)
create mode 100644 include/linux/pci-dma.h
diff --git a/include/linux/pci-dma.h b/include/linux/pci-dma.h
new file mode 100644
index 0000000..cfd63ab
--- /dev/null
+++ b/include/linux/pci-dma.h
@@ -0,0 +1,20 @@
+#ifndef _LINUX_PCI_DMA_H
+#define _LINUX_PCI_DMA_H
+
+#ifdef CONFIG_NEED_DMA_MAP_STATE
+#define DECLARE_PCI_UNMAP_ADDR(ADDR_NAME) dma_addr_t ADDR_NAME;
+#define DECLARE_PCI_UNMAP_LEN(LEN_NAME) __u32 LEN_NAME;
+#define pci_unmap_addr(PTR, ADDR_NAME) ((PTR)->ADDR_NAME)
+#define pci_unmap_addr_set(PTR, ADDR_NAME, VAL) (((PTR)->ADDR_NAME) = (VAL))
+#define pci_unmap_len(PTR, LEN_NAME) ((PTR)->LEN_NAME)
+#define pci_unmap_len_set(PTR, LEN_NAME, VAL) (((PTR)->LEN_NAME) = (VAL))
+#else
+#define DECLARE_PCI_UNMAP_ADDR(ADDR_NAME)
+#define DECLARE_PCI_UNMAP_LEN(LEN_NAME)
+#define pci_unmap_addr(PTR, ADDR_NAME) (0)
+#define pci_unmap_addr_set(PTR, ADDR_NAME, VAL) do { } while (0)
+#define pci_unmap_len(PTR, LEN_NAME) (0)
+#define pci_unmap_len_set(PTR, LEN_NAME, VAL) do { } while (0)
+#endif
+
+#endif
--
1.5.6.5
^ permalink raw reply related [flat|nested] 26+ messages in thread
* [PATCH v2 -mm 02/14] x86: use include/linux/pci-dma.h
2010-02-10 1:34 [PATCH v2 -mm 00/14] adds include/linux/pci-dma.h FUJITA Tomonori
2010-02-10 1:34 ` [PATCH v2 -mm 01/14] " FUJITA Tomonori
@ 2010-02-10 1:34 ` FUJITA Tomonori
2010-02-10 1:34 ` [PATCH v2 -mm 03/14] alpha: " FUJITA Tomonori
` (11 subsequent siblings)
13 siblings, 0 replies; 26+ messages in thread
From: FUJITA Tomonori @ 2010-02-10 1:34 UTC (permalink / raw)
To: linux-kernel; +Cc: akpm, fujita.tomonori, x86
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
Cc: x86@kernel.org
---
arch/x86/Kconfig | 3 +++
arch/x86/include/asm/pci.h | 30 ++----------------------------
2 files changed, 5 insertions(+), 28 deletions(-)
diff --git a/arch/x86/Kconfig b/arch/x86/Kconfig
index 15c1c09..46da6ce 100644
--- a/arch/x86/Kconfig
+++ b/arch/x86/Kconfig
@@ -100,6 +100,9 @@ config ZONE_DMA
config SBUS
bool
+config NEED_DMA_MAP_STATE
+ def_bool (X86_64 || DMAR || DMA_API_DEBUG)
+
config GENERIC_ISA_DMA
def_bool y
diff --git a/arch/x86/include/asm/pci.h b/arch/x86/include/asm/pci.h
index ada8c20..d9bef0a 100644
--- a/arch/x86/include/asm/pci.h
+++ b/arch/x86/include/asm/pci.h
@@ -90,34 +90,6 @@ extern void pci_iommu_alloc(void);
#define PCI_DMA_BUS_IS_PHYS (dma_ops->is_phys)
-#if defined(CONFIG_X86_64) || defined(CONFIG_DMAR) || defined(CONFIG_DMA_API_DEBUG)
-
-#define DECLARE_PCI_UNMAP_ADDR(ADDR_NAME) \
- dma_addr_t ADDR_NAME;
-#define DECLARE_PCI_UNMAP_LEN(LEN_NAME) \
- __u32 LEN_NAME;
-#define pci_unmap_addr(PTR, ADDR_NAME) \
- ((PTR)->ADDR_NAME)
-#define pci_unmap_addr_set(PTR, ADDR_NAME, VAL) \
- (((PTR)->ADDR_NAME) = (VAL))
-#define pci_unmap_len(PTR, LEN_NAME) \
- ((PTR)->LEN_NAME)
-#define pci_unmap_len_set(PTR, LEN_NAME, VAL) \
- (((PTR)->LEN_NAME) = (VAL))
-
-#else
-
-#define DECLARE_PCI_UNMAP_ADDR(ADDR_NAME) dma_addr_t ADDR_NAME[0];
-#define DECLARE_PCI_UNMAP_LEN(LEN_NAME) unsigned LEN_NAME[0];
-#define pci_unmap_addr(PTR, ADDR_NAME) sizeof((PTR)->ADDR_NAME)
-#define pci_unmap_addr_set(PTR, ADDR_NAME, VAL) \
- do { break; } while (pci_unmap_addr(PTR, ADDR_NAME))
-#define pci_unmap_len(PTR, LEN_NAME) sizeof((PTR)->LEN_NAME)
-#define pci_unmap_len_set(PTR, LEN_NAME, VAL) \
- do { break; } while (pci_unmap_len(PTR, LEN_NAME))
-
-#endif
-
#endif /* __KERNEL__ */
#ifdef CONFIG_X86_64
@@ -127,6 +99,8 @@ extern void pci_iommu_alloc(void);
/* implement the pci_ DMA API in terms of the generic device dma_ one */
#include <asm-generic/pci-dma-compat.h>
+#include <linux/pci-dma.h>
+
/* generic pci stuff */
#include <asm-generic/pci.h>
#define PCIBIOS_MAX_MEM_32 0xffffffff
--
1.5.6.5
^ permalink raw reply related [flat|nested] 26+ messages in thread
* [PATCH v2 -mm 03/14] alpha: use include/linux/pci-dma.h
2010-02-10 1:34 [PATCH v2 -mm 00/14] adds include/linux/pci-dma.h FUJITA Tomonori
2010-02-10 1:34 ` [PATCH v2 -mm 01/14] " FUJITA Tomonori
2010-02-10 1:34 ` [PATCH v2 -mm 02/14] x86: use include/linux/pci-dma.h FUJITA Tomonori
@ 2010-02-10 1:34 ` FUJITA Tomonori
2010-02-11 18:49 ` Matt Turner
2010-02-10 1:34 ` [PATCH v2 -mm 04/14] arm: " FUJITA Tomonori
` (10 subsequent siblings)
13 siblings, 1 reply; 26+ messages in thread
From: FUJITA Tomonori @ 2010-02-10 1:34 UTC (permalink / raw)
To: linux-kernel
Cc: akpm, fujita.tomonori, Richard Henderson, Ivan Kokshaysky,
Matt Turner
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
Cc: Richard Henderson <rth@twiddle.net>
Cc: Ivan Kokshaysky <ink@jurassic.park.msu.ru>
Cc: Matt Turner <mattst88@gmail.com>
---
arch/alpha/Kconfig | 3 +++
arch/alpha/include/asm/pci.h | 14 +-------------
2 files changed, 4 insertions(+), 13 deletions(-)
diff --git a/arch/alpha/Kconfig b/arch/alpha/Kconfig
index bd7261e..759f49d 100644
--- a/arch/alpha/Kconfig
+++ b/arch/alpha/Kconfig
@@ -58,6 +58,9 @@ config ZONE_DMA
bool
default y
+config NEED_DMA_MAP_STATE
+ def_bool y
+
config GENERIC_ISA_DMA
bool
default y
diff --git a/arch/alpha/include/asm/pci.h b/arch/alpha/include/asm/pci.h
index dd8dcab..4765946 100644
--- a/arch/alpha/include/asm/pci.h
+++ b/arch/alpha/include/asm/pci.h
@@ -119,19 +119,7 @@ pci_dma_mapping_error(struct pci_dev *pdev, dma_addr_t dma_addr)
extern void pci_unmap_single(struct pci_dev *, dma_addr_t, size_t, int);
extern void pci_unmap_page(struct pci_dev *, dma_addr_t, size_t, int);
-/* pci_unmap_{single,page} is not a nop, thus... */
-#define DECLARE_PCI_UNMAP_ADDR(ADDR_NAME) \
- dma_addr_t ADDR_NAME;
-#define DECLARE_PCI_UNMAP_LEN(LEN_NAME) \
- __u32 LEN_NAME;
-#define pci_unmap_addr(PTR, ADDR_NAME) \
- ((PTR)->ADDR_NAME)
-#define pci_unmap_addr_set(PTR, ADDR_NAME, VAL) \
- (((PTR)->ADDR_NAME) = (VAL))
-#define pci_unmap_len(PTR, LEN_NAME) \
- ((PTR)->LEN_NAME)
-#define pci_unmap_len_set(PTR, LEN_NAME, VAL) \
- (((PTR)->LEN_NAME) = (VAL))
+#include <linux/pci-dma.h>
/* Map a set of buffers described by scatterlist in streaming mode for
PCI DMA. This is the scatter-gather version of the above
--
1.5.6.5
^ permalink raw reply related [flat|nested] 26+ messages in thread
* [PATCH v2 -mm 04/14] arm: use include/linux/pci-dma.h
2010-02-10 1:34 [PATCH v2 -mm 00/14] adds include/linux/pci-dma.h FUJITA Tomonori
` (2 preceding siblings ...)
2010-02-10 1:34 ` [PATCH v2 -mm 03/14] alpha: " FUJITA Tomonori
@ 2010-02-10 1:34 ` FUJITA Tomonori
2010-02-12 14:51 ` Russell King - ARM Linux
2010-02-10 1:34 ` [PATCH v2 -mm 05/14] frv: " FUJITA Tomonori
` (9 subsequent siblings)
13 siblings, 1 reply; 26+ messages in thread
From: FUJITA Tomonori @ 2010-02-10 1:34 UTC (permalink / raw)
To: linux-kernel; +Cc: akpm, fujita.tomonori, Russell King
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
Cc: Russell King <linux@arm.linux.org.uk>
---
arch/arm/Kconfig | 3 +++
arch/arm/include/asm/pci.h | 11 +----------
2 files changed, 4 insertions(+), 10 deletions(-)
diff --git a/arch/arm/Kconfig b/arch/arm/Kconfig
index 0c9cedc..f4e42dc 100644
--- a/arch/arm/Kconfig
+++ b/arch/arm/Kconfig
@@ -155,6 +155,9 @@ config ARCH_MAY_HAVE_PC_FDC
config ZONE_DMA
bool
+config NEED_DMA_MAP_STATE
+ def_bool y
+
config GENERIC_ISA_DMA
bool
diff --git a/arch/arm/include/asm/pci.h b/arch/arm/include/asm/pci.h
index 226cddd..aea3450 100644
--- a/arch/arm/include/asm/pci.h
+++ b/arch/arm/include/asm/pci.h
@@ -30,16 +30,7 @@ static inline void pcibios_penalize_isa_irq(int irq, int active)
*/
#define PCI_DMA_BUS_IS_PHYS (1)
-/*
- * Whether pci_unmap_{single,page} is a nop depends upon the
- * configuration.
- */
-#define DECLARE_PCI_UNMAP_ADDR(ADDR_NAME) dma_addr_t ADDR_NAME;
-#define DECLARE_PCI_UNMAP_LEN(LEN_NAME) __u32 LEN_NAME;
-#define pci_unmap_addr(PTR, ADDR_NAME) ((PTR)->ADDR_NAME)
-#define pci_unmap_addr_set(PTR, ADDR_NAME, VAL) (((PTR)->ADDR_NAME) = (VAL))
-#define pci_unmap_len(PTR, LEN_NAME) ((PTR)->LEN_NAME)
-#define pci_unmap_len_set(PTR, LEN_NAME, VAL) (((PTR)->LEN_NAME) = (VAL))
+#include <linux/pci-dma.h>
#ifdef CONFIG_PCI
static inline void pci_dma_burst_advice(struct pci_dev *pdev,
--
1.5.6.5
^ permalink raw reply related [flat|nested] 26+ messages in thread
* [PATCH v2 -mm 05/14] frv: use include/linux/pci-dma.h
2010-02-10 1:34 [PATCH v2 -mm 00/14] adds include/linux/pci-dma.h FUJITA Tomonori
` (3 preceding siblings ...)
2010-02-10 1:34 ` [PATCH v2 -mm 04/14] arm: " FUJITA Tomonori
@ 2010-02-10 1:34 ` FUJITA Tomonori
2010-02-10 11:10 ` David Howells
2010-02-10 1:34 ` [PATCH v2 -mm 06/14] ia64: " FUJITA Tomonori
` (8 subsequent siblings)
13 siblings, 1 reply; 26+ messages in thread
From: FUJITA Tomonori @ 2010-02-10 1:34 UTC (permalink / raw)
To: linux-kernel; +Cc: akpm, fujita.tomonori, David Howells
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
Cc: David Howells <dhowells@redhat.com>
---
arch/frv/include/asm/pci.h | 8 +-------
1 files changed, 1 insertions(+), 7 deletions(-)
diff --git a/arch/frv/include/asm/pci.h b/arch/frv/include/asm/pci.h
index 8c7260a..05db569 100644
--- a/arch/frv/include/asm/pci.h
+++ b/arch/frv/include/asm/pci.h
@@ -43,13 +43,7 @@ extern void pci_free_consistent(struct pci_dev *hwdev, size_t size,
/* Return the index of the PCI controller for device PDEV. */
#define pci_controller_num(PDEV) (0)
-/* pci_unmap_{page,single} is a nop so... */
-#define DECLARE_PCI_UNMAP_ADDR(ADDR_NAME)
-#define DECLARE_PCI_UNMAP_LEN(LEN_NAME)
-#define pci_unmap_addr(PTR, ADDR_NAME) (0)
-#define pci_unmap_addr_set(PTR, ADDR_NAME, VAL) do { } while (0)
-#define pci_unmap_len(PTR, LEN_NAME) (0)
-#define pci_unmap_len_set(PTR, LEN_NAME, VAL) do { } while (0)
+#include <linux/pci-dma.h>
#ifdef CONFIG_PCI
static inline void pci_dma_burst_advice(struct pci_dev *pdev,
--
1.5.6.5
^ permalink raw reply related [flat|nested] 26+ messages in thread
* [PATCH v2 -mm 06/14] ia64: use include/linux/pci-dma.h
2010-02-10 1:34 [PATCH v2 -mm 00/14] adds include/linux/pci-dma.h FUJITA Tomonori
` (4 preceding siblings ...)
2010-02-10 1:34 ` [PATCH v2 -mm 05/14] frv: " FUJITA Tomonori
@ 2010-02-10 1:34 ` FUJITA Tomonori
2010-02-10 1:34 ` [PATCH v2 -mm 07/14] mips: " FUJITA Tomonori
` (7 subsequent siblings)
13 siblings, 0 replies; 26+ messages in thread
From: FUJITA Tomonori @ 2010-02-10 1:34 UTC (permalink / raw)
To: linux-kernel; +Cc: akpm, fujita.tomonori, Tony Luck
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
Cc: Tony Luck <tony.luck@intel.com>
---
arch/ia64/Kconfig | 3 +++
arch/ia64/include/asm/pci.h | 14 +-------------
2 files changed, 4 insertions(+), 13 deletions(-)
diff --git a/arch/ia64/Kconfig b/arch/ia64/Kconfig
index 2d7f56a..15feb68 100644
--- a/arch/ia64/Kconfig
+++ b/arch/ia64/Kconfig
@@ -53,6 +53,9 @@ config MMU
bool
default y
+config NEED_DMA_MAP_STATE
+ def_bool y
+
config SWIOTLB
bool
diff --git a/arch/ia64/include/asm/pci.h b/arch/ia64/include/asm/pci.h
index 55281aa..4adf227 100644
--- a/arch/ia64/include/asm/pci.h
+++ b/arch/ia64/include/asm/pci.h
@@ -56,19 +56,7 @@ pcibios_penalize_isa_irq (int irq, int active)
#include <asm-generic/pci-dma-compat.h>
-/* pci_unmap_{single,page} is not a nop, thus... */
-#define DECLARE_PCI_UNMAP_ADDR(ADDR_NAME) \
- dma_addr_t ADDR_NAME;
-#define DECLARE_PCI_UNMAP_LEN(LEN_NAME) \
- __u32 LEN_NAME;
-#define pci_unmap_addr(PTR, ADDR_NAME) \
- ((PTR)->ADDR_NAME)
-#define pci_unmap_addr_set(PTR, ADDR_NAME, VAL) \
- (((PTR)->ADDR_NAME) = (VAL))
-#define pci_unmap_len(PTR, LEN_NAME) \
- ((PTR)->LEN_NAME)
-#define pci_unmap_len_set(PTR, LEN_NAME, VAL) \
- (((PTR)->LEN_NAME) = (VAL))
+#include <linux/pci-dma.h>
#ifdef CONFIG_PCI
static inline void pci_dma_burst_advice(struct pci_dev *pdev,
--
1.5.6.5
^ permalink raw reply related [flat|nested] 26+ messages in thread
* [PATCH v2 -mm 07/14] mips: use include/linux/pci-dma.h
2010-02-10 1:34 [PATCH v2 -mm 00/14] adds include/linux/pci-dma.h FUJITA Tomonori
` (5 preceding siblings ...)
2010-02-10 1:34 ` [PATCH v2 -mm 06/14] ia64: " FUJITA Tomonori
@ 2010-02-10 1:34 ` FUJITA Tomonori
2010-02-10 1:34 ` [PATCH v2 -mm 08/14] parisc: " FUJITA Tomonori
` (6 subsequent siblings)
13 siblings, 0 replies; 26+ messages in thread
From: FUJITA Tomonori @ 2010-02-10 1:34 UTC (permalink / raw)
To: linux-kernel; +Cc: akpm, fujita.tomonori, Ralf Baechle
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
Cc: Ralf Baechle <ralf@linux-mips.org>
---
arch/mips/Kconfig | 4 ++--
arch/mips/include/asm/pci.h | 22 +---------------------
2 files changed, 3 insertions(+), 23 deletions(-)
diff --git a/arch/mips/Kconfig b/arch/mips/Kconfig
index 591ca0c..29e8692 100644
--- a/arch/mips/Kconfig
+++ b/arch/mips/Kconfig
@@ -812,9 +812,9 @@ config DMA_COHERENT
config DMA_NONCOHERENT
bool
- select DMA_NEED_PCI_MAP_STATE
+ select NEED_DMA_MAP_STATE
-config DMA_NEED_PCI_MAP_STATE
+config NEED_DMA_MAP_STATE
bool
config SYS_HAS_EARLY_PRINTK
diff --git a/arch/mips/include/asm/pci.h b/arch/mips/include/asm/pci.h
index 5ebf825..9b196f8 100644
--- a/arch/mips/include/asm/pci.h
+++ b/arch/mips/include/asm/pci.h
@@ -102,27 +102,7 @@ struct pci_dev;
*/
extern unsigned int PCI_DMA_BUS_IS_PHYS;
-#ifdef CONFIG_DMA_NEED_PCI_MAP_STATE
-
-/* pci_unmap_{single,page} is not a nop, thus... */
-#define DECLARE_PCI_UNMAP_ADDR(ADDR_NAME) dma_addr_t ADDR_NAME;
-#define DECLARE_PCI_UNMAP_LEN(LEN_NAME) __u32 LEN_NAME;
-#define pci_unmap_addr(PTR, ADDR_NAME) ((PTR)->ADDR_NAME)
-#define pci_unmap_addr_set(PTR, ADDR_NAME, VAL) (((PTR)->ADDR_NAME) = (VAL))
-#define pci_unmap_len(PTR, LEN_NAME) ((PTR)->LEN_NAME)
-#define pci_unmap_len_set(PTR, LEN_NAME, VAL) (((PTR)->LEN_NAME) = (VAL))
-
-#else /* CONFIG_DMA_NEED_PCI_MAP_STATE */
-
-/* pci_unmap_{page,single} is a nop so... */
-#define DECLARE_PCI_UNMAP_ADDR(ADDR_NAME)
-#define DECLARE_PCI_UNMAP_LEN(LEN_NAME)
-#define pci_unmap_addr(PTR, ADDR_NAME) (0)
-#define pci_unmap_addr_set(PTR, ADDR_NAME, VAL) do { } while (0)
-#define pci_unmap_len(PTR, LEN_NAME) (0)
-#define pci_unmap_len_set(PTR, LEN_NAME, VAL) do { } while (0)
-
-#endif /* CONFIG_DMA_NEED_PCI_MAP_STATE */
+#include <linux/pci-dma.h>
#ifdef CONFIG_PCI
static inline void pci_dma_burst_advice(struct pci_dev *pdev,
--
1.5.6.5
^ permalink raw reply related [flat|nested] 26+ messages in thread
* [PATCH v2 -mm 08/14] parisc: use include/linux/pci-dma.h
2010-02-10 1:34 [PATCH v2 -mm 00/14] adds include/linux/pci-dma.h FUJITA Tomonori
` (6 preceding siblings ...)
2010-02-10 1:34 ` [PATCH v2 -mm 07/14] mips: " FUJITA Tomonori
@ 2010-02-10 1:34 ` FUJITA Tomonori
2010-02-12 15:00 ` Kyle McMartin
2010-02-10 1:34 ` [PATCH v2 -mm 09/14] powerpc: " FUJITA Tomonori
` (5 subsequent siblings)
13 siblings, 1 reply; 26+ messages in thread
From: FUJITA Tomonori @ 2010-02-10 1:34 UTC (permalink / raw)
To: linux-kernel
Cc: akpm, fujita.tomonori, Kyle McMartin, Helge Deller,
James Bottomley
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
Cc: Kyle McMartin <kyle@mcmartin.ca>
Cc: Helge Deller <deller@gmx.de>
Cc: James Bottomley <James.Bottomley@suse.de>
---
arch/parisc/Kconfig | 3 +++
arch/parisc/include/asm/pci.h | 14 +-------------
2 files changed, 4 insertions(+), 13 deletions(-)
diff --git a/arch/parisc/Kconfig b/arch/parisc/Kconfig
index 524d935..efae9fa 100644
--- a/arch/parisc/Kconfig
+++ b/arch/parisc/Kconfig
@@ -96,6 +96,9 @@ config PM
config STACKTRACE_SUPPORT
def_bool y
+config NEED_DMA_MAP_STATE
+ def_bool y
+
config ISA_DMA_API
bool
diff --git a/arch/parisc/include/asm/pci.h b/arch/parisc/include/asm/pci.h
index 64c7aa5..632088d 100644
--- a/arch/parisc/include/asm/pci.h
+++ b/arch/parisc/include/asm/pci.h
@@ -183,19 +183,7 @@ struct pci_bios_ops {
void (*fixup_bus)(struct pci_bus *bus);
};
-/* pci_unmap_{single,page} is not a nop, thus... */
-#define DECLARE_PCI_UNMAP_ADDR(ADDR_NAME) \
- dma_addr_t ADDR_NAME;
-#define DECLARE_PCI_UNMAP_LEN(LEN_NAME) \
- __u32 LEN_NAME;
-#define pci_unmap_addr(PTR, ADDR_NAME) \
- ((PTR)->ADDR_NAME)
-#define pci_unmap_addr_set(PTR, ADDR_NAME, VAL) \
- (((PTR)->ADDR_NAME) = (VAL))
-#define pci_unmap_len(PTR, LEN_NAME) \
- ((PTR)->LEN_NAME)
-#define pci_unmap_len_set(PTR, LEN_NAME, VAL) \
- (((PTR)->LEN_NAME) = (VAL))
+#include <linux/pci-dma.h>
/*
** Stuff declared in arch/parisc/kernel/pci.c
--
1.5.6.5
^ permalink raw reply related [flat|nested] 26+ messages in thread
* [PATCH v2 -mm 09/14] powerpc: use include/linux/pci-dma.h
2010-02-10 1:34 [PATCH v2 -mm 00/14] adds include/linux/pci-dma.h FUJITA Tomonori
` (7 preceding siblings ...)
2010-02-10 1:34 ` [PATCH v2 -mm 08/14] parisc: " FUJITA Tomonori
@ 2010-02-10 1:34 ` FUJITA Tomonori
2010-02-10 1:34 ` [PATCH v2 -mm 10/14] sh: " FUJITA Tomonori
` (4 subsequent siblings)
13 siblings, 0 replies; 26+ messages in thread
From: FUJITA Tomonori @ 2010-02-10 1:34 UTC (permalink / raw)
To: linux-kernel; +Cc: akpm, fujita.tomonori, Benjamin Herrenschmidt
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
---
arch/powerpc/Kconfig | 3 +++
arch/powerpc/include/asm/pci.h | 32 +-------------------------------
2 files changed, 4 insertions(+), 31 deletions(-)
diff --git a/arch/powerpc/Kconfig b/arch/powerpc/Kconfig
index 181dd84..c816a2c 100644
--- a/arch/powerpc/Kconfig
+++ b/arch/powerpc/Kconfig
@@ -645,6 +645,9 @@ config ZONE_DMA
bool
default y
+config NEED_DMA_MAP_STATE
+ def_bool (PPC64 || NOT_COHERENT_CACHE)
+
config GENERIC_ISA_DMA
bool
depends on PPC64 || POWER4 || 6xx && !CPM2
diff --git a/arch/powerpc/include/asm/pci.h b/arch/powerpc/include/asm/pci.h
index b5ea626..4a9991b 100644
--- a/arch/powerpc/include/asm/pci.h
+++ b/arch/powerpc/include/asm/pci.h
@@ -141,37 +141,7 @@ extern int pci_mmap_legacy_page_range(struct pci_bus *bus,
#define HAVE_PCI_LEGACY 1
-#if defined(CONFIG_PPC64) || defined(CONFIG_NOT_COHERENT_CACHE)
-/*
- * For 64-bit kernels, pci_unmap_{single,page} is not a nop.
- * For 32-bit non-coherent kernels, pci_dma_sync_single_for_cpu() and
- * so on are not nops.
- * and thus...
- */
-#define DECLARE_PCI_UNMAP_ADDR(ADDR_NAME) \
- dma_addr_t ADDR_NAME;
-#define DECLARE_PCI_UNMAP_LEN(LEN_NAME) \
- __u32 LEN_NAME;
-#define pci_unmap_addr(PTR, ADDR_NAME) \
- ((PTR)->ADDR_NAME)
-#define pci_unmap_addr_set(PTR, ADDR_NAME, VAL) \
- (((PTR)->ADDR_NAME) = (VAL))
-#define pci_unmap_len(PTR, LEN_NAME) \
- ((PTR)->LEN_NAME)
-#define pci_unmap_len_set(PTR, LEN_NAME, VAL) \
- (((PTR)->LEN_NAME) = (VAL))
-
-#else /* 32-bit && coherent */
-
-/* pci_unmap_{page,single} is a nop so... */
-#define DECLARE_PCI_UNMAP_ADDR(ADDR_NAME)
-#define DECLARE_PCI_UNMAP_LEN(LEN_NAME)
-#define pci_unmap_addr(PTR, ADDR_NAME) (0)
-#define pci_unmap_addr_set(PTR, ADDR_NAME, VAL) do { } while (0)
-#define pci_unmap_len(PTR, LEN_NAME) (0)
-#define pci_unmap_len_set(PTR, LEN_NAME, VAL) do { } while (0)
-
-#endif /* CONFIG_PPC64 || CONFIG_NOT_COHERENT_CACHE */
+#include <linux/pci-dma.h>
#ifdef CONFIG_PPC64
--
1.5.6.5
^ permalink raw reply related [flat|nested] 26+ messages in thread
* [PATCH v2 -mm 10/14] sh: use include/linux/pci-dma.h
2010-02-10 1:34 [PATCH v2 -mm 00/14] adds include/linux/pci-dma.h FUJITA Tomonori
` (8 preceding siblings ...)
2010-02-10 1:34 ` [PATCH v2 -mm 09/14] powerpc: " FUJITA Tomonori
@ 2010-02-10 1:34 ` FUJITA Tomonori
2010-02-10 8:49 ` Paul Mundt
2010-02-10 1:34 ` [PATCH v2 -mm 11/14] sparc: " FUJITA Tomonori
` (3 subsequent siblings)
13 siblings, 1 reply; 26+ messages in thread
From: FUJITA Tomonori @ 2010-02-10 1:34 UTC (permalink / raw)
To: linux-kernel; +Cc: akpm, fujita.tomonori, Paul Mundt
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
Cc: Paul Mundt <lethal@linux-sh.org>
---
arch/sh/Kconfig | 3 +++
arch/sh/include/asm/pci.h | 19 +------------------
2 files changed, 4 insertions(+), 18 deletions(-)
diff --git a/arch/sh/Kconfig b/arch/sh/Kconfig
index 05cef50..8d90564 100644
--- a/arch/sh/Kconfig
+++ b/arch/sh/Kconfig
@@ -183,6 +183,9 @@ config DMA_COHERENT
config DMA_NONCOHERENT
def_bool !DMA_COHERENT
+config NEED_DMA_MAP_STATE
+ def_bool DMA_NONCOHERENT
+
source "init/Kconfig"
source "kernel/Kconfig.freezer"
diff --git a/arch/sh/include/asm/pci.h b/arch/sh/include/asm/pci.h
index 1042f7f..991c2a4 100644
--- a/arch/sh/include/asm/pci.h
+++ b/arch/sh/include/asm/pci.h
@@ -83,24 +83,7 @@ static inline void pcibios_penalize_isa_irq(int irq, int active)
*/
#define PCI_DMA_BUS_IS_PHYS (dma_ops->is_phys)
-/* pci_unmap_{single,page} being a nop depends upon the
- * configuration.
- */
-#ifdef CONFIG_DMA_NONCOHERENT
-#define DECLARE_PCI_UNMAP_ADDR(ADDR_NAME) dma_addr_t ADDR_NAME;
-#define DECLARE_PCI_UNMAP_LEN(LEN_NAME) __u32 LEN_NAME;
-#define pci_unmap_addr(PTR, ADDR_NAME) ((PTR)->ADDR_NAME)
-#define pci_unmap_addr_set(PTR, ADDR_NAME, VAL) (((PTR)->ADDR_NAME) = (VAL))
-#define pci_unmap_len(PTR, LEN_NAME) ((PTR)->LEN_NAME)
-#define pci_unmap_len_set(PTR, LEN_NAME, VAL) (((PTR)->LEN_NAME) = (VAL))
-#else
-#define DECLARE_PCI_UNMAP_ADDR(ADDR_NAME)
-#define DECLARE_PCI_UNMAP_LEN(LEN_NAME)
-#define pci_unmap_addr(PTR, ADDR_NAME) (0)
-#define pci_unmap_addr_set(PTR, ADDR_NAME, VAL) do { } while (0)
-#define pci_unmap_len(PTR, LEN_NAME) (0)
-#define pci_unmap_len_set(PTR, LEN_NAME, VAL) do { } while (0)
-#endif
+#include <linux/pci-dma.h>
#ifdef CONFIG_PCI
/*
--
1.5.6.5
^ permalink raw reply related [flat|nested] 26+ messages in thread
* [PATCH v2 -mm 11/14] sparc: use include/linux/pci-dma.h
2010-02-10 1:34 [PATCH v2 -mm 00/14] adds include/linux/pci-dma.h FUJITA Tomonori
` (9 preceding siblings ...)
2010-02-10 1:34 ` [PATCH v2 -mm 10/14] sh: " FUJITA Tomonori
@ 2010-02-10 1:34 ` FUJITA Tomonori
2010-02-10 6:55 ` David Miller
2010-02-10 1:34 ` [PATCH v2 -mm 12/14] xtensa: " FUJITA Tomonori
` (2 subsequent siblings)
13 siblings, 1 reply; 26+ messages in thread
From: FUJITA Tomonori @ 2010-02-10 1:34 UTC (permalink / raw)
To: linux-kernel; +Cc: akpm, fujita.tomonori, David S. Miller
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
Cc: David S. Miller <davem@davemloft.net>
---
arch/sparc/Kconfig | 3 +++
arch/sparc/include/asm/pci.h | 2 ++
arch/sparc/include/asm/pci_32.h | 14 --------------
arch/sparc/include/asm/pci_64.h | 14 --------------
4 files changed, 5 insertions(+), 28 deletions(-)
diff --git a/arch/sparc/Kconfig b/arch/sparc/Kconfig
index 4097f6a..6db5136 100644
--- a/arch/sparc/Kconfig
+++ b/arch/sparc/Kconfig
@@ -127,6 +127,9 @@ config ZONE_DMA
bool
default y if SPARC32
+config NEED_DMA_MAP_STATE
+ def_bool y
+
config GENERIC_ISA_DMA
bool
default y if SPARC32
diff --git a/arch/sparc/include/asm/pci.h b/arch/sparc/include/asm/pci.h
index d9c031f..5ce773e 100644
--- a/arch/sparc/include/asm/pci.h
+++ b/arch/sparc/include/asm/pci.h
@@ -6,6 +6,8 @@
#include <asm/pci_32.h>
#endif
+#include <linux/pci-dma.h>
+
#include <asm-generic/pci-dma-compat.h>
#endif
diff --git a/arch/sparc/include/asm/pci_32.h b/arch/sparc/include/asm/pci_32.h
index e769f66..332ac9a 100644
--- a/arch/sparc/include/asm/pci_32.h
+++ b/arch/sparc/include/asm/pci_32.h
@@ -32,20 +32,6 @@ static inline void pcibios_penalize_isa_irq(int irq, int active)
struct pci_dev;
-/* pci_unmap_{single,page} is not a nop, thus... */
-#define DECLARE_PCI_UNMAP_ADDR(ADDR_NAME) \
- dma_addr_t ADDR_NAME;
-#define DECLARE_PCI_UNMAP_LEN(LEN_NAME) \
- __u32 LEN_NAME;
-#define pci_unmap_addr(PTR, ADDR_NAME) \
- ((PTR)->ADDR_NAME)
-#define pci_unmap_addr_set(PTR, ADDR_NAME, VAL) \
- (((PTR)->ADDR_NAME) = (VAL))
-#define pci_unmap_len(PTR, LEN_NAME) \
- ((PTR)->LEN_NAME)
-#define pci_unmap_len_set(PTR, LEN_NAME, VAL) \
- (((PTR)->LEN_NAME) = (VAL))
-
#ifdef CONFIG_PCI
static inline void pci_dma_burst_advice(struct pci_dev *pdev,
enum pci_dma_burst_strategy *strat,
diff --git a/arch/sparc/include/asm/pci_64.h b/arch/sparc/include/asm/pci_64.h
index b0576df..5312782 100644
--- a/arch/sparc/include/asm/pci_64.h
+++ b/arch/sparc/include/asm/pci_64.h
@@ -32,20 +32,6 @@ static inline void pcibios_penalize_isa_irq(int irq, int active)
*/
#define PCI_DMA_BUS_IS_PHYS (0)
-/* pci_unmap_{single,page} is not a nop, thus... */
-#define DECLARE_PCI_UNMAP_ADDR(ADDR_NAME) \
- dma_addr_t ADDR_NAME;
-#define DECLARE_PCI_UNMAP_LEN(LEN_NAME) \
- __u32 LEN_NAME;
-#define pci_unmap_addr(PTR, ADDR_NAME) \
- ((PTR)->ADDR_NAME)
-#define pci_unmap_addr_set(PTR, ADDR_NAME, VAL) \
- (((PTR)->ADDR_NAME) = (VAL))
-#define pci_unmap_len(PTR, LEN_NAME) \
- ((PTR)->LEN_NAME)
-#define pci_unmap_len_set(PTR, LEN_NAME, VAL) \
- (((PTR)->LEN_NAME) = (VAL))
-
/* PCI IOMMU mapping bypass support. */
/* PCI 64-bit addressing works for all slots on all controller
--
1.5.6.5
^ permalink raw reply related [flat|nested] 26+ messages in thread
* [PATCH v2 -mm 12/14] xtensa: use include/linux/pci-dma.h
2010-02-10 1:34 [PATCH v2 -mm 00/14] adds include/linux/pci-dma.h FUJITA Tomonori
` (10 preceding siblings ...)
2010-02-10 1:34 ` [PATCH v2 -mm 11/14] sparc: " FUJITA Tomonori
@ 2010-02-10 1:34 ` FUJITA Tomonori
2010-02-10 1:34 ` [PATCH v2 -mm 13/14] cris: " FUJITA Tomonori
2010-02-10 1:34 ` [PATCH v2 -mm 14/14] add linux/pci-dma.h to linux/pci.h FUJITA Tomonori
13 siblings, 0 replies; 26+ messages in thread
From: FUJITA Tomonori @ 2010-02-10 1:34 UTC (permalink / raw)
To: linux-kernel; +Cc: akpm, fujita.tomonori, Chris Zankel
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
Cc: Chris Zankel <chris@zankel.net>
---
arch/xtensa/include/asm/pci.h | 8 +-------
1 files changed, 1 insertions(+), 7 deletions(-)
diff --git a/arch/xtensa/include/asm/pci.h b/arch/xtensa/include/asm/pci.h
index 66410ac..f3f0cf3 100644
--- a/arch/xtensa/include/asm/pci.h
+++ b/arch/xtensa/include/asm/pci.h
@@ -56,13 +56,7 @@ struct pci_dev;
#define PCI_DMA_BUS_IS_PHYS (1)
-/* pci_unmap_{page,single} is a no-op, so */
-#define DECLARE_PCI_UNMAP_ADDR(ADDR_NAME)
-#define DECLARE_PCI_UNMAP_LEN(LEN_NAME)
-#define pci_unmap_addr(PTR, ADDR_NAME) (0)
-#define pci_unmap_addr_set(PTR, ADDR_NAME, VAL) do { } while (0)
-#define pci_ubnmap_len(PTR, LEN_NAME) (0)
-#define pci_unmap_len_set(PTR, LEN_NAME, VAL) do { } while (0)
+#include <linux/pci-dma.h>
/* Map a range of PCI memory or I/O space for a device into user space */
int pci_mmap_page_range(struct pci_dev *pdev, struct vm_area_struct *vma,
--
1.5.6.5
^ permalink raw reply related [flat|nested] 26+ messages in thread
* [PATCH v2 -mm 13/14] cris: use include/linux/pci-dma.h
2010-02-10 1:34 [PATCH v2 -mm 00/14] adds include/linux/pci-dma.h FUJITA Tomonori
` (11 preceding siblings ...)
2010-02-10 1:34 ` [PATCH v2 -mm 12/14] xtensa: " FUJITA Tomonori
@ 2010-02-10 1:34 ` FUJITA Tomonori
2010-02-10 6:10 ` Mikael Starvik
2010-02-10 1:34 ` [PATCH v2 -mm 14/14] add linux/pci-dma.h to linux/pci.h FUJITA Tomonori
13 siblings, 1 reply; 26+ messages in thread
From: FUJITA Tomonori @ 2010-02-10 1:34 UTC (permalink / raw)
To: linux-kernel; +Cc: akpm, fujita.tomonori, Mikael Starvik
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
Cc: Mikael Starvik <starvik@axis.com>
---
arch/cris/include/asm/pci.h | 8 +-------
1 files changed, 1 insertions(+), 7 deletions(-)
diff --git a/arch/cris/include/asm/pci.h b/arch/cris/include/asm/pci.h
index 730ce40..43cfa0c 100644
--- a/arch/cris/include/asm/pci.h
+++ b/arch/cris/include/asm/pci.h
@@ -44,13 +44,7 @@ struct pci_dev;
*/
#define PCI_DMA_BUS_IS_PHYS (1)
-/* pci_unmap_{page,single} is a nop so... */
-#define DECLARE_PCI_UNMAP_ADDR(ADDR_NAME)
-#define DECLARE_PCI_UNMAP_LEN(LEN_NAME)
-#define pci_unmap_addr(PTR, ADDR_NAME) (0)
-#define pci_unmap_addr_set(PTR, ADDR_NAME, VAL) do { } while (0)
-#define pci_unmap_len(PTR, LEN_NAME) (0)
-#define pci_unmap_len_set(PTR, LEN_NAME, VAL) do { } while (0)
+#include <linux/pci-dma.h>
#define HAVE_PCI_MMAP
extern int pci_mmap_page_range(struct pci_dev *dev, struct vm_area_struct *vma,
--
1.5.6.5
^ permalink raw reply related [flat|nested] 26+ messages in thread
* [PATCH v2 -mm 14/14] add linux/pci-dma.h to linux/pci.h
2010-02-10 1:34 [PATCH v2 -mm 00/14] adds include/linux/pci-dma.h FUJITA Tomonori
` (12 preceding siblings ...)
2010-02-10 1:34 ` [PATCH v2 -mm 13/14] cris: " FUJITA Tomonori
@ 2010-02-10 1:34 ` FUJITA Tomonori
2010-02-10 6:58 ` Arnd Bergmann
13 siblings, 1 reply; 26+ messages in thread
From: FUJITA Tomonori @ 2010-02-10 1:34 UTC (permalink / raw)
To: linux-kernel; +Cc: akpm, fujita.tomonori, Arnd Bergmann
All the architectures properly set NEED_DMA_MAP_STATE now so we can
safely add linux/pci-dma.h to linux/pci.h and remove the
linux/pci-dma.h inclusion in arch's asm/pci.h
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
Cc: Arnd Bergmann <arnd@arndb.de>
---
arch/alpha/include/asm/pci.h | 2 --
arch/arm/include/asm/pci.h | 2 --
arch/cris/include/asm/pci.h | 2 --
arch/frv/include/asm/pci.h | 2 --
arch/ia64/include/asm/pci.h | 2 --
arch/mips/include/asm/pci.h | 2 --
arch/parisc/include/asm/pci.h | 2 --
arch/powerpc/include/asm/pci.h | 2 --
arch/sh/include/asm/pci.h | 2 --
arch/sparc/include/asm/pci.h | 2 --
arch/x86/include/asm/pci.h | 2 --
arch/xtensa/include/asm/pci.h | 2 --
include/linux/pci.h | 1 +
13 files changed, 1 insertions(+), 24 deletions(-)
diff --git a/arch/alpha/include/asm/pci.h b/arch/alpha/include/asm/pci.h
index 4765946..e1846ba 100644
--- a/arch/alpha/include/asm/pci.h
+++ b/arch/alpha/include/asm/pci.h
@@ -119,8 +119,6 @@ pci_dma_mapping_error(struct pci_dev *pdev, dma_addr_t dma_addr)
extern void pci_unmap_single(struct pci_dev *, dma_addr_t, size_t, int);
extern void pci_unmap_page(struct pci_dev *, dma_addr_t, size_t, int);
-#include <linux/pci-dma.h>
-
/* Map a set of buffers described by scatterlist in streaming mode for
PCI DMA. This is the scatter-gather version of the above
pci_map_single interface. Here the scatter gather list elements
diff --git a/arch/arm/include/asm/pci.h b/arch/arm/include/asm/pci.h
index aea3450..4798011 100644
--- a/arch/arm/include/asm/pci.h
+++ b/arch/arm/include/asm/pci.h
@@ -30,8 +30,6 @@ static inline void pcibios_penalize_isa_irq(int irq, int active)
*/
#define PCI_DMA_BUS_IS_PHYS (1)
-#include <linux/pci-dma.h>
-
#ifdef CONFIG_PCI
static inline void pci_dma_burst_advice(struct pci_dev *pdev,
enum pci_dma_burst_strategy *strat,
diff --git a/arch/cris/include/asm/pci.h b/arch/cris/include/asm/pci.h
index 43cfa0c..9f1cd56 100644
--- a/arch/cris/include/asm/pci.h
+++ b/arch/cris/include/asm/pci.h
@@ -44,8 +44,6 @@ struct pci_dev;
*/
#define PCI_DMA_BUS_IS_PHYS (1)
-#include <linux/pci-dma.h>
-
#define HAVE_PCI_MMAP
extern int pci_mmap_page_range(struct pci_dev *dev, struct vm_area_struct *vma,
enum pci_mmap_state mmap_state, int write_combine);
diff --git a/arch/frv/include/asm/pci.h b/arch/frv/include/asm/pci.h
index 05db569..0d59979 100644
--- a/arch/frv/include/asm/pci.h
+++ b/arch/frv/include/asm/pci.h
@@ -43,8 +43,6 @@ extern void pci_free_consistent(struct pci_dev *hwdev, size_t size,
/* Return the index of the PCI controller for device PDEV. */
#define pci_controller_num(PDEV) (0)
-#include <linux/pci-dma.h>
-
#ifdef CONFIG_PCI
static inline void pci_dma_burst_advice(struct pci_dev *pdev,
enum pci_dma_burst_strategy *strat,
diff --git a/arch/ia64/include/asm/pci.h b/arch/ia64/include/asm/pci.h
index 4adf227..73b5f78 100644
--- a/arch/ia64/include/asm/pci.h
+++ b/arch/ia64/include/asm/pci.h
@@ -56,8 +56,6 @@ pcibios_penalize_isa_irq (int irq, int active)
#include <asm-generic/pci-dma-compat.h>
-#include <linux/pci-dma.h>
-
#ifdef CONFIG_PCI
static inline void pci_dma_burst_advice(struct pci_dev *pdev,
enum pci_dma_burst_strategy *strat,
diff --git a/arch/mips/include/asm/pci.h b/arch/mips/include/asm/pci.h
index 9b196f8..3beea14 100644
--- a/arch/mips/include/asm/pci.h
+++ b/arch/mips/include/asm/pci.h
@@ -102,8 +102,6 @@ struct pci_dev;
*/
extern unsigned int PCI_DMA_BUS_IS_PHYS;
-#include <linux/pci-dma.h>
-
#ifdef CONFIG_PCI
static inline void pci_dma_burst_advice(struct pci_dev *pdev,
enum pci_dma_burst_strategy *strat,
diff --git a/arch/parisc/include/asm/pci.h b/arch/parisc/include/asm/pci.h
index 632088d..2242a5c 100644
--- a/arch/parisc/include/asm/pci.h
+++ b/arch/parisc/include/asm/pci.h
@@ -183,8 +183,6 @@ struct pci_bios_ops {
void (*fixup_bus)(struct pci_bus *bus);
};
-#include <linux/pci-dma.h>
-
/*
** Stuff declared in arch/parisc/kernel/pci.c
*/
diff --git a/arch/powerpc/include/asm/pci.h b/arch/powerpc/include/asm/pci.h
index 4a9991b..a20a9ad 100644
--- a/arch/powerpc/include/asm/pci.h
+++ b/arch/powerpc/include/asm/pci.h
@@ -141,8 +141,6 @@ extern int pci_mmap_legacy_page_range(struct pci_bus *bus,
#define HAVE_PCI_LEGACY 1
-#include <linux/pci-dma.h>
-
#ifdef CONFIG_PPC64
/* The PCI address space does not equal the physical memory address
diff --git a/arch/sh/include/asm/pci.h b/arch/sh/include/asm/pci.h
index 991c2a4..8bd952f 100644
--- a/arch/sh/include/asm/pci.h
+++ b/arch/sh/include/asm/pci.h
@@ -83,8 +83,6 @@ static inline void pcibios_penalize_isa_irq(int irq, int active)
*/
#define PCI_DMA_BUS_IS_PHYS (dma_ops->is_phys)
-#include <linux/pci-dma.h>
-
#ifdef CONFIG_PCI
/*
* None of the SH PCI controllers support MWI, it is always treated as a
diff --git a/arch/sparc/include/asm/pci.h b/arch/sparc/include/asm/pci.h
index 5ce773e..d9c031f 100644
--- a/arch/sparc/include/asm/pci.h
+++ b/arch/sparc/include/asm/pci.h
@@ -6,8 +6,6 @@
#include <asm/pci_32.h>
#endif
-#include <linux/pci-dma.h>
-
#include <asm-generic/pci-dma-compat.h>
#endif
diff --git a/arch/x86/include/asm/pci.h b/arch/x86/include/asm/pci.h
index d9bef0a..e1aa5a7 100644
--- a/arch/x86/include/asm/pci.h
+++ b/arch/x86/include/asm/pci.h
@@ -99,8 +99,6 @@ extern void pci_iommu_alloc(void);
/* implement the pci_ DMA API in terms of the generic device dma_ one */
#include <asm-generic/pci-dma-compat.h>
-#include <linux/pci-dma.h>
-
/* generic pci stuff */
#include <asm-generic/pci.h>
#define PCIBIOS_MAX_MEM_32 0xffffffff
diff --git a/arch/xtensa/include/asm/pci.h b/arch/xtensa/include/asm/pci.h
index f3f0cf3..4609b0f 100644
--- a/arch/xtensa/include/asm/pci.h
+++ b/arch/xtensa/include/asm/pci.h
@@ -56,8 +56,6 @@ struct pci_dev;
#define PCI_DMA_BUS_IS_PHYS (1)
-#include <linux/pci-dma.h>
-
/* Map a range of PCI memory or I/O space for a device into user space */
int pci_mmap_page_range(struct pci_dev *pdev, struct vm_area_struct *vma,
enum pci_mmap_state mmap_state, int write_combine);
diff --git a/include/linux/pci.h b/include/linux/pci.h
index 4a02d84..67e2158 100644
--- a/include/linux/pci.h
+++ b/include/linux/pci.h
@@ -872,6 +872,7 @@ int pci_set_vga_state(struct pci_dev *pdev, bool decode,
unsigned int command_bits, bool change_bridge);
/* kmem_cache style wrapper around pci_alloc_consistent() */
+#include <linux/pci-dma.h>
#include <linux/dmapool.h>
#define pci_pool dma_pool
--
1.5.6.5
^ permalink raw reply related [flat|nested] 26+ messages in thread
* RE: [PATCH v2 -mm 13/14] cris: use include/linux/pci-dma.h
2010-02-10 1:34 ` [PATCH v2 -mm 13/14] cris: " FUJITA Tomonori
@ 2010-02-10 6:10 ` Mikael Starvik
0 siblings, 0 replies; 26+ messages in thread
From: Mikael Starvik @ 2010-02-10 6:10 UTC (permalink / raw)
To: FUJITA Tomonori, linux-kernel@vger.kernel.org; +Cc: akpm@linux-foundation.org
Sure, that is ok.
Signed-off-by: Mikael Starvik <starvik@axis.com>
-----Original Message-----
From: FUJITA Tomonori [mailto:fujita.tomonori@lab.ntt.co.jp]
Sent: den 10 februari 2010 02:35
To: linux-kernel@vger.kernel.org
Cc: akpm@linux-foundation.org; fujita.tomonori@lab.ntt.co.jp; Mikael Starvik
Subject: [PATCH v2 -mm 13/14] cris: use include/linux/pci-dma.h
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
Cc: Mikael Starvik <starvik@axis.com>
---
arch/cris/include/asm/pci.h | 8 +-------
1 files changed, 1 insertions(+), 7 deletions(-)
diff --git a/arch/cris/include/asm/pci.h b/arch/cris/include/asm/pci.h
index 730ce40..43cfa0c 100644
--- a/arch/cris/include/asm/pci.h
+++ b/arch/cris/include/asm/pci.h
@@ -44,13 +44,7 @@ struct pci_dev;
*/
#define PCI_DMA_BUS_IS_PHYS (1)
-/* pci_unmap_{page,single} is a nop so... */
-#define DECLARE_PCI_UNMAP_ADDR(ADDR_NAME)
-#define DECLARE_PCI_UNMAP_LEN(LEN_NAME)
-#define pci_unmap_addr(PTR, ADDR_NAME) (0)
-#define pci_unmap_addr_set(PTR, ADDR_NAME, VAL) do { } while (0)
-#define pci_unmap_len(PTR, LEN_NAME) (0)
-#define pci_unmap_len_set(PTR, LEN_NAME, VAL) do { } while (0)
+#include <linux/pci-dma.h>
#define HAVE_PCI_MMAP
extern int pci_mmap_page_range(struct pci_dev *dev, struct vm_area_struct *vma,
--
1.5.6.5
^ permalink raw reply related [flat|nested] 26+ messages in thread
* Re: [PATCH v2 -mm 11/14] sparc: use include/linux/pci-dma.h
2010-02-10 1:34 ` [PATCH v2 -mm 11/14] sparc: " FUJITA Tomonori
@ 2010-02-10 6:55 ` David Miller
0 siblings, 0 replies; 26+ messages in thread
From: David Miller @ 2010-02-10 6:55 UTC (permalink / raw)
To: fujita.tomonori; +Cc: linux-kernel, akpm
From: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
Date: Wed, 10 Feb 2010 10:34:44 +0900
> Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
Acked-by: David S. Miller <davem@davemloft.net>
^ permalink raw reply [flat|nested] 26+ messages in thread
* Re: [PATCH v2 -mm 01/14] adds include/linux/pci-dma.h
2010-02-10 1:34 ` [PATCH v2 -mm 01/14] " FUJITA Tomonori
@ 2010-02-10 6:57 ` Arnd Bergmann
2010-02-12 14:51 ` Russell King - ARM Linux
2010-02-12 15:04 ` David Howells
2 siblings, 0 replies; 26+ messages in thread
From: Arnd Bergmann @ 2010-02-10 6:57 UTC (permalink / raw)
To: FUJITA Tomonori
Cc: linux-kernel, akpm, x86, Richard Henderson, Ivan Kokshaysky,
Matt Turner, Russell King, David Howells, Tony Luck, Ralf Baechle,
Kyle McMartin, Helge Deller, James Bottomley,
Benjamin Herrenschmidt, Paul Mundt, David S. Miller, Chris Zankel
On Wednesday 10 February 2010, FUJITA Tomonori wrote:
> This patch adds include/linux/pci-dma.h that defines the pci_unmap
> state API:
>
> DECLARE_PCI_UNMAP_ADDR(ADDR_NAME)
> DECLARE_PCI_UNMAP_LEN(LEN_NAME)
> pci_unmap_addr(PTR, ADDR_NAME)
> pci_unmap_addr_set(PTR, ADDR_NAME, VAL)
> pci_unmap_len(PTR, LEN_NAME)
> pci_unmap_len_set(PTR, LEN_NAME, VAL)
> ...
>
> Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
Acked-by: Arnd Bergmann <arnd@arndb.de>
^ permalink raw reply [flat|nested] 26+ messages in thread
* Re: [PATCH v2 -mm 14/14] add linux/pci-dma.h to linux/pci.h
2010-02-10 1:34 ` [PATCH v2 -mm 14/14] add linux/pci-dma.h to linux/pci.h FUJITA Tomonori
@ 2010-02-10 6:58 ` Arnd Bergmann
0 siblings, 0 replies; 26+ messages in thread
From: Arnd Bergmann @ 2010-02-10 6:58 UTC (permalink / raw)
To: FUJITA Tomonori; +Cc: linux-kernel, akpm
On Wednesday 10 February 2010, FUJITA Tomonori wrote:
> All the architectures properly set NEED_DMA_MAP_STATE now so we can
> safely add linux/pci-dma.h to linux/pci.h and remove the
> linux/pci-dma.h inclusion in arch's asm/pci.h
>
> Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
> Cc: Arnd Bergmann <arnd@arndb.de>
Acked-by: Arnd Bergmann <arnd@arndb.de>
^ permalink raw reply [flat|nested] 26+ messages in thread
* Re: [PATCH v2 -mm 10/14] sh: use include/linux/pci-dma.h
2010-02-10 1:34 ` [PATCH v2 -mm 10/14] sh: " FUJITA Tomonori
@ 2010-02-10 8:49 ` Paul Mundt
0 siblings, 0 replies; 26+ messages in thread
From: Paul Mundt @ 2010-02-10 8:49 UTC (permalink / raw)
To: FUJITA Tomonori; +Cc: linux-kernel, akpm
On Wed, Feb 10, 2010 at 10:34:43AM +0900, FUJITA Tomonori wrote:
> Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
> Cc: Paul Mundt <lethal@linux-sh.org>
> ---
> arch/sh/Kconfig | 3 +++
> arch/sh/include/asm/pci.h | 19 +------------------
> 2 files changed, 4 insertions(+), 18 deletions(-)
>
Looks ok to me.
Acked-by: Paul Mundt <lethal@linux-sh.org>
^ permalink raw reply [flat|nested] 26+ messages in thread
* Re: [PATCH v2 -mm 05/14] frv: use include/linux/pci-dma.h
2010-02-10 1:34 ` [PATCH v2 -mm 05/14] frv: " FUJITA Tomonori
@ 2010-02-10 11:10 ` David Howells
0 siblings, 0 replies; 26+ messages in thread
From: David Howells @ 2010-02-10 11:10 UTC (permalink / raw)
To: FUJITA Tomonori; +Cc: dhowells, linux-kernel, akpm
FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp> wrote:
> Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
Acked-by: David Howells <dhowells@redhat.com>
^ permalink raw reply [flat|nested] 26+ messages in thread
* Re: [PATCH v2 -mm 03/14] alpha: use include/linux/pci-dma.h
2010-02-10 1:34 ` [PATCH v2 -mm 03/14] alpha: " FUJITA Tomonori
@ 2010-02-11 18:49 ` Matt Turner
0 siblings, 0 replies; 26+ messages in thread
From: Matt Turner @ 2010-02-11 18:49 UTC (permalink / raw)
To: FUJITA Tomonori; +Cc: linux-kernel, akpm, Richard Henderson, Ivan Kokshaysky
On Tue, Feb 9, 2010 at 8:34 PM, FUJITA Tomonori
<fujita.tomonori@lab.ntt.co.jp> wrote:
> Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
> Cc: Richard Henderson <rth@twiddle.net>
> Cc: Ivan Kokshaysky <ink@jurassic.park.msu.ru>
> Cc: Matt Turner <mattst88@gmail.com>
> ---
> arch/alpha/Kconfig | 3 +++
> arch/alpha/include/asm/pci.h | 14 +-------------
> 2 files changed, 4 insertions(+), 13 deletions(-)
>
> diff --git a/arch/alpha/Kconfig b/arch/alpha/Kconfig
> index bd7261e..759f49d 100644
> --- a/arch/alpha/Kconfig
> +++ b/arch/alpha/Kconfig
> @@ -58,6 +58,9 @@ config ZONE_DMA
> bool
> default y
>
> +config NEED_DMA_MAP_STATE
> + def_bool y
> +
> config GENERIC_ISA_DMA
> bool
> default y
> diff --git a/arch/alpha/include/asm/pci.h b/arch/alpha/include/asm/pci.h
> index dd8dcab..4765946 100644
> --- a/arch/alpha/include/asm/pci.h
> +++ b/arch/alpha/include/asm/pci.h
> @@ -119,19 +119,7 @@ pci_dma_mapping_error(struct pci_dev *pdev, dma_addr_t dma_addr)
> extern void pci_unmap_single(struct pci_dev *, dma_addr_t, size_t, int);
> extern void pci_unmap_page(struct pci_dev *, dma_addr_t, size_t, int);
>
> -/* pci_unmap_{single,page} is not a nop, thus... */
> -#define DECLARE_PCI_UNMAP_ADDR(ADDR_NAME) \
> - dma_addr_t ADDR_NAME;
> -#define DECLARE_PCI_UNMAP_LEN(LEN_NAME) \
> - __u32 LEN_NAME;
> -#define pci_unmap_addr(PTR, ADDR_NAME) \
> - ((PTR)->ADDR_NAME)
> -#define pci_unmap_addr_set(PTR, ADDR_NAME, VAL) \
> - (((PTR)->ADDR_NAME) = (VAL))
> -#define pci_unmap_len(PTR, LEN_NAME) \
> - ((PTR)->LEN_NAME)
> -#define pci_unmap_len_set(PTR, LEN_NAME, VAL) \
> - (((PTR)->LEN_NAME) = (VAL))
> +#include <linux/pci-dma.h>
>
> /* Map a set of buffers described by scatterlist in streaming mode for
> PCI DMA. This is the scatter-gather version of the above
> --
> 1.5.6.5
>
>
Acked-by: Matt Turner <mattst88@gmail.com>
^ permalink raw reply [flat|nested] 26+ messages in thread
* Re: [PATCH v2 -mm 01/14] adds include/linux/pci-dma.h
2010-02-10 1:34 ` [PATCH v2 -mm 01/14] " FUJITA Tomonori
2010-02-10 6:57 ` Arnd Bergmann
@ 2010-02-12 14:51 ` Russell King - ARM Linux
2010-02-12 15:04 ` David Howells
2 siblings, 0 replies; 26+ messages in thread
From: Russell King - ARM Linux @ 2010-02-12 14:51 UTC (permalink / raw)
To: FUJITA Tomonori
Cc: linux-kernel, akpm, x86, Richard Henderson, Ivan Kokshaysky,
Matt Turner, David Howells, Tony Luck, Ralf Baechle,
Kyle McMartin, Helge Deller, James Bottomley,
Benjamin Herrenschmidt, Paul Mundt, David S. Miller, Chris Zankel,
Arnd Bergmann
On Wed, Feb 10, 2010 at 10:34:34AM +0900, FUJITA Tomonori wrote:
> This patch adds include/linux/pci-dma.h that defines the pci_unmap
> state API:
>
> DECLARE_PCI_UNMAP_ADDR(ADDR_NAME)
> DECLARE_PCI_UNMAP_LEN(LEN_NAME)
> pci_unmap_addr(PTR, ADDR_NAME)
> pci_unmap_addr_set(PTR, ADDR_NAME, VAL)
> pci_unmap_len(PTR, LEN_NAME)
> pci_unmap_len_set(PTR, LEN_NAME, VAL)
>
> This enables us to remove lots of the duplication in architecture
> implementations since there are only two ways to define the API.
>
> If architectures define CONFIG_NEED_DMA_MAP_STATE, they get the real
> definition of pci_unmap state API. If not, they get the noop
> definition.
>
> In the long term, it's better to replace the API with the generic
> device model API such as DECLARE_DMA_UNMAP_ADDR. We can map the API to
> the generic one (like dma-mapping-compat.h does). This patch also
> makes the migration process easier. We can remove this file after the
> migration.
>
> It might be simpler to add the API to include/linux/pci.h but looks
> it's already too large. We'll remove pci-dma.h after finishing moving
> to the generic device model. So I put the API to a separate file.
>
> Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
Acked-by: Russell King <rmk+kernel@arm.linux.org.uk>
^ permalink raw reply [flat|nested] 26+ messages in thread
* Re: [PATCH v2 -mm 04/14] arm: use include/linux/pci-dma.h
2010-02-10 1:34 ` [PATCH v2 -mm 04/14] arm: " FUJITA Tomonori
@ 2010-02-12 14:51 ` Russell King - ARM Linux
0 siblings, 0 replies; 26+ messages in thread
From: Russell King - ARM Linux @ 2010-02-12 14:51 UTC (permalink / raw)
To: FUJITA Tomonori; +Cc: linux-kernel, akpm
On Wed, Feb 10, 2010 at 10:34:37AM +0900, FUJITA Tomonori wrote:
> Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
Acked-by: Russell King <rmk+kernel@arm.linux.org.uk>
^ permalink raw reply [flat|nested] 26+ messages in thread
* Re: [PATCH v2 -mm 08/14] parisc: use include/linux/pci-dma.h
2010-02-10 1:34 ` [PATCH v2 -mm 08/14] parisc: " FUJITA Tomonori
@ 2010-02-12 15:00 ` Kyle McMartin
0 siblings, 0 replies; 26+ messages in thread
From: Kyle McMartin @ 2010-02-12 15:00 UTC (permalink / raw)
To: FUJITA Tomonori
Cc: linux-kernel, akpm, Kyle McMartin, Helge Deller, James Bottomley
On Wed, Feb 10, 2010 at 10:34:41AM +0900, FUJITA Tomonori wrote:
> Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
> Cc: Kyle McMartin <kyle@mcmartin.ca>
> Cc: Helge Deller <deller@gmx.de>
> Cc: James Bottomley <James.Bottomley@suse.de>
Acked-by: Kyle McMartin <kyle@mcmartin.ca>
^ permalink raw reply [flat|nested] 26+ messages in thread
* Re: [PATCH v2 -mm 01/14] adds include/linux/pci-dma.h
2010-02-10 1:34 ` [PATCH v2 -mm 01/14] " FUJITA Tomonori
2010-02-10 6:57 ` Arnd Bergmann
2010-02-12 14:51 ` Russell King - ARM Linux
@ 2010-02-12 15:04 ` David Howells
2 siblings, 0 replies; 26+ messages in thread
From: David Howells @ 2010-02-12 15:04 UTC (permalink / raw)
To: FUJITA Tomonori
Cc: dhowells, linux-kernel, akpm, x86, Richard Henderson,
Ivan Kokshaysky, Matt Turner, Russell King, Tony Luck,
Ralf Baechle, Kyle McMartin, Helge Deller, James Bottomley,
Benjamin Herrenschmidt, Paul Mundt, David S. Miller, Chris Zankel,
Arnd Bergmann
FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp> wrote:
> This patch adds include/linux/pci-dma.h that defines the pci_unmap
> state API:
>
> DECLARE_PCI_UNMAP_ADDR(ADDR_NAME)
> DECLARE_PCI_UNMAP_LEN(LEN_NAME)
> pci_unmap_addr(PTR, ADDR_NAME)
> pci_unmap_addr_set(PTR, ADDR_NAME, VAL)
> pci_unmap_len(PTR, LEN_NAME)
> pci_unmap_len_set(PTR, LEN_NAME, VAL)
>
> This enables us to remove lots of the duplication in architecture
> implementations since there are only two ways to define the API.
>
> If architectures define CONFIG_NEED_DMA_MAP_STATE, they get the real
> definition of pci_unmap state API. If not, they get the noop
> definition.
>
> In the long term, it's better to replace the API with the generic
> device model API such as DECLARE_DMA_UNMAP_ADDR. We can map the API to
> the generic one (like dma-mapping-compat.h does). This patch also
> makes the migration process easier. We can remove this file after the
> migration.
>
> It might be simpler to add the API to include/linux/pci.h but looks
> it's already too large. We'll remove pci-dma.h after finishing moving
> to the generic device model. So I put the API to a separate file.
>
> Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
Acked-by: David Howells <dhowells@redhat.com>
^ permalink raw reply [flat|nested] 26+ messages in thread
end of thread, other threads:[~2010-02-12 15:10 UTC | newest]
Thread overview: 26+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-02-10 1:34 [PATCH v2 -mm 00/14] adds include/linux/pci-dma.h FUJITA Tomonori
2010-02-10 1:34 ` [PATCH v2 -mm 01/14] " FUJITA Tomonori
2010-02-10 6:57 ` Arnd Bergmann
2010-02-12 14:51 ` Russell King - ARM Linux
2010-02-12 15:04 ` David Howells
2010-02-10 1:34 ` [PATCH v2 -mm 02/14] x86: use include/linux/pci-dma.h FUJITA Tomonori
2010-02-10 1:34 ` [PATCH v2 -mm 03/14] alpha: " FUJITA Tomonori
2010-02-11 18:49 ` Matt Turner
2010-02-10 1:34 ` [PATCH v2 -mm 04/14] arm: " FUJITA Tomonori
2010-02-12 14:51 ` Russell King - ARM Linux
2010-02-10 1:34 ` [PATCH v2 -mm 05/14] frv: " FUJITA Tomonori
2010-02-10 11:10 ` David Howells
2010-02-10 1:34 ` [PATCH v2 -mm 06/14] ia64: " FUJITA Tomonori
2010-02-10 1:34 ` [PATCH v2 -mm 07/14] mips: " FUJITA Tomonori
2010-02-10 1:34 ` [PATCH v2 -mm 08/14] parisc: " FUJITA Tomonori
2010-02-12 15:00 ` Kyle McMartin
2010-02-10 1:34 ` [PATCH v2 -mm 09/14] powerpc: " FUJITA Tomonori
2010-02-10 1:34 ` [PATCH v2 -mm 10/14] sh: " FUJITA Tomonori
2010-02-10 8:49 ` Paul Mundt
2010-02-10 1:34 ` [PATCH v2 -mm 11/14] sparc: " FUJITA Tomonori
2010-02-10 6:55 ` David Miller
2010-02-10 1:34 ` [PATCH v2 -mm 12/14] xtensa: " FUJITA Tomonori
2010-02-10 1:34 ` [PATCH v2 -mm 13/14] cris: " FUJITA Tomonori
2010-02-10 6:10 ` Mikael Starvik
2010-02-10 1:34 ` [PATCH v2 -mm 14/14] add linux/pci-dma.h to linux/pci.h FUJITA Tomonori
2010-02-10 6:58 ` Arnd Bergmann
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox