linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v2 0/9] Provide dma_mmap_coherent() and dma_get_sgtable()
@ 2013-01-27 10:33 Geert Uytterhoeven
  2013-01-27 10:33 ` [PATCH v2 1/9] avr32: " Geert Uytterhoeven
                   ` (9 more replies)
  0 siblings, 10 replies; 14+ messages in thread
From: Geert Uytterhoeven @ 2013-01-27 10:33 UTC (permalink / raw)
  To: linux-arch; +Cc: linux-kernel

dma_common_mmap() and dma_common_get_sgtable() are defined in
drivers/base/dma-mapping.c, and always compiled if CONFIG_HAS_DMA=y.

However, their forward declarations and the inline functions defined on top
of them (dma_mmap_attrs(), dma_mmap_coherent(), dma_mmap_writecombine(),
dma_get_sgtable_attrs()), dma_get_sgtable()) are in
<asm-generic/dma-mapping-common.h>, which is not included by all
architectures supporting CONFIG_HAS_DMA=y.  There exist no alternative
implementations.

Hence for e.g. m68k allmodconfig, I get:

drivers/media/v4l2-core/videobuf2-dma-contig.c: In function ‘vb2_dc_mmap’:
drivers/media/v4l2-core/videobuf2-dma-contig.c:204: error: implicit declaration of function ‘dma_mmap_coherent’
drivers/media/v4l2-core/videobuf2-dma-contig.c: In function ‘vb2_dc_get_base_sgt’:
drivers/media/v4l2-core/videobuf2-dma-contig.c:387: error: implicit declaration of function ‘dma_get_sgtable’

This series adds dma_mmap_coherent() and dma_get_sgtable() for all
architectures that set CONFIG_HAS_DMA=y, but don't use dma_map_ops.

  - On architectures for which I received an ack (avr32, blackfin, cris,
    and m68k), the patches are unchanged compared to v1: dma_mmap_coherent()
    and dma_get_sgtable() are implement as inline stubs using
    dma_common_mmap() and dma_common_get_sgtable().

  - On architectures where the current API cannot be implemented (parisc),
    dma_mmap_coherent() and dma_get_sgtable() are dummy implementations that
    just return -EINVAL, until the API has been finalized.

  - On architectures for which I did not receive an ack (c6x, frv, mn10300,
    and xtensa), dma_mmap_coherent() and dma_get_sgtable() are dummy
    implementations that just return -EINVAL, too.

I'll add this to the m68k for-next branch, so hopefully we can get an
unbroken build in 3.8.

Gr{oetje,eeting}s,

						Geert

--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org

In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
							    -- Linus Torvalds

^ permalink raw reply	[flat|nested] 14+ messages in thread

* [PATCH v2 1/9] avr32: Provide dma_mmap_coherent() and dma_get_sgtable()
  2013-01-27 10:33 [PATCH v2 0/9] Provide dma_mmap_coherent() and dma_get_sgtable() Geert Uytterhoeven
@ 2013-01-27 10:33 ` Geert Uytterhoeven
  2013-01-27 10:33 ` [PATCH v2 2/9] blackfin: " Geert Uytterhoeven
                   ` (8 subsequent siblings)
  9 siblings, 0 replies; 14+ messages in thread
From: Geert Uytterhoeven @ 2013-01-27 10:33 UTC (permalink / raw)
  To: linux-arch
  Cc: linux-kernel, Geert Uytterhoeven, Marek Szyprowski, Haavard Skinnemoen

avr32/allmodconfig:

drivers/media/v4l2-core/videobuf2-dma-contig.c: In function ‘vb2_dc_mmap’:
drivers/media/v4l2-core/videobuf2-dma-contig.c:204: error: implicit declaration of function ‘dma_mmap_coherent’
drivers/media/v4l2-core/videobuf2-dma-contig.c: In function ‘vb2_dc_get_base_sgt’:
drivers/media/v4l2-core/videobuf2-dma-contig.c:387: error: implicit declaration of function ‘dma_get_sgtable’

For architectures using dma_map_ops, dma_mmap_coherent() and
dma_get_sgtable() are provided in <asm-generic/dma-mapping-common.h>.

Avr32 does not use dma_map_ops, hence it should implement them as inline
stubs using dma_common_mmap() and dma_common_get_sgtable().

Signed-off-by: Geert Uytterhoeven <geert@linux-m68k.org>
Cc: Marek Szyprowski <m.szyprowski@samsung.com>
Cc: Haavard Skinnemoen <hskinnemoen@gmail.com>
Acked-by: Hans-Christian Egtvedt <egtvedt@samfundet.no>
---
v2: No changes
---
 arch/avr32/include/asm/dma-mapping.h |   10 ++++++++++
 1 files changed, 10 insertions(+), 0 deletions(-)

diff --git a/arch/avr32/include/asm/dma-mapping.h b/arch/avr32/include/asm/dma-mapping.h
index aaf5199..b3d18f9 100644
--- a/arch/avr32/include/asm/dma-mapping.h
+++ b/arch/avr32/include/asm/dma-mapping.h
@@ -336,4 +336,14 @@ dma_sync_sg_for_device(struct device *dev, struct scatterlist *sg,
 #define dma_alloc_noncoherent(d, s, h, f) dma_alloc_coherent(d, s, h, f)
 #define dma_free_noncoherent(d, s, v, h) dma_free_coherent(d, s, v, h)
 
+/* drivers/base/dma-mapping.c */
+extern int dma_common_mmap(struct device *dev, struct vm_area_struct *vma,
+			   void *cpu_addr, dma_addr_t dma_addr, size_t size);
+extern int dma_common_get_sgtable(struct device *dev, struct sg_table *sgt,
+				  void *cpu_addr, dma_addr_t dma_addr,
+				  size_t size);
+
+#define dma_mmap_coherent(d, v, c, h, s) dma_common_mmap(d, v, c, h, s)
+#define dma_get_sgtable(d, t, v, h, s) dma_common_get_sgtable(d, t, v, h, s)
+
 #endif /* __ASM_AVR32_DMA_MAPPING_H */
-- 
1.7.0.4


^ permalink raw reply related	[flat|nested] 14+ messages in thread

* [PATCH v2 2/9] blackfin: Provide dma_mmap_coherent() and dma_get_sgtable()
  2013-01-27 10:33 [PATCH v2 0/9] Provide dma_mmap_coherent() and dma_get_sgtable() Geert Uytterhoeven
  2013-01-27 10:33 ` [PATCH v2 1/9] avr32: " Geert Uytterhoeven
@ 2013-01-27 10:33 ` Geert Uytterhoeven
  2013-01-28  9:08   ` [uclinux-dist-devel] " Bob Liu
  2013-01-27 10:33 ` [PATCH v2 3/9] c6x: Provide dummy " Geert Uytterhoeven
                   ` (7 subsequent siblings)
  9 siblings, 1 reply; 14+ messages in thread
From: Geert Uytterhoeven @ 2013-01-27 10:33 UTC (permalink / raw)
  To: linux-arch
  Cc: linux-kernel, Geert Uytterhoeven, Marek Szyprowski, uclinux-dist-devel

blackfin/allmodconfig:

drivers/media/v4l2-core/videobuf2-dma-contig.c: In function ‘vb2_dc_mmap’:
drivers/media/v4l2-core/videobuf2-dma-contig.c:204: error: implicit declaration of function ‘dma_mmap_coherent’
drivers/media/v4l2-core/videobuf2-dma-contig.c: In function ‘vb2_dc_get_base_sgt’:
drivers/media/v4l2-core/videobuf2-dma-contig.c:387: error: implicit declaration of function ‘dma_get_sgtable’

For architectures using dma_map_ops, dma_mmap_coherent() and
dma_get_sgtable() are provided in <asm-generic/dma-mapping-common.h>.

Blackfin does not use dma_map_ops, hence it should implement them as inline
stubs using dma_common_mmap() and dma_common_get_sgtable().

Signed-off-by: Geert Uytterhoeven <geert@linux-m68k.org>
Cc: Marek Szyprowski <m.szyprowski@samsung.com>
Cc: uclinux-dist-devel@blackfin.uclinux.org
Acked-by: Scott Jiang <scott.jiang.linux@gmail.com>
---
v2: No changes
---
 arch/blackfin/include/asm/dma-mapping.h |   10 ++++++++++
 1 files changed, 10 insertions(+), 0 deletions(-)

diff --git a/arch/blackfin/include/asm/dma-mapping.h b/arch/blackfin/include/asm/dma-mapping.h
index bbf4610..054d9ec 100644
--- a/arch/blackfin/include/asm/dma-mapping.h
+++ b/arch/blackfin/include/asm/dma-mapping.h
@@ -154,4 +154,14 @@ dma_cache_sync(struct device *dev, void *vaddr, size_t size,
 	_dma_sync((dma_addr_t)vaddr, size, dir);
 }
 
+/* drivers/base/dma-mapping.c */
+extern int dma_common_mmap(struct device *dev, struct vm_area_struct *vma,
+			   void *cpu_addr, dma_addr_t dma_addr, size_t size);
+extern int dma_common_get_sgtable(struct device *dev, struct sg_table *sgt,
+				  void *cpu_addr, dma_addr_t dma_addr,
+				  size_t size);
+
+#define dma_mmap_coherent(d, v, c, h, s) dma_common_mmap(d, v, c, h, s)
+#define dma_get_sgtable(d, t, v, h, s) dma_common_get_sgtable(d, t, v, h, s)
+
 #endif				/* _BLACKFIN_DMA_MAPPING_H */
-- 
1.7.0.4


^ permalink raw reply related	[flat|nested] 14+ messages in thread

* [PATCH v2 3/9] c6x: Provide dummy dma_mmap_coherent() and dma_get_sgtable()
  2013-01-27 10:33 [PATCH v2 0/9] Provide dma_mmap_coherent() and dma_get_sgtable() Geert Uytterhoeven
  2013-01-27 10:33 ` [PATCH v2 1/9] avr32: " Geert Uytterhoeven
  2013-01-27 10:33 ` [PATCH v2 2/9] blackfin: " Geert Uytterhoeven
@ 2013-01-27 10:33 ` Geert Uytterhoeven
  2013-01-27 10:33 ` [PATCH v2 4/9] cris: Provide " Geert Uytterhoeven
                   ` (6 subsequent siblings)
  9 siblings, 0 replies; 14+ messages in thread
From: Geert Uytterhoeven @ 2013-01-27 10:33 UTC (permalink / raw)
  To: linux-arch
  Cc: linux-kernel, Geert Uytterhoeven, Marek Szyprowski, linux-c6x-dev

c6x/allmodconfig (assumed):

drivers/media/v4l2-core/videobuf2-dma-contig.c: In function ‘vb2_dc_mmap’:
drivers/media/v4l2-core/videobuf2-dma-contig.c:204: error: implicit declaration of function ‘dma_mmap_coherent’
drivers/media/v4l2-core/videobuf2-dma-contig.c: In function ‘vb2_dc_get_base_sgt’:
drivers/media/v4l2-core/videobuf2-dma-contig.c:387: error: implicit declaration of function ‘dma_get_sgtable’

For architectures using dma_map_ops, dma_mmap_coherent() and
dma_get_sgtable() are provided in <asm-generic/dma-mapping-common.h>.

C6x does not use dma_map_ops, hence it should implement them itself.
For now, use dummy implementations that just return -EINVAL, until the API
has been finalized.

Signed-off-by: Geert Uytterhoeven <geert@linux-m68k.org>
Cc: Marek Szyprowski <m.szyprowski@samsung.com>
Cc: linux-c6x-dev@linux-c6x.org
---
v2: Dummy implementations that just return -EINVAL

Not compile-tested due to lack of cross-compiler
---
 arch/c6x/include/asm/dma-mapping.h |   15 +++++++++++++++
 1 files changed, 15 insertions(+), 0 deletions(-)

diff --git a/arch/c6x/include/asm/dma-mapping.h b/arch/c6x/include/asm/dma-mapping.h
index 3c69406..88bd0d8 100644
--- a/arch/c6x/include/asm/dma-mapping.h
+++ b/arch/c6x/include/asm/dma-mapping.h
@@ -89,4 +89,19 @@ extern void dma_free_coherent(struct device *, size_t, void *, dma_addr_t);
 #define dma_alloc_noncoherent(d, s, h, f) dma_alloc_coherent((d), (s), (h), (f))
 #define dma_free_noncoherent(d, s, v, h)  dma_free_coherent((d), (s), (v), (h))
 
+/* Not supported for now */
+static inline int dma_mmap_coherent(struct device *dev,
+				    struct vm_area_struct *vma, void *cpu_addr,
+				    dma_addr_t dma_addr, size_t size)
+{
+	return -EINVAL;
+}
+
+static inline int dma_get_sgtable(struct device *dev, struct sg_table *sgt,
+				  void *cpu_addr, dma_addr_t dma_addr,
+				  size_t size)
+{
+	return -EINVAL;
+}
+
 #endif	/* _ASM_C6X_DMA_MAPPING_H */
-- 
1.7.0.4


^ permalink raw reply related	[flat|nested] 14+ messages in thread

* [PATCH v2 4/9] cris: Provide dma_mmap_coherent() and dma_get_sgtable()
  2013-01-27 10:33 [PATCH v2 0/9] Provide dma_mmap_coherent() and dma_get_sgtable() Geert Uytterhoeven
                   ` (2 preceding siblings ...)
  2013-01-27 10:33 ` [PATCH v2 3/9] c6x: Provide dummy " Geert Uytterhoeven
@ 2013-01-27 10:33 ` Geert Uytterhoeven
  2013-01-27 10:33 ` [PATCH v2 5/9] frv: Provide dummy " Geert Uytterhoeven
                   ` (5 subsequent siblings)
  9 siblings, 0 replies; 14+ messages in thread
From: Geert Uytterhoeven @ 2013-01-27 10:33 UTC (permalink / raw)
  To: linux-arch
  Cc: linux-kernel, Geert Uytterhoeven, Marek Szyprowski, linux-cris-kernel

cris/allmodconfig:

drivers/media/v4l2-core/videobuf2-dma-contig.c: In function ‘vb2_dc_mmap’:
drivers/media/v4l2-core/videobuf2-dma-contig.c:204: error: implicit declaration of function ‘dma_mmap_coherent’
drivers/media/v4l2-core/videobuf2-dma-contig.c: In function ‘vb2_dc_get_base_sgt’:
drivers/media/v4l2-core/videobuf2-dma-contig.c:387: error: implicit declaration of function ‘dma_get_sgtable’

For architectures using dma_map_ops, dma_mmap_coherent() and
dma_get_sgtable() are provided in <asm-generic/dma-mapping-common.h>.

Cris does not use dma_map_ops, hence it should implement them as inline
stubs using dma_common_mmap() and dma_common_get_sgtable().

Signed-off-by: Geert Uytterhoeven <geert@linux-m68k.org>
Cc: Marek Szyprowski <m.szyprowski@samsung.com>
Cc: linux-cris-kernel@axis.com
Acked-by: Jesper Nilsson <jesper.nilsson@axis.com>
---
v2: No changes
---
 arch/cris/include/asm/dma-mapping.h |   10 ++++++++++
 1 files changed, 10 insertions(+), 0 deletions(-)

diff --git a/arch/cris/include/asm/dma-mapping.h b/arch/cris/include/asm/dma-mapping.h
index 8588b2c..2f0f654 100644
--- a/arch/cris/include/asm/dma-mapping.h
+++ b/arch/cris/include/asm/dma-mapping.h
@@ -158,5 +158,15 @@ dma_cache_sync(struct device *dev, void *vaddr, size_t size,
 {
 }
 
+/* drivers/base/dma-mapping.c */
+extern int dma_common_mmap(struct device *dev, struct vm_area_struct *vma,
+			   void *cpu_addr, dma_addr_t dma_addr, size_t size);
+extern int dma_common_get_sgtable(struct device *dev, struct sg_table *sgt,
+				  void *cpu_addr, dma_addr_t dma_addr,
+				  size_t size);
+
+#define dma_mmap_coherent(d, v, c, h, s) dma_common_mmap(d, v, c, h, s)
+#define dma_get_sgtable(d, t, v, h, s) dma_common_get_sgtable(d, t, v, h, s)
+
 
 #endif
-- 
1.7.0.4


^ permalink raw reply related	[flat|nested] 14+ messages in thread

* [PATCH v2 5/9] frv: Provide dummy dma_mmap_coherent() and dma_get_sgtable()
  2013-01-27 10:33 [PATCH v2 0/9] Provide dma_mmap_coherent() and dma_get_sgtable() Geert Uytterhoeven
                   ` (3 preceding siblings ...)
  2013-01-27 10:33 ` [PATCH v2 4/9] cris: Provide " Geert Uytterhoeven
@ 2013-01-27 10:33 ` Geert Uytterhoeven
  2013-01-27 10:33 ` [PATCH v2 6/9] m68k: Provide " Geert Uytterhoeven
                   ` (4 subsequent siblings)
  9 siblings, 0 replies; 14+ messages in thread
From: Geert Uytterhoeven @ 2013-01-27 10:33 UTC (permalink / raw)
  To: linux-arch
  Cc: linux-kernel, Geert Uytterhoeven, Marek Szyprowski, David Howells

frv/allmodconfig:

drivers/media/v4l2-core/videobuf2-dma-contig.c: In function ‘vb2_dc_mmap’:
drivers/media/v4l2-core/videobuf2-dma-contig.c:204: error: implicit declaration of function ‘dma_mmap_coherent’
drivers/media/v4l2-core/videobuf2-dma-contig.c: In function ‘vb2_dc_get_base_sgt’:
drivers/media/v4l2-core/videobuf2-dma-contig.c:387: error: implicit declaration of function ‘dma_get_sgtable’

For architectures using dma_map_ops, dma_mmap_coherent() and
dma_get_sgtable() are provided in <asm-generic/dma-mapping-common.h>.

Frv does not use dma_map_ops, hence it should implement them itself.
For now, use dummy implementations that just return -EINVAL, until the API
has been finalized.

Signed-off-by: Geert Uytterhoeven <geert@linux-m68k.org>
Cc: Marek Szyprowski <m.szyprowski@samsung.com>
Cc: David Howells <dhowells@redhat.com>
---
v2: Dummy implementations that just return -EINVAL
---
 arch/frv/include/asm/dma-mapping.h |   15 +++++++++++++++
 1 files changed, 15 insertions(+), 0 deletions(-)

diff --git a/arch/frv/include/asm/dma-mapping.h b/arch/frv/include/asm/dma-mapping.h
index dfb8110..1746a2b 100644
--- a/arch/frv/include/asm/dma-mapping.h
+++ b/arch/frv/include/asm/dma-mapping.h
@@ -132,4 +132,19 @@ void dma_cache_sync(struct device *dev, void *vaddr, size_t size,
 	flush_write_buffers();
 }
 
+/* Not supported for now */
+static inline int dma_mmap_coherent(struct device *dev,
+				    struct vm_area_struct *vma, void *cpu_addr,
+				    dma_addr_t dma_addr, size_t size)
+{
+	return -EINVAL;
+}
+
+static inline int dma_get_sgtable(struct device *dev, struct sg_table *sgt,
+				  void *cpu_addr, dma_addr_t dma_addr,
+				  size_t size)
+{
+	return -EINVAL;
+}
+
 #endif  /* _ASM_DMA_MAPPING_H */
-- 
1.7.0.4


^ permalink raw reply related	[flat|nested] 14+ messages in thread

* [PATCH v2 6/9] m68k: Provide dma_mmap_coherent() and dma_get_sgtable()
  2013-01-27 10:33 [PATCH v2 0/9] Provide dma_mmap_coherent() and dma_get_sgtable() Geert Uytterhoeven
                   ` (4 preceding siblings ...)
  2013-01-27 10:33 ` [PATCH v2 5/9] frv: Provide dummy " Geert Uytterhoeven
@ 2013-01-27 10:33 ` Geert Uytterhoeven
  2013-01-27 10:33 ` [PATCH v2 7/9] mn10300: Provide dummy " Geert Uytterhoeven
                   ` (3 subsequent siblings)
  9 siblings, 0 replies; 14+ messages in thread
From: Geert Uytterhoeven @ 2013-01-27 10:33 UTC (permalink / raw)
  To: linux-arch; +Cc: linux-kernel, Geert Uytterhoeven, Marek Szyprowski, linux-m68k

m68k/allmodconfig:

drivers/media/v4l2-core/videobuf2-dma-contig.c: In function ‘vb2_dc_mmap’:
drivers/media/v4l2-core/videobuf2-dma-contig.c:204: error: implicit declaration of function ‘dma_mmap_coherent’
drivers/media/v4l2-core/videobuf2-dma-contig.c: In function ‘vb2_dc_get_base_sgt’:
drivers/media/v4l2-core/videobuf2-dma-contig.c:387: error: implicit declaration of function ‘dma_get_sgtable’

For architectures using dma_map_ops, dma_mmap_coherent() and
dma_get_sgtable() are provided in <asm-generic/dma-mapping-common.h>.

M68k does not use dma_map_ops, hence it should implement them as inline
stubs using dma_common_mmap() and dma_common_get_sgtable().

Signed-off-by: Geert Uytterhoeven <geert@linux-m68k.org>
Cc: Marek Szyprowski <m.szyprowski@samsung.com>
Cc: linux-m68k@lists.linux-m68k.org
---
v2: No changes
---
 arch/m68k/include/asm/dma-mapping.h |   10 ++++++++++
 1 files changed, 10 insertions(+), 0 deletions(-)

diff --git a/arch/m68k/include/asm/dma-mapping.h b/arch/m68k/include/asm/dma-mapping.h
index c68cdb4..05aa535 100644
--- a/arch/m68k/include/asm/dma-mapping.h
+++ b/arch/m68k/include/asm/dma-mapping.h
@@ -110,4 +110,14 @@ static inline int dma_mapping_error(struct device *dev, dma_addr_t handle)
 	return 0;
 }
 
+/* drivers/base/dma-mapping.c */
+extern int dma_common_mmap(struct device *dev, struct vm_area_struct *vma,
+			   void *cpu_addr, dma_addr_t dma_addr, size_t size);
+extern int dma_common_get_sgtable(struct device *dev, struct sg_table *sgt,
+				  void *cpu_addr, dma_addr_t dma_addr,
+				  size_t size);
+
+#define dma_mmap_coherent(d, v, c, h, s) dma_common_mmap(d, v, c, h, s)
+#define dma_get_sgtable(d, t, v, h, s) dma_common_get_sgtable(d, t, v, h, s)
+
 #endif  /* _M68K_DMA_MAPPING_H */
-- 
1.7.0.4


^ permalink raw reply related	[flat|nested] 14+ messages in thread

* [PATCH v2 7/9] mn10300: Provide dummy dma_mmap_coherent() and dma_get_sgtable()
  2013-01-27 10:33 [PATCH v2 0/9] Provide dma_mmap_coherent() and dma_get_sgtable() Geert Uytterhoeven
                   ` (5 preceding siblings ...)
  2013-01-27 10:33 ` [PATCH v2 6/9] m68k: Provide " Geert Uytterhoeven
@ 2013-01-27 10:33 ` Geert Uytterhoeven
  2013-01-27 10:33 ` [PATCH v2 8/9] parisc: " Geert Uytterhoeven
                   ` (2 subsequent siblings)
  9 siblings, 0 replies; 14+ messages in thread
From: Geert Uytterhoeven @ 2013-01-27 10:33 UTC (permalink / raw)
  To: linux-arch
  Cc: linux-kernel, Geert Uytterhoeven, Marek Szyprowski, linux-am33-list

mn10300/allmodconfig:

drivers/media/v4l2-core/videobuf2-dma-contig.c: In function ‘vb2_dc_mmap’:
drivers/media/v4l2-core/videobuf2-dma-contig.c:204: error: implicit declaration of function ‘dma_mmap_coherent’
drivers/media/v4l2-core/videobuf2-dma-contig.c: In function ‘vb2_dc_get_base_sgt’:
drivers/media/v4l2-core/videobuf2-dma-contig.c:387: error: implicit declaration of function ‘dma_get_sgtable’

For architectures using dma_map_ops, dma_mmap_coherent() and
dma_get_sgtable() are provided in <asm-generic/dma-mapping-common.h>.

Mn10300 does not use dma_map_ops, hence it should implement them itself.
For now, use dummy implementations that just return -EINVAL, until the API
has been finalized.

Signed-off-by: Geert Uytterhoeven <geert@linux-m68k.org>
Cc: Marek Szyprowski <m.szyprowski@samsung.com>
Cc: linux-am33-list@redhat.com
---
v2: Dummy implementations that just return -EINVAL
---
 arch/mn10300/include/asm/dma-mapping.h |   15 +++++++++++++++
 1 files changed, 15 insertions(+), 0 deletions(-)

diff --git a/arch/mn10300/include/asm/dma-mapping.h b/arch/mn10300/include/asm/dma-mapping.h
index c1be439..a18abfc 100644
--- a/arch/mn10300/include/asm/dma-mapping.h
+++ b/arch/mn10300/include/asm/dma-mapping.h
@@ -168,4 +168,19 @@ void dma_cache_sync(void *vaddr, size_t size,
 	mn10300_dcache_flush_inv();
 }
 
+/* Not supported for now */
+static inline int dma_mmap_coherent(struct device *dev,
+				    struct vm_area_struct *vma, void *cpu_addr,
+				    dma_addr_t dma_addr, size_t size)
+{
+	return -EINVAL;
+}
+
+static inline int dma_get_sgtable(struct device *dev, struct sg_table *sgt,
+				  void *cpu_addr, dma_addr_t dma_addr,
+				  size_t size)
+{
+	return -EINVAL;
+}
+
 #endif
-- 
1.7.0.4


^ permalink raw reply related	[flat|nested] 14+ messages in thread

* [PATCH v2 8/9] parisc: Provide dummy dma_mmap_coherent() and dma_get_sgtable()
  2013-01-27 10:33 [PATCH v2 0/9] Provide dma_mmap_coherent() and dma_get_sgtable() Geert Uytterhoeven
                   ` (6 preceding siblings ...)
  2013-01-27 10:33 ` [PATCH v2 7/9] mn10300: Provide dummy " Geert Uytterhoeven
@ 2013-01-27 10:33 ` Geert Uytterhoeven
  2013-01-27 10:33 ` [PATCH v2 9/9] xtensa: " Geert Uytterhoeven
  2013-01-27 10:43 ` [PATCH v2 0/9] Provide " Geert Uytterhoeven
  9 siblings, 0 replies; 14+ messages in thread
