From patchwork Sat Oct 25 13:57:18 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stefano Stabellini X-Patchwork-Id: 5151351 Return-Path: X-Original-To: patchwork-linux-arm@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork2.web.kernel.org (Postfix) with ESMTP id F311FC11AC for ; Sat, 25 Oct 2014 14:03:40 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 26909202B8 for ; Sat, 25 Oct 2014 14:03:40 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.9]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 3741C2028D for ; Sat, 25 Oct 2014 14:03:39 +0000 (UTC) Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1Xi1uO-0004eU-V5; Sat, 25 Oct 2014 14:01:32 +0000 Received: from smtp.citrix.com ([66.165.176.89]) by bombadil.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1Xi1tf-0004Ai-5N for linux-arm-kernel@lists.infradead.org; Sat, 25 Oct 2014 14:00:47 +0000 X-IronPort-AV: E=Sophos;i="5.04,786,1406592000"; d="scan'208";a="184886129" Received: from ukmail1.uk.xensource.com (10.80.16.128) by smtprelay.citrix.com (10.13.107.79) with Microsoft SMTP Server id 14.3.181.6; Sat, 25 Oct 2014 10:00:00 -0400 Received: from kaball.uk.xensource.com ([10.80.2.59]) by ukmail1.uk.xensource.com with esmtp (Exim 4.69) (envelope-from ) id 1Xi1sp-0000C6-QA; Sat, 25 Oct 2014 14:59:55 +0100 From: Stefano Stabellini To: Subject: [PATCH v6 3/7] xen/arm: introduce is_dma_coherent Date: Sat, 25 Oct 2014 14:57:18 +0100 Message-ID: <1414245442-4306-3-git-send-email-stefano.stabellini@eu.citrix.com> X-Mailer: git-send-email 1.7.9.5 In-Reply-To: References: MIME-Version: 1.0 X-DLP: MIA1 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20141025_070047_414048_9FDDEFC4 X-CRM114-Status: UNSURE ( 7.41 ) X-CRM114-Notice: Please train this message. X-Spam-Score: -6.5 (------) Cc: Ian.Campbell@citrix.com, Stefano Stabellini , catalin.marinas@arm.com, konrad.wilk@oracle.com, Will.Deacon@arm.com, linux-kernel@vger.kernel.org, david.vrabel@citrix.com, linux-arm-kernel@lists.infradead.org X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Spam-Status: No, score=-3.4 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_NONE, RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Introduce a simple utility function that returns whether a device is dma coherent based on device tree information. Signed-off-by: Stefano Stabellini 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 #include #include +#include #include +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,