lkml.org 
[lkml]   [2014]   [Oct]   [25]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[PATCH v6 3/7] xen/arm: introduce is_dma_coherent
Date
Introduce a simple utility function that returns whether a device is dma
coherent based on device tree information.

Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
CC: catalin.marinas@arm.com
CC: Will.Deacon@arm.com
---
arch/arm/xen/mm32.c | 6 ++++++
1 file changed, 6 insertions(+)

diff --git a/arch/arm/xen/mm32.c b/arch/arm/xen/mm32.c
index 6153d61..2b259f1 100644
--- a/arch/arm/xen/mm32.c
+++ b/arch/arm/xen/mm32.c
@@ -2,10 +2,16 @@
#include <linux/dma-mapping.h>
#include <linux/gfp.h>
#include <linux/highmem.h>
+#include <linux/of_address.h>

#include <xen/features.h>


+static inline bool is_dma_coherent(struct device *dev)
+{
+ return of_dma_is_coherent(dev->of_node);
+}
+
/* functions called by SWIOTLB */

static void dma_cache_maint(dma_addr_t handle, unsigned long offset,
--
1.7.10.4


\
 
 \ /
  Last update: 2014-10-25 21:01    [W:0.034 / U:1.564 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site