From: Geert Uytterhoeven @ 2013-01-27 10:33 UTC (permalink / raw)
  To: linux-arch
  Cc: linux-kernel, Geert Uytterhoeven, Marek Szyprowski,
	James Bottomley, linux-parisc

parisc/allmodconfig:

drivers/media/v4l2-core/videobuf2-dma-contig.c: In function ‘vb2_dc_mmap’:
drivers/media/v4l2-core/videobuf2-dma-contig.c:204: error: implicit declaration of function ‘dma_mmap_coherent’
drivers/media/v4l2-core/videobuf2-dma-contig.c: In function ‘vb2_dc_get_base_sgt’:
drivers/media/v4l2-core/videobuf2-dma-contig.c:387: error: implicit declaration of function ‘dma_get_sgtable’

For architectures using dma_map_ops, dma_mmap_coherent() and
dma_get_sgtable() are provided in <asm-generic/dma-mapping-common.h>.

Parisc does not use dma_map_ops, hence it should implement them itself.
For now, use dummy implementations that just return -EINVAL, until the
API has been finalized, as it cannot be supported on PA-RISC as-is.

Signed-off-by: Geert Uytterhoeven <geert@linux-m68k.org>
Cc: Marek Szyprowski <m.szyprowski@samsung.com>
Cc: James Bottomley <James.Bottomley@hansenpartnership.com>
Cc: linux-parisc@vger.kernel.org
---
v2: Dummy implementations that just return -EINVAL
---
 arch/parisc/include/asm/dma-mapping.h |   15 +++++++++++++++
 1 files changed, 15 insertions(+), 0 deletions(-)

diff --git a/arch/parisc/include/asm/dma-mapping.h b/arch/parisc/include/asm/dma-mapping.h
index 467bbd5..106b395 100644
--- a/arch/parisc/include/asm/dma-mapping.h
+++ b/arch/parisc/include/asm/dma-mapping.h
@@ -238,4 +238,19 @@ void * sba_get_iommu(struct parisc_device *dev);
 /* At the moment, we panic on error for IOMMU resource exaustion */
 #define dma_mapping_error(dev, x)	0
 
+/* This API cannot be supported on PA-RISC */
+static inline int dma_mmap_coherent(struct device *dev,
+				    struct vm_area_struct *vma, void *cpu_addr,
+				    dma_addr_t dma_addr, size_t size)
+{
+	return -EINVAL;
+}
+
+static inline int dma_get_sgtable(struct device *dev, struct sg_table *sgt,
+				  void *cpu_addr, dma_addr_t dma_addr,
+				  size_t size)
+{
+	return -EINVAL;
+}
+
 #endif
-- 
1.7.0.4


^ permalink raw reply related	[flat|nested] 14+ messages in thread

* [PATCH v2 9/9] xtensa: Provide dummy dma_mmap_coherent() and dma_get_sgtable()
  2013-01-27 10:33 [PATCH v2 0/9] Provide dma_mmap_coherent() and dma_get_sgtable() Geert Uytterhoeven
                   ` (7 preceding siblings ...)
  2013-01-27 10:33 ` [PATCH v2 8/9] parisc: " Geert Uytterhoeven
@ 2013-01-27 10:33 ` Geert Uytterhoeven
  2013-01-27 10:43 ` [PATCH v2 0/9] Provide " Geert Uytterhoeven
  9 siblings, 0 replies; 14+ messages in thread
From: Geert Uytterhoeven @ 2013-01-27 10:33 UTC (permalink / raw)
  To: linux-arch
  Cc: linux-kernel, Geert Uytterhoeven, Marek Szyprowski, linux-xtensa

xtensa/allmodconfig:

drivers/media/v4l2-core/videobuf2-dma-contig.c: In function ‘vb2_dc_mmap’:
drivers/media/v4l2-core/videobuf2-dma-contig.c:204: error: implicit declaration of function ‘dma_mmap_coherent’
drivers/media/v4l2-core/videobuf2-dma-contig.c: In function ‘vb2_dc_get_base_sgt’:
drivers/media/v4l2-core/videobuf2-dma-contig.c:387: error: implicit declaration of function ‘dma_get_sgtable’

For architectures using dma_map_ops, dma_mmap_coherent() and
dma_get_sgtable() are provided in <asm-generic/dma-mapping-common.h>.

Xtensa does not use dma_map_ops, hence it should implement them itself.
For now, use dummy implementations that just return -EINVAL, until the API
has been finalized.

