linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: Marek Szyprowski <m.szyprowski@samsung.com>
To: linux-kernel@vger.kernel.org
Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>,
	Thomas Gleixner <tglx@linutronix.de>,
	Andrew Morton <akpm@linux-foundation.org>,
	Arnd Bergmann <arnd@arndb.de>,
	Stephen Rothwell <sfr@canb.auug.org.au>,
	FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>,
	microblaze-uclinux@itee.uq.edu.au, linux-arch@vger.kernel.org,
	x86@kernel.org, linux-sh@vger.kernel.org,
	linux-alpha@vger.kernel.org, sparclinux@vger.kernel.org,
	linux-ia64@vger.kernel.org, linuxppc-dev@lists.ozlabs.org,
	linux-mips@linux-mips.org, discuss@x86-64.org,
	linux-arm-kernel@lists.infradead.org, linux-mm@kvack.org,
	linaro-mm-sig@lists.linaro.org, Jonathan Corbet <corbet@lwn.net>,
	Marek Szyprowski <m.szyprowski@samsung.com>,
	Kyungmin Park <kyungmin.park@samsung.com>,
	Andrzej Pietrasiewicz <andrzej.p@samsung.com>,
	Kevin Cernekee <cernekee@gmail.com>,
	Dezhong Diao <dediao@cisco.com>,
	Richard Kuo <rkuo@codeaurora.org>,
	"David S. Miller" <davem@davemloft.net>,
	Michal Simek <monstr@monstr.eu>,
	Guan Xuetao <gxt@mprc.pku.edu.cn>,
	Paul Mundt <lethal@linux-sh.org>,
	Richard Henderson <rth@twiddle.net>,
	Ivan Kokshaysky <ink@jurassic.park.msu.ru>,
	Matt Turner <mattst88@gmail.com>, Tony Luck <tony.luck@intel.com>,
	Fenghua Yu <fenghua.yu@intel.com>
Subject: [PATCHv2 10/14] Hexagon: adapt for dma_map_ops changes
Date: Tue, 27 Mar 2012 15:42:44 +0200	[thread overview]
Message-ID: <1332855768-32583-11-git-send-email-m.szyprowski@samsung.com> (raw)
In-Reply-To: <1332855768-32583-1-git-send-email-m.szyprowski@samsung.com>

Adapt core Hexagon architecture code for dma_map_ops changes: replace
alloc/free_coherent with generic alloc/free methods.

Signed-off-by: Marek Szyprowski <m.szyprowski@samsung.com>
Acked-by: Kyungmin Park <kyungmin.park@samsung.com>
Reviewed-by: Arnd Bergmann <arnd@arndb.de>
---
 arch/hexagon/include/asm/dma-mapping.h |   18 ++++++++++++------
 arch/hexagon/kernel/dma.c              |    9 +++++----
 2 files changed, 17 insertions(+), 10 deletions(-)

diff --git a/arch/hexagon/include/asm/dma-mapping.h b/arch/hexagon/include/asm/dma-mapping.h
index 448b224..233ed3d 100644
--- a/arch/hexagon/include/asm/dma-mapping.h
+++ b/arch/hexagon/include/asm/dma-mapping.h
@@ -71,29 +71,35 @@ static inline int dma_mapping_error(struct device *dev, dma_addr_t dma_addr)
 	return (dma_addr == bad_dma_address);
 }
 
-static inline void *dma_alloc_coherent(struct device *dev, size_t size,
-				       dma_addr_t *dma_handle, gfp_t flag)
+#define dma_alloc_coherent(d,s,h,f)	dma_alloc_attrs(d,s,h,f,NULL)
+
+static inline void *dma_alloc_attrs(struct device *dev, size_t size,
+				    dma_addr_t *dma_handle, gfp_t flag,
+				    struct dma_attrs *attrs)
 {
 	void *ret;
 	struct dma_map_ops *ops = get_dma_ops(dev);
 
 	BUG_ON(!dma_ops);
 
-	ret = ops->alloc_coherent(dev, size, dma_handle, flag);
+	ret = ops->alloc(dev, size, dma_handle, flag, attrs);
 
 	debug_dma_alloc_coherent(dev, size, *dma_handle, ret);
 
 	return ret;
 }
 
-static inline void dma_free_coherent(struct device *dev, size_t size,
-				     void *cpu_addr, dma_addr_t dma_handle)
+#define dma_free_coherent(d,s,c,h) dma_free_attrs(d,s,c,h,NULL)
+
+static inline void dma_free_attrs(struct device *dev, size_t size,
+				  void *cpu_addr, dma_addr_t dma_handle,
+				  struct dma_attrs *attrs)
 {
 	struct dma_map_ops *dma_ops = get_dma_ops(dev);
 
 	BUG_ON(!dma_ops);
 
-	dma_ops->free_coherent(dev, size, cpu_addr, dma_handle);
+	dma_ops->free(dev, size, cpu_addr, dma_handle, attrs);
 
 	debug_dma_free_coherent(dev, size, cpu_addr, dma_handle);
 }
