linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH -mm] frv: remove the obsolete and unnecessary DMA API comments
@ 2010-02-12  6:04 FUJITA Tomonori
  2010-02-17 10:03 ` David Howells
  0 siblings, 1 reply; 4+ messages in thread
From: FUJITA Tomonori @ 2010-02-12  6:04 UTC (permalink / raw)
  To: linux-kernel; +Cc: akpm, dhowells

pci_dma_sync_single was obsoleted long ago.

All the comments are generic, not architecture specific, simply
describes some of the DMA-API (and frv has the same comments in three
files). Documentation/DMA-API.txt have more detailed descriptions.

This removes the above obsolete and unnecessary DMA API
comments. Let's describe the DMA API in only
Documentation/DMA-API.txt.

Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
Cc: David Howells <dhowells@redhat.com>
---
 arch/frv/include/asm/dma-mapping.h    |   36 ---------------------------------
 arch/frv/mb93090-mb00/pci-dma-nommu.c |   30 ---------------------------
 arch/frv/mb93090-mb00/pci-dma.c       |   30 ---------------------------
 3 files changed, 0 insertions(+), 96 deletions(-)

diff --git a/arch/frv/include/asm/dma-mapping.h b/arch/frv/include/asm/dma-mapping.h
index b289887..20cca40 100644
--- a/arch/frv/include/asm/dma-mapping.h
+++ b/arch/frv/include/asm/dma-mapping.h
@@ -16,24 +16,9 @@ extern unsigned long __nongprelbss dma_coherent_mem_end;
 void *dma_alloc_coherent(struct device *dev, size_t size, dma_addr_t *dma_handle, gfp_t gfp);
 void dma_free_coherent(struct device *dev, size_t size, void *vaddr, dma_addr_t dma_handle);
 
-/*
- * Map a single buffer of the indicated size for DMA in streaming mode.
- * The 32-bit bus address to use is returned.
- *
- * Once the device is given the dma address, the device owns this memory
- * until either pci_unmap_single or pci_dma_sync_single is performed.
- */
 extern dma_addr_t dma_map_single(struct device *dev, void *ptr, size_t size,
 				 enum dma_data_direction direction);
 
-/*
- * Unmap a single streaming mode DMA translation.  The dma_addr and size
- * must match what was provided for in a previous pci_map_single call.  All
- * other usages are undefined.
- *
- * After this call, reads by the cpu to the buffer are guarenteed to see
- * whatever the device wrote there.
- */
 static inline
 void dma_unmap_single(struct device *dev, dma_addr_t dma_addr, size_t size,
 		      enum dma_data_direction direction)
@@ -41,30 +26,9 @@ void dma_unmap_single(struct device *dev, dma_addr_t dma_addr, size_t size,
 	BUG_ON(direction == DMA_NONE);
 }
 
-/*
- * Map a set of buffers described by scatterlist in streaming
- * mode for DMA.  This is the scather-gather version of the
- * above pci_map_single interface.  Here the scatter gather list
- * elements are each tagged with the appropriate dma address
- * and length.  They are obtained via sg_dma_{address,length}(SG).
- *
- * NOTE: An implementation may be able to use a smaller number of
- *       DMA address/length pairs than there are SG table elements.
- *       (for example via virtual mapping capabilities)
- *       The routine returns the number of addr/length pairs actually
- *       used, at most nents.
- *
- * Device ownership issues as mentioned above for pci_map_single are
- * the same here.
- */
 extern int dma_map_sg(struct device *dev, struct scatterlist *sg, int nents,
 		      enum dma_data_direction direction);
 
-/*
- * Unmap a set of streaming mode DMA translations.
- * Again, cpu read rules concerning calls here are the same as for
- * pci_unmap_single() above.
- */
 static inline
 void dma_unmap_sg(struct device *dev, struct scatterlist *sg, int nhwentries,
 	     enum dma_data_direction direction)
diff --git a/arch/frv/mb93090-mb00/pci-dma-nommu.c b/arch/frv/mb93090-mb00/pci-dma-nommu.c
index 4e1ba0b..e47857f 100644
--- a/arch/frv/mb93090-mb00/pci-dma-nommu.c
+++ b/arch/frv/mb93090-mb00/pci-dma-nommu.c
@@ -106,13 +106,6 @@ void dma_free_coherent(struct device *hwdev, size_t size, void *vaddr, dma_addr_
 
 EXPORT_SYMBOL(dma_free_coherent);
 
-/*
- * Map a single buffer of the indicated size for DMA in streaming mode.
- * The 32-bit bus address to use is returned.
- *
- * Once the device is given the dma address, the device owns this memory
- * until either dma_unmap_single or pci_dma_sync_single is performed.
- */
 dma_addr_t dma_map_single(struct device *dev, void *ptr, size_t size,
 			  enum dma_data_direction direction)
 {
@@ -125,22 +118,6 @@ dma_addr_t dma_map_single(struct device *dev, void *ptr, size_t size,
 
 EXPORT_SYMBOL(dma_map_single);
 
-/*
- * Map a set of buffers described by scatterlist in streaming
- * mode for DMA.  This is the scather-gather version of the
- * above dma_map_single interface.  Here the scatter gather list
- * elements are each tagged with the appropriate dma address
- * and length.  They are obtained via sg_dma_{address,length}(SG).
- *
- * NOTE: An implementation may be able to use a smaller number of
- *       DMA address/length pairs than there are SG table elements.
- *       (for example via virtual mapping capabilities)
- *       The routine returns the number of addr/length pairs actually
- *       used, at most nents.
- *
- * Device ownership issues as mentioned above for dma_map_single are
- * the same here.
- */
 int dma_map_sg(struct device *dev, struct scatterlist *sg, int nents,
 	       enum dma_data_direction direction)
 {
@@ -157,13 +134,6 @@ int dma_map_sg(struct device *dev, struct scatterlist *sg, int nents,
 
 EXPORT_SYMBOL(dma_map_sg);
 
-/*
- * Map a single page of the indicated size for DMA in streaming mode.
- * The 32-bit bus address to use is returned.
- *
- * Device ownership issues as mentioned above for dma_map_single are
- * the same here.
- */
 dma_addr_t dma_map_page(struct device *dev, struct page *page, unsigned long offset,
 			size_t size, enum dma_data_direction direction)
 {
diff --git a/arch/frv/mb93090-mb00/pci-dma.c b/arch/frv/mb93090-mb00/pci-dma.c
index 45954f0..2c912e8 100644
--- a/arch/frv/mb93090-mb00/pci-dma.c
+++ b/arch/frv/mb93090-mb00/pci-dma.c
@@ -38,13 +38,6 @@ void dma_free_coherent(struct device *hwdev, size_t size, void *vaddr, dma_addr_
 
 EXPORT_SYMBOL(dma_free_coherent);
 
-/*
- * Map a single buffer of the indicated size for DMA in streaming mode.
- * The 32-bit bus address to use is returned.
- *
- * Once the device is given the dma address, the device owns this memory
- * until either pci_unmap_single or pci_dma_sync_single is performed.
- */
 dma_addr_t dma_map_single(struct device *dev, void *ptr, size_t size,
 			  enum dma_data_direction direction)
 {
@@ -57,22 +50,6 @@ dma_addr_t dma_map_single(struct device *dev, void *ptr, size_t size,
 
 EXPORT_SYMBOL(dma_map_single);
 
-/*
- * Map a set of buffers described by scatterlist in streaming
- * mode for DMA.  This is the scather-gather version of the
- * above dma_map_single interface.  Here the scatter gather list
- * elements are each tagged with the appropriate dma address
- * and length.  They are obtained via sg_dma_{address,length}(SG).
- *
- * NOTE: An implementation may be able to use a smaller number of
- *       DMA address/length pairs than there are SG table elements.
- *       (for example via virtual mapping capabilities)
- *       The routine returns the number of addr/length pairs actually
- *       used, at most nents.
- *
- * Device ownership issues as mentioned above for dma_map_single are
- * the same here.
- */
 int dma_map_sg(struct device *dev, struct scatterlist *sg, int nents,
 	       enum dma_data_direction direction)
 {
@@ -103,13 +80,6 @@ int dma_map_sg(struct device *dev, struct scatterlist *sg, int nents,
 
 EXPORT_SYMBOL(dma_map_sg);
 
-/*
- * Map a single page of the indicated size for DMA in streaming mode.
- * The 32-bit bus address to use is returned.
- *
- * Device ownership issues as mentioned above for dma_map_single are
- * the same here.
- */
 dma_addr_t dma_map_page(struct device *dev, struct page *page, unsigned long offset,
 			size_t size, enum dma_data_direction direction)
 {
-- 
1.5.6.5


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

* Re: [PATCH -mm] frv: remove the obsolete and unnecessary DMA API comments
  2010-02-12  6:04 [PATCH -mm] frv: remove the obsolete and unnecessary DMA API comments FUJITA Tomonori
@ 2010-02-17 10:03 ` David Howells
  2010-02-19  4:13   ` FUJITA Tomonori
  2010-02-19  8:52   ` David Howells
  0 siblings, 2 replies; 4+ messages in thread