Signed-off-by: Geert Uytterhoeven <geert@linux-m68k.org>
Cc: Marek Szyprowski <m.szyprowski@samsung.com>
Cc: linux-xtensa@linux-xtensa.org
---
v2: Dummy implementations that just return -EINVAL
---
 arch/xtensa/include/asm/dma-mapping.h |   15 +++++++++++++++
 1 files changed, 15 insertions(+), 0 deletions(-)

diff --git a/arch/xtensa/include/asm/dma-mapping.h b/arch/xtensa/include/asm/dma-mapping.h
index 4acb5fe..172a02a 100644
--- a/arch/xtensa/include/asm/dma-mapping.h
+++ b/arch/xtensa/include/asm/dma-mapping.h
@@ -170,4 +170,19 @@ dma_cache_sync(struct device *dev, void *vaddr, size_t size,
 	consistent_sync(vaddr, size, direction);
 }
 
+/* Not supported for now */
+static inline int dma_mmap_coherent(struct device *dev,
+				    struct vm_area_struct *vma, void *cpu_addr,
+				    dma_addr_t dma_addr, size_t size)
+{
+	return -EINVAL;
+}
+
+static inline int dma_get_sgtable(struct device *dev, struct sg_table *sgt,
+				  void *cpu_addr, dma_addr_t dma_addr,
+				  size_t size)
+{
+	return -EINVAL;
+}
+
 #endif	/* _XTENSA_DMA_MAPPING_H */
-- 
1.7.0.4


^ permalink raw reply related	[flat|nested] 14+ messages in thread

* Re: [PATCH v2 0/9] Provide dma_mmap_coherent() and dma_get_sgtable()
  2013-01-27 10:33 [PATCH v2 0/9] Provide dma_mmap_coherent() and dma_get_sgtable() Geert Uytterhoeven
                   ` (8 preceding siblings ...)
  2013-01-27 10:33 ` [PATCH v2 9/9] xtensa: " Geert Uytterhoeven
@ 2013-01-27 10:43 ` Geert Uytterhoeven
  2013-01-28  8:09   ` Marek Szyprowski
  9 siblings, 1 reply; 14+ messages in thread
From: Geert Uytterhoeven @ 2013-01-27 10:43 UTC (permalink / raw)
  To: linux-arch, Marek Szyprowski; +Cc: linux-kernel

On Sun, Jan 27, 2013 at 11:33 AM, Geert Uytterhoeven
<geert@linux-m68k.org> wrote:
> I'll add this to the m68k for-next branch, so hopefully we can get an
> unbroken build in 3.8.

Sorry, I meant "for-linus", as it's destined for 3.8, not 3.9.

Gr{oetje,eeting}s,

                        Geert

--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org

In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
                                -- Linus Torvalds

^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: [PATCH v2 0/9] Provide dma_mmap_coherent() and dma_get_sgtable()
  2013-01-27 10:43 ` [PATCH v2 0/9] Provide " Geert Uytterhoeven
@ 2013-01-28  8:09   ` Marek Szyprowski
  2013-01-28  8:20     ` Geert Uytterhoeven
  0 siblings, 1 reply; 14+ messages in thread
From: Marek Szyprowski @ 2013-01-28  8:09 UTC (permalink / raw)
  To: Geert Uytterhoeven; +Cc: linux-arch, linux-kernel

Hi Geert,

On 1/27/2013 11:43 AM, Geert Uytterhoeven wrote:
> On Sun, Jan 27, 2013 at 11:33 AM, Geert Uytterhoeven
> <geert@linux-m68k.org> wrote:
> > I'll add this to the m68k for-next branch, so hopefully we can get an
> > unbroken build in 3.8.
>
> Sorry, I meant "for-linus", as it's destined for 3.8, not 3.9.

Do you want me to take those patches via dma-mapping tree or get my ack
and put them together with your other m68k fixes for v3.8?

Best regards
-- 
Marek Szyprowski
Samsung Poland R&D Center



^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: [PATCH v2 0/9] Provide dma_mmap_coherent() and dma_get_sgtable()
  2013-01-28  8:09   ` Marek Szyprowski
@ 2013-01-28  8:20     ` Geert Uytterhoeven
  0 siblings, 0 replies; 14+ messages in thread
From: Geert Uytterhoeven @ 2013-01-28  8:20 UTC (permalink / raw)
  To: Marek Szyprowski; +Cc: linux-arch, linux-kernel

Hi Marek,

On Mon, Jan 28, 2013 at 9:09 AM, Marek Szyprowski
<m.szyprowski@samsung.com> wrote:
> On 1/27/2013 11:43 AM, Geert Uytterhoeven wrote:
>> On Sun, Jan 27, 2013 at 11:33 AM, Geert Uytterhoeven
>> <geert@linux-m68k.org> wrote:
>> > I'll add this to the m68k for-next branch, so hopefully we can get an
>> > unbroken build in 3.8.
>>
>> Sorry, I meant "for-linus", as it's destined for 3.8, not 3.9.
>
> Do you want me to take those patches via dma-mapping tree or get my ack
> and put them together with your other m68k fixes for v3.8?

I don't mind if you take them, as that means less work for me ;-)
Thanks!

The other m68k fixes were pulled by Linus in 3.8-rc5, so I have no other things
left for 3.8.

Gr{oetje,eeting}s,

                        Geert

--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org

In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
                                -- Linus Torvalds

^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: [uclinux-dist-devel] [PATCH v2 2/9] blackfin: Provide dma_mmap_coherent() and dma_get_sgtable()
  2013-01-27 10:33 ` [PATCH v2 2/9] blackfin: " Geert Uytterhoeven
@ 2013-01-28  9:08   ` Bob Liu
  0 siblings, 0 replies; 14+ messages in thread
From: Bob Liu @ 2013-01-28  9:08 UTC (permalink / raw)
  To: Geert Uytterhoeven
  Cc: linux-arch, uclinux-dist-devel, linux-kernel, Marek Szyprowski

On Sun, Jan 27, 2013 at 6:33 PM, Geert Uytterhoeven
<geert@linux-m68k.org> wrote:
> blackfin/allmodconfig:
>
> drivers/media/v4l2-core/videobuf2-dma-contig.c: In function ‘vb2_dc_mmap’:
> drivers/media/v4l2-core/videobuf2-dma-contig.c:204: error: implicit declaration of function ‘dma_mmap_coherent’
> drivers/media/v4l2-core/videobuf2-dma-contig.c: In function ‘vb2_dc_get_base_sgt’:
> drivers/media/v4l2-core/videobuf2-dma-contig.c:387: error: implicit declaration of function ‘dma_get_sgtable’
>
> For architectures using dma_map_ops, dma_mmap_coherent() and
> dma_get_sgtable() are provided in <asm-generic/dma-mapping-common.h>.
>
> Blackfin does not use dma_map_ops, hence it should implement them as inline
> stubs using dma_common_mmap() and dma_common_get_sgtable().
>
> Signed-off-by: Geert Uytterhoeven <geert@linux-m68k.org>
> Cc: Marek Szyprowski <m.szyprowski@samsung.com>
> Cc: uclinux-dist-devel@blackfin.uclinux.org
> Acked-by: Scott Jiang <scott.jiang.linux@gmail.com>

Thanks,
Will be applied to my blackfin arch tree.

> ---
> v2: No changes
> ---
>  arch/blackfin/include/asm/dma-mapping.h |   10 ++++++++++
>  1 files changed, 10 insertions(+), 0 deletions(-)
>
> diff --git a/arch/blackfin/include/asm/dma-mapping.h b/arch/blackfin/include/asm/dma-mapping.h
> index bbf4610..054d9ec 100644
> --- a/arch/blackfin/include/asm/dma-mapping.h
> +++ b/arch/blackfin/include/asm/dma-mapping.h
> @@ -154,4 +154,14 @@ dma_cache_sync(struct device *dev, void *vaddr, size_t size,
>         _dma_sync((dma_addr_t)vaddr, size, dir);
>  }
>
> +/* drivers/base/dma-mapping.c */
> +extern int dma_common_mmap(struct device *dev, struct vm_area_struct *vma,
> +                          void *cpu_addr, dma_addr_t dma_addr, size_t size);
> +extern int dma_common_get_sgtable(struct device *dev, struct sg_table *sgt,
> +                                 void *cpu_addr, dma_addr_t dma_addr,
> +                                 size_t size);
> +
> +#define dma_mmap_coherent(d, v, c, h, s) dma_common_mmap(d, v, c, h, s)
> +#define dma_get_sgtable(d, t, v, h, s) dma_common_get_sgtable(d, t, v, h, s)
> +
>  #endif                         /* _BLACKFIN_DMA_MAPPING_H */
> --
> 1.7.0.4
>

-- 
Regards,
--Bob

^ permalink raw reply	[flat|nested] 14+ messages in thread

end of thread, other threads:[~2013-01-28  9:08 UTC | newest]

Thread overview: 14+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-01-27 10:33 [PATCH v2 0/9] Provide dma_mmap_coherent() and dma_get_sgtable() Geert Uytterhoeven
2013-01-27 10:33 ` [PATCH v2 1/9] avr32: " Geert Uytterhoeven
2013-01-27 10:33 ` [PATCH v2 2/9] blackfin: " Geert Uytterhoeven
2013-01-28  9:08   ` [uclinux-dist-devel] " Bob Liu
2013-01-27 10:33 ` [PATCH v2 3/9] c6x: Provide dummy " Geert Uytterhoeven
2013-01-27 10:33 ` [PATCH v2 4/9] cris: Provide " Geert Uytterhoeven
2013-01-27 10:33 ` [PATCH v2 5/9] frv: Provide dummy " Geert Uytterhoeven
2013-01-27 10:33 ` [PATCH v2 6/9] m68k: Provide " Geert Uytterhoeven
2013-01-27 10:33 ` [PATCH v2 7/9] mn10300: Provide dummy " Geert Uytterhoeven
2013-01-27 10:33 ` [PATCH v2 8/9] parisc: " Geert Uytterhoeven
2013-01-27 10:33 ` [PATCH v2 9/9] xtensa: " Geert Uytterhoeven
2013-01-27 10:43 ` [PATCH v2 0/9] Provide " Geert Uytterhoeven
2013-01-28  8:09   ` Marek Szyprowski
2013-01-28  8:20     ` Geert Uytterhoeven

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).