netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Christoph Hellwig <hch@lst.de>
To: linux-scsi@vger.kernel.org, linux-serial@vger.kernel.org,
	netdev@vger.kernel.org, linux-metag@vger.kernel.org,
	nios2-dev@lists.rocketboards.org, linux-fbdev@vger.kernel.org,
	alsa-devel@alsa-project.org
Cc: linux-kernel@vger.kernel.org
Subject: [PATCH 11/11] dma-mapping: remove dma_alloc_noncoherent and dma_free_noncoherent
Date: Fri, 16 Jun 2017 09:17:16 +0200	[thread overview]
Message-ID: <20170616071716.17321-12-hch@lst.de> (raw)
In-Reply-To: <20170616071716.17321-1-hch@lst.de>

No users left, everyone switched to the _attrs versions.

Signed-off-by: Christoph Hellwig <hch@lst.de>
---
 Documentation/DMA-API.txt            | 30 ++++++++++++++++--------------
 arch/metag/include/asm/dma-mapping.h |  2 +-
 arch/nios2/include/asm/dma-mapping.h |  2 +-
 arch/tile/include/asm/dma-mapping.h  |  4 ++--
 include/linux/dma-mapping.h          | 14 --------------
 5 files changed, 20 insertions(+), 32 deletions(-)

diff --git a/Documentation/DMA-API.txt b/Documentation/DMA-API.txt
index 6b20128fab8a..c55782f68348 100644
--- a/Documentation/DMA-API.txt
+++ b/Documentation/DMA-API.txt
@@ -451,14 +451,15 @@ processor and an I/O device, you should not be using this part of the
 API at all.
 
 void *
-dma_alloc_noncoherent(struct device *dev, size_t size,
-			       dma_addr_t *dma_handle, gfp_t flag)
+dma_alloc_attrs(struct device *dev, size_t size, dma_addr_t *dma_handle,
+		gfp_t flag, unsigned long attrs)
 
-Identical to dma_alloc_coherent() except that the platform will
-choose to return either consistent or non-consistent memory as it sees
-fit.  By using this API, you are guaranteeing to the platform that you
-have all the correct and necessary sync points for this memory in the
-driver should it choose to return non-consistent memory.
+Identical to dma_alloc_coherent() except that when the
+DMA_ATTR_NON_CONSISTENT flags is passed in the attrs argument, the
+platform will choose to return either consistent or non-consistent memory
+as it sees fit.  By using this API, you are guaranteeing to the platform
+that you have all the correct and necessary sync points for this memory
+in the driver should it choose to return non-consistent memory.
 
 Note: where the platform can return consistent memory, it will
 guarantee that the sync points become nops.
@@ -469,12 +470,13 @@ required to work on one of the rare (usually non-PCI) architectures
 that simply cannot make consistent memory.
 
 void
-dma_free_noncoherent(struct device *dev, size_t size, void *cpu_addr,
-			      dma_addr_t dma_handle)
+dma_free_attrs(struct device *dev, size_t size, void *cpu_addr,
+	       dma_addr_t dma_handle, unsigned long attrs)
 
-Free memory allocated by the nonconsistent API.  All parameters must
-be identical to those passed in (and returned by
-dma_alloc_noncoherent()).
+Free memory allocated by the dma_alloc_attrs().  All parameters common
+parameters must identical to those otherwise passed to dma_fre_coherent,
+and the attrs argument must be identical to the attrs passed to
+dma_alloc_attrs().
 
 int
 dma_get_cache_alignment(void)
@@ -492,8 +494,8 @@ void
 dma_cache_sync(struct device *dev, void *vaddr, size_t size,
 	       enum dma_data_direction direction)
 
-Do a partial sync of memory that was allocated by
-dma_alloc_noncoherent(), starting at virtual address vaddr and
+Do a partial sync of memory that was allocated by dma_alloc_attrs() with
+the DMA_ATTR_NON_CONSISTENT flag starting at virtual address vaddr and
 continuing on for size.  Again, you *must* observe the cache line
 boundaries when doing this.
 
diff --git a/arch/metag/include/asm/dma-mapping.h b/arch/metag/include/asm/dma-mapping.h
index fad3dc3cb210..ea573be2b6d0 100644
--- a/arch/metag/include/asm/dma-mapping.h
+++ b/arch/metag/include/asm/dma-mapping.h
@@ -9,7 +9,7 @@ static inline const struct dma_map_ops *get_arch_dma_ops(struct bus_type *bus)
 }
 
 /*
- * dma_alloc_noncoherent() returns non-cacheable memory, so there's no need to
+ * dma_alloc_attrs() always returns non-cacheable memory, so there's no need to
  * do any flushing here.
  */
 static inline void
