mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
To: <xen-devel@lists.xensource.com>
Cc: <konrad.wilk@oracle.com>, <Ian.Campbell@citrix.com>,
	<david.vrabel@citrix.com>, <linux-kernel@vger.kernel.org>,
	<Stefano.Stabellini@eu.citrix.com>,
	<linux-arm-kernel@lists.infradead.org>,
	Stefano Stabellini <stefano.stabellini@eu.citrix.com>,
	<catalin.marinas@arm.com>, <Will.Deacon@arm.com>
Subject: [PATCH v6 3/7] xen/arm: introduce is_dma_coherent
Date: Sat, 25 Oct 2014 14:57:18 +0100	[thread overview]
Message-ID: <1414245442-4306-3-git-send-email-stefano.stabellini@eu.citrix.com> (raw)
In-Reply-To: <alpine.DEB.2.02.1410251450180.22875@kaball.uk.xensource.com>

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


  parent reply	other threads:[~2014-10-25 18:25 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-10-25 13:56 [PATCH v6 0/6] introduce GNTTABOP_cache_flush Stefano Stabellini
2014-10-25 13:57 ` [PATCH v6 1/7] xen/arm: remove handling of XENFEAT_grant_map_identity Stefano Stabellini
2014-10-25 13:57 ` [PATCH v6 2/7] xen/arm: remove outer_*_range call Stefano Stabellini
2014-10-25 13:57 ` Stefano Stabellini [this message]
2014-10-25 13:57 ` [PATCH v6 4/7] xen/arm: use is_dma_coherent Stefano Stabellini
2014-10-25 13:57 ` [PATCH v6 5/7] xen/arm/arm64: merge xen/mm32.c into xen/mm.c Stefano Stabellini
2014-10-25 13:57 ` [PATCH v6 6/7] xen/arm/arm64: introduce xen_arch_need_swiotlb Stefano Stabellini
2014-10-25 13:57 ` [PATCH v6 7/7] xen/arm: introduce GNTTABOP_cache_flush Stefano Stabellini

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=1414245442-4306-3-git-send-email-stefano.stabellini@eu.citrix.com \
    --to=stefano.stabellini@eu.citrix.com \
    --cc=Ian.Campbell@citrix.com \
    --cc=Will.Deacon@arm.com \
    --cc=catalin.marinas@arm.com \
    --cc=david.vrabel@citrix.com \
    --cc=konrad.wilk@oracle.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=xen-devel@lists.xensource.com \
    /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

all inboxes | Powered by JetHome®