Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

[PATCH v2 -mm 05/14] frv: use include/linux/pci-dma.h

3 views
Skip to first unread message

FUJITA Tomonori

unread,
Feb 9, 2010, 8:40:02 PM2/9/10
to
Signed-off-by: FUJITA Tomonori <fujita....@lab.ntt.co.jp>
Cc: David Howells <dhow...@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

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majo...@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/

FUJITA Tomonori

unread,
Feb 9, 2010, 8:40:02 PM2/9/10
to
Signed-off-by: FUJITA Tomonori <fujita....@lab.ntt.co.jp>
Cc: Tony Luck <tony...@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))

FUJITA Tomonori

unread,
Feb 9, 2010, 8:40:02 PM2/9/10
to
Signed-off-by: FUJITA Tomonori <fujita....@lab.ntt.co.jp>
Cc: Richard Henderson <r...@twiddle.net>
Cc: Ivan Kokshaysky <i...@jurassic.park.msu.ru>
Cc: Matt Turner <matt...@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

FUJITA Tomonori

unread,
Feb 9, 2010, 8:40:03 PM2/9/10
to
Signed-off-by: FUJITA Tomonori <fujita....@lab.ntt.co.jp>
Cc: Ralf Baechle <ra...@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,

FUJITA Tomonori

unread,
Feb 9, 2010, 8:40:03 PM2/9/10
to
Signed-off-by: FUJITA Tomonori <fujita....@lab.ntt.co.jp>
Cc: Mikael Starvik <sta...@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,

FUJITA Tomonori

unread,
Feb 9, 2010, 8:50:02 PM2/9/10
to
Signed-off-by: FUJITA Tomonori <fujita....@lab.ntt.co.jp>
Cc: David S. Miller <da...@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

FUJITA Tomonori

unread,
Feb 9, 2010, 8:50:02 PM2/9/10
to
Signed-off-by: FUJITA Tomonori <fujita....@lab.ntt.co.jp>
Cc: Chris Zankel <ch...@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,

Mikael Starvik

unread,
Feb 10, 2010, 1:20:02 AM2/10/10
to
Sure, that is ok.

Signed-off-by: Mikael Starvik <sta...@axis.com>

David Miller

unread,
Feb 10, 2010, 2:00:03 AM2/10/10
to
From: FUJITA Tomonori <fujita....@lab.ntt.co.jp>
Date: Wed, 10 Feb 2010 10:34:44 +0900

> Signed-off-by: FUJITA Tomonori <fujita....@lab.ntt.co.jp>

Acked-by: David S. Miller <da...@davemloft.net>

David Howells

unread,
Feb 10, 2010, 6:20:02 AM2/10/10
to
FUJITA Tomonori <fujita....@lab.ntt.co.jp> wrote:

> Signed-off-by: FUJITA Tomonori <fujita....@lab.ntt.co.jp>

Acked-by: David Howells <dhow...@redhat.com>

Matt Turner

unread,
Feb 11, 2010, 2:00:01 PM2/11/10
to

Acked-by: Matt Turner <matt...@gmail.com>

0 new messages