diff --git a/arch/nios2/include/asm/dma-mapping.h b/arch/nios2/include/asm/dma-mapping.h
index 7b3c6f280293..f8dc62222741 100644
--- a/arch/nios2/include/asm/dma-mapping.h
+++ b/arch/nios2/include/asm/dma-mapping.h
@@ -18,7 +18,7 @@ static inline const struct dma_map_ops *get_arch_dma_ops(struct bus_type *bus)
 }
 
 /*
- * dma_alloc_noncoherent() returns non-cacheable memory, so there's no need to
+ * dma_alloc_attrs() always returns non-cacheable memory, so there's no need to
  * do any flushing here.
  */
 static inline void dma_cache_sync(struct device *dev, void *vaddr, size_t size,
diff --git a/arch/tile/include/asm/dma-mapping.h b/arch/tile/include/asm/dma-mapping.h
index bbc71a29b2c6..7061dc8af43a 100644
--- a/arch/tile/include/asm/dma-mapping.h
+++ b/arch/tile/include/asm/dma-mapping.h
@@ -68,8 +68,8 @@ static inline bool dma_capable(struct device *dev, dma_addr_t addr, size_t size)
 int dma_set_mask(struct device *dev, u64 mask);
 
 /*
- * dma_alloc_noncoherent() is #defined to return coherent memory,
- * so there's no need to do any flushing here.
+ * dma_alloc_attrs() always returns non-cacheable memory, so there's no need to
+ * do any flushing here.
  */
 static inline void dma_cache_sync(struct device *dev, void *vaddr, size_t size,
 				  enum dma_data_direction direction)
diff --git a/include/linux/dma-mapping.h b/include/linux/dma-mapping.h
index 6cdf5634906d..e8861e7df6ab 100644
--- a/include/linux/dma-mapping.h
+++ b/include/linux/dma-mapping.h
@@ -526,20 +526,6 @@ static inline void dma_free_coherent(struct device *dev, size_t size,
 	return dma_free_attrs(dev, size, cpu_addr, dma_handle, 0);
 }
 
-static inline void *dma_alloc_noncoherent(struct device *dev, size_t size,
-		dma_addr_t *dma_handle, gfp_t gfp)
-{
-	return dma_alloc_attrs(dev, size, dma_handle, gfp,
-			       DMA_ATTR_NON_CONSISTENT);
-}
-
-static inline void dma_free_noncoherent(struct device *dev, size_t size,
-		void *cpu_addr, dma_addr_t dma_handle)
-{
-	dma_free_attrs(dev, size, cpu_addr, dma_handle,
-		       DMA_ATTR_NON_CONSISTENT);
-}
-
 static inline int dma_mapping_error(struct device *dev, dma_addr_t dma_addr)
 {
 	debug_dma_mapping_error(dev, dma_addr);
-- 
2.11.0

  parent reply	other threads:[~2017-06-16  7:17 UTC|newest]

Thread overview: 25+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-06-16  7:17 remove dma_alloc_noncoherent Christoph Hellwig
2017-06-16  7:17 ` [PATCH 01/11] dma-mapping: remove dmam_free_noncoherent Christoph Hellwig
2017-06-26  7:07   ` Christoph Hellwig
     [not found]     ` <20170626070715.GA12711-wEGCiKHe2LqWVfeAwA7xHQ@public.gmane.org>
2017-06-26 20:53       ` Tejun Heo
2017-06-16  7:17 ` [PATCH 02/11] dma-mapping: replace dmam_alloc_noncoherent with dmam_alloc_attrs Christoph Hellwig
2017-06-26  7:07   ` Christoph Hellwig
2017-06-26 20:53     ` Tejun Heo
2017-06-16  7:17 ` [PATCH 03/11] au1100fb: remove a bogus dma_free_nonconsistent call Christoph Hellwig
     [not found]   ` <CGME20170619111507epcas5p47fd18b90a02d827da256ff4ebbda8089@epcas5p4.samsung.com>
2017-06-19 11:15     ` Bartlomiej Zolnierkiewicz
2017-06-20  9:10       ` Christoph Hellwig
     [not found]         ` <CGME20170620105805epcas1p4ea41a72356c35f2a16197b970939fb65@epcas1p4.samsung.com>
2017-06-20 10:58           ` Bartlomiej Zolnierkiewicz
2017-06-16  7:17 ` [PATCH 04/11] sound/hal2: switch to dma_alloc_attrs Christoph Hellwig
2017-06-16  8:49   ` [alsa-devel] " Takashi Iwai
     [not found]     ` <s5h1sqkb9l7.wl-tiwai-l3A5Bk7waGM@public.gmane.org>
2017-06-16  8:51       ` Christoph Hellwig
2017-06-16  8:57         ` Takashi Iwai
2017-06-16  7:17 ` [PATCH 05/11] serial/mpsc: " Christoph Hellwig
2017-06-16  7:17 ` [PATCH 06/11] sigwd93: " Christoph Hellwig
     [not found]   ` <20170616071716.17321-7-hch-jcswGhMUV9g@public.gmane.org>
2017-06-26 18:20     ` Martin K. Petersen
2017-06-16  7:17 ` [PATCH 07/11] 53c700: " Christoph Hellwig
2017-06-26 18:21   ` Martin K. Petersen
2017-06-16  7:17 ` [PATCH 08/11] sgiseeq: " Christoph Hellwig
2017-06-16  7:17 ` [PATCH 09/11] au1000_eth: " Christoph Hellwig
2017-06-16  7:17 ` [PATCH 10/11] i825xx: switch to " Christoph Hellwig
2017-06-16  7:17 ` Christoph Hellwig [this message]
2017-06-20 12:44 ` remove dma_alloc_noncoherent David Laight

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20170616071716.17321-12-hch@lst.de \
    --to=hch@lst.de \
    --cc=alsa-devel@alsa-project.org \
    --cc=linux-fbdev@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-metag@vger.kernel.org \
    --cc=linux-scsi@vger.kernel.org \
    --cc=linux-serial@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=nios2-dev@lists.rocketboards.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).