diff --git a/arch/hexagon/kernel/dma.c b/arch/hexagon/kernel/dma.c
index e711ace..3730221 100644
--- a/arch/hexagon/kernel/dma.c
+++ b/arch/hexagon/kernel/dma.c
@@ -54,7 +54,8 @@ static struct gen_pool *coherent_pool;
 /* Allocates from a pool of uncached memory that was reserved at boot time */
 
 void *hexagon_dma_alloc_coherent(struct device *dev, size_t size,
-				 dma_addr_t *dma_addr, gfp_t flag)
+				 dma_addr_t *dma_addr, gfp_t flag,
+				 struct dma_attrs *attrs)
 {
 	void *ret;
 
@@ -81,7 +82,7 @@ void *hexagon_dma_alloc_coherent(struct device *dev, size_t size,
 }
 
 static void hexagon_free_coherent(struct device *dev, size_t size, void *vaddr,
-				  dma_addr_t dma_addr)
+				  dma_addr_t dma_addr, struct dma_attrs *attrs)
 {
 	gen_pool_free(coherent_pool, (unsigned long) vaddr, size);
 }
@@ -202,8 +203,8 @@ static void hexagon_sync_single_for_device(struct device *dev,
 }
 
 struct dma_map_ops hexagon_dma_ops = {
-	.alloc_coherent	= hexagon_dma_alloc_coherent,
-	.free_coherent	= hexagon_free_coherent,
+	.alloc		= hexagon_dma_alloc_coherent,
+	.free		= hexagon_free_coherent,
 	.map_sg		= hexagon_map_sg,
 	.map_page	= hexagon_map_page,
 	.sync_single_for_cpu = hexagon_sync_single_for_cpu,
-- 
1.7.1.569.g6f426

--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org.  For more info on Linux MM,
see: http://www.linux-mm.org/ .
Fight unfair telecom internet charges in Canada: sign http://stopthemeter.ca/
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>

  parent reply	other threads:[~2012-03-27 13:43 UTC|newest]

Thread overview: 24+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-03-27 13:42 [PATCHv2 00/14] DMA-mapping framework redesign preparation Marek Szyprowski
2012-03-27 13:42 ` [PATCHv2 01/14] common: dma-mapping: introduce alloc_attrs and free_attrs methods Marek Szyprowski
2012-03-28 11:29   ` Sergei Shtylyov
2012-03-28 14:38     ` Marek Szyprowski
2012-03-27 13:42 ` [PATCHv2 02/14] X86 & IA64: adapt for dma_map_ops changes Marek Szyprowski
2012-03-29 13:51   ` Thomas Gleixner
2012-03-27 13:42 ` [PATCHv2 03/14] MIPS: " Marek Szyprowski
2012-03-27 13:42 ` [PATCHv2 04/14] PowerPC: " Marek Szyprowski
2012-03-28  3:56   ` Benjamin Herrenschmidt
2012-03-27 13:42 ` [PATCHv2 05/14] SPARC: " Marek Szyprowski
2012-03-27 13:42 ` [PATCHv2 06/14] Alpha: " Marek Szyprowski
2012-03-27 15:56   ` Matt Turner
2012-03-27 13:42 ` [PATCHv2 07/14] SH: " Marek Szyprowski
2012-03-28  4:15   ` Paul Mundt
2012-03-27 13:42 ` [PATCHv2 08/14] Microblaze: " Marek Szyprowski
2012-03-27 13:42 ` [PATCHv2 09/14] Unicore32: " Marek Szyprowski
2012-03-28  2:22   ` Guan Xuetao
2012-03-28  6:10     ` Marek Szyprowski
2012-03-27 13:42 ` Marek Szyprowski [this message]
2012-03-27 16:41   ` [PATCHv2 10/14] Hexagon: " Richard Kuo
2012-03-27 13:42 ` [PATCHv2 11/14] common: dma-mapping: remove old alloc_coherent and free_coherent methods Marek Szyprowski
2012-03-27 13:42 ` [PATCHv2 12/14] common: dma-mapping: introduce mmap method Marek Szyprowski
2012-03-27 13:42 ` [PATCHv2 13/14] common: DMA-mapping: add WRITE_COMBINE attribute Marek Szyprowski
2012-03-27 13:42 ` [PATCHv2 14/14] common: DMA-mapping: add NON-CONSISTENT attribute Marek Szyprowski

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=1332855768-32583-11-git-send-email-m.szyprowski@samsung.com \
    --to=m.szyprowski@samsung.com \
    --cc=akpm@linux-foundation.org \
    --cc=andrzej.p@samsung.com \
    --cc=arnd@arndb.de \
    --cc=benh@kernel.crashing.org \
    --cc=cernekee@gmail.com \
    --cc=corbet@lwn.net \
    --cc=davem@davemloft.net \
    --cc=dediao@cisco.com \
    --cc=discuss@x86-64.org \
    --cc=fenghua.yu@intel.com \
    --cc=fujita.tomonori@lab.ntt.co.jp \
    --cc=gxt@mprc.pku.edu.cn \
    --cc=ink@jurassic.park.msu.ru \
    --cc=kyungmin.park@samsung.com \
    --cc=lethal@linux-sh.org \
    --cc=linaro-mm-sig@lists.linaro.org \
    --cc=linux-alpha@vger.kernel.org \
    --cc=linux-arch@vger.kernel.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-ia64@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mips@linux-mips.org \
    --cc=linux-mm@kvack.org \
    --cc=linux-sh@vger.kernel.org \
    --cc=linuxppc-dev@lists.ozlabs.org \
    --cc=mattst88@gmail.com \
    --cc=microblaze-uclinux@itee.uq.edu.au \
    --cc=monstr@monstr.eu \
    --cc=rkuo@codeaurora.org \
    --cc=rth@twiddle.net \
    --cc=sfr@canb.auug.org.au \
    --cc=sparclinux@vger.kernel.org \
    --cc=tglx@linutronix.de \
    --cc=tony.luck@intel.com \
    --cc=x86@kernel.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