From: David Howells @ 2010-02-17 10:03 UTC (permalink / raw)
  To: FUJITA Tomonori; +Cc: dhowells, linux-kernel, akpm


FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp> wrote:

> pci_dma_sync_single was obsoleted long ago.
> 
> All the comments are generic, not architecture specific, simply
> describes some of the DMA-API (and frv has the same comments in three
> files). Documentation/DMA-API.txt have more detailed descriptions.
> 
> This removes the above obsolete and unnecessary DMA API
> comments. Let's describe the DMA API in only
> Documentation/DMA-API.txt.

I'm okay with this, _provided_ you put a pointer in a banner comment at the
top of the file to Documentation/DMA-API.txt.

David

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

* Re: [PATCH -mm] frv: remove the obsolete and unnecessary DMA API comments
  2010-02-17 10:03 ` David Howells
@ 2010-02-19  4:13   ` FUJITA Tomonori
  2010-02-19  8:52   ` David Howells
  1 sibling, 0 replies; 4+ messages in thread
From: FUJITA Tomonori @ 2010-02-19  4:13 UTC (permalink / raw)
  To: dhowells; +Cc: fujita.tomonori, linux-kernel, akpm

On Wed, 17 Feb 2010 10:03:42 +0000
David Howells <dhowells@redhat.com> wrote:

> FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp> wrote:
> 
> > pci_dma_sync_single was obsoleted long ago.
> > 
> > All the comments are generic, not architecture specific, simply
> > describes some of the DMA-API (and frv has the same comments in three
> > files). Documentation/DMA-API.txt have more detailed descriptions.
> > 
> > This removes the above obsolete and unnecessary DMA API
> > comments. Let's describe the DMA API in only
> > Documentation/DMA-API.txt.
> 
> I'm okay with this, _provided_ you put a pointer in a banner comment at the
> top of the file to Documentation/DMA-API.txt.

How about this?

=
From: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
Subject: [PATCH] frv: add a pointer to Documentation/DMA-API.txt

Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
---
 arch/frv/include/asm/dma-mapping.h |    5 +++++
 1 files changed, 5 insertions(+), 0 deletions(-)

diff --git a/arch/frv/include/asm/dma-mapping.h b/arch/frv/include/asm/dma-mapping.h
index 20cca40..6af5d83 100644
--- a/arch/frv/include/asm/dma-mapping.h
+++ b/arch/frv/include/asm/dma-mapping.h
@@ -7,6 +7,11 @@
 #include <asm/scatterlist.h>
 #include <asm/io.h>
 
+/*
+ * See Documentation/DMA-API.txt for the description of how the
+ * following DMA API should work.
+ */
+
 #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)
 
-- 
1.6.5


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

* Re: [PATCH -mm] frv: remove the obsolete and unnecessary DMA API comments
  2010-02-17 10:03 ` David Howells
  2010-02-19  4:13   ` FUJITA Tomonori
@ 2010-02-19  8:52   ` David Howells
  1 sibling, 0 replies; 4+ messages in thread
From: David Howells @ 2010-02-19  8:52 UTC (permalink / raw)
  To: FUJITA Tomonori; +Cc: dhowells, linux-kernel, akpm

FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp> wrote:

> +/*
> + * See Documentation/DMA-API.txt for the description of how the
> + * following DMA API should work.
> + */
> +
>  #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)

Yep, that'd do.  And for MN10300.

David

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

end of thread, other threads:[~2010-02-19  8:53 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-02-12  6:04 [PATCH -mm] frv: remove the obsolete and unnecessary DMA API comments FUJITA Tomonori
2010-02-17 10:03 ` David Howells
2010-02-19  4:13   ` FUJITA Tomonori
2010-02-19  8:52   ` David Howells

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