[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <1414245442-4306-3-git-send-email-stefano.stabellini@eu.citrix.com>
Date: Sat, 25 Oct 2014 14:57:18 +0100
From: Stefano Stabellini <stefano.stabellini@...citrix.com>
To: <xen-devel@...ts.xensource.com>
CC: <konrad.wilk@...cle.com>, <Ian.Campbell@...rix.com>,
<david.vrabel@...rix.com>, <linux-kernel@...r.kernel.org>,
<Stefano.Stabellini@...citrix.com>,
<linux-arm-kernel@...ts.infradead.org>,
Stefano Stabellini <stefano.stabellini@...citrix.com>,
<catalin.marinas@....com>, <Will.Deacon@....com>
Subject: [PATCH v6 3/7] xen/arm: introduce is_dma_coherent
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@...citrix.com>
CC: catalin.marinas@....com
CC: Will.Deacon@....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
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists