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: 39529 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-la0-f71.google.com (mail-la0-f71.google.com [209.85.215.71]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id DBBEB24026 for ; Sat, 25 Oct 2014 14:01:57 +0000 (UTC) Received: by mail-la0-f71.google.com with SMTP id gi9sf2680411lab.2 for ; Sat, 25 Oct 2014 07:01:56 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:delivered-to:from:to:date:message-id:in-reply-to :references:mime-version:cc:subject:precedence:list-id :list-unsubscribe:list-post:list-help:list-subscribe:sender :errors-to:x-original-sender:x-original-authentication-results :mailing-list:list-archive:content-type:content-transfer-encoding; bh=bIFMVyd4rQAcixf0O/EUDMohFt8pHhx5staS1zOk+iI=; b=YPhs9GH6z0RmUb25IBG8fQ+3zWs/L3AWkcrQihfOsgAEjhIc9Q4zljf8fT0WhHHfV2 21cSfEg2TdxwwNuemqL3mNFBQHk/j2BrzsyFX0NrCMbRpT05WpMXpp96I4aQqCiBWpRC i8m0Y7E6UrXOjCXp/Cmbo9NiiuJn1ur4G8wrXaXKLKJktwh9NdaiLU/vU+4uBVCh5DvE qfHlGhkn80HyuUXBXHHF7W9AX0Bg+PqQBazSibF9eXRoKQ5IqlMwu+bEyxkTL1GLbYn4 rD4oYGXY1eAF7x0R1Wi/8qG4MWKNG/r9cbaBn9nnEq4n1Bm8/lRwqGxj/uatAS55JVQn Q80g== X-Gm-Message-State: ALoCoQlUhPNCy7+dZfm2KGXGjTEO7tZEPyDhvdIABcuG+hR9200LiY+Xy8Amj4zKpHHuIbfYZ61/ X-Received: by 10.180.96.101 with SMTP id dr5mr1971290wib.0.1414245716722; Sat, 25 Oct 2014 07:01:56 -0700 (PDT) X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.27.129 with SMTP id t1ls492960lag.53.gmail; Sat, 25 Oct 2014 07:01:56 -0700 (PDT) X-Received: by 10.112.140.135 with SMTP id rg7mr11263835lbb.24.1414245716225; Sat, 25 Oct 2014 07:01:56 -0700 (PDT) Received: from mail-lb0-f182.google.com (mail-lb0-f182.google.com. [209.85.217.182]) by mx.google.com with ESMTPS id lm8si11517026lac.7.2014.10.25.07.01.56 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Sat, 25 Oct 2014 07:01:56 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.217.182 as permitted sender) client-ip=209.85.217.182; Received: by mail-lb0-f182.google.com with SMTP id f15so2608417lbj.41 for ; Sat, 25 Oct 2014 07:01:56 -0700 (PDT) X-Received: by 10.112.12.35 with SMTP id v3mr11125758lbb.80.1414245716126; Sat, 25 Oct 2014 07:01:56 -0700 (PDT) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patch@linaro.org Received: by 10.112.84.229 with SMTP id c5csp42504lbz; Sat, 25 Oct 2014 07:01:55 -0700 (PDT) X-Received: by 10.53.11.1 with SMTP id ee1mr6415674vdd.19.1414245714187; Sat, 25 Oct 2014 07:01:54 -0700 (PDT) Received: from lists.xen.org (lists.xen.org. [50.57.142.19]) by mx.google.com with ESMTPS id m10si4023206vcz.78.2014.10.25.07.01.53 for (version=TLSv1 cipher=RC4-SHA bits=128/128); Sat, 25 Oct 2014 07:01:54 -0700 (PDT) Received-SPF: none (google.com: xen-devel-bounces@lists.xen.org does not designate permitted sender hosts) client-ip=50.57.142.19; Received: from localhost ([127.0.0.1] helo=lists.xen.org) by lists.xen.org with esmtp (Exim 4.72) (envelope-from ) id 1Xi1t1-0000D2-QC; Sat, 25 Oct 2014 14:00:07 +0000 Received: from mail6.bemta3.messagelabs.com ([195.245.230.39]) by lists.xen.org with esmtp (Exim 4.72) (envelope-from ) id 1Xi1sz-0000C6-TK for xen-devel@lists.xensource.com; Sat, 25 Oct 2014 14:00:06 +0000 Received: from [85.158.137.68] by server-15.bemta-3.messagelabs.com id EF/8D-02823-5ECAB445; Sat, 25 Oct 2014 14:00:05 +0000 X-Env-Sender: Stefano.Stabellini@citrix.com X-Msg-Ref: server-4.tower-31.messagelabs.com!1414245602!11481389!3 X-Originating-IP: [66.165.176.89] X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: VHJ1c3RlZCBJUDogNjYuMTY1LjE3Ni44OSA9PiAyMDMwMDc=\n X-StarScan-Received: X-StarScan-Version: 6.12.3; banners=-,-,- X-VirusChecked: Checked Received: (qmail 12797 invoked from network); 25 Oct 2014 14:00:04 -0000 Received: from smtp.citrix.com (HELO SMTP.CITRIX.COM) (66.165.176.89) by server-4.tower-31.messagelabs.com with RC4-SHA encrypted SMTP; 25 Oct 2014 14:00:04 -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: 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 Cc: Ian.Campbell@citrix.com, Stefano Stabellini , catalin.marinas@arm.com, Will.Deacon@arm.com, linux-kernel@vger.kernel.org, david.vrabel@citrix.com, linux-arm-kernel@lists.infradead.org Subject: [Xen-devel] [PATCH v6 3/7] xen/arm: introduce is_dma_coherent X-BeenThere: xen-devel@lists.xen.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: List-Unsubscribe: , List-Post: , List-Help: , List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org X-Removed-Original-Auth: Dkim didn't pass. X-Original-Sender: stefano.stabellini@eu.citrix.com X-Original-Authentication-Results: mx.google.com; spf=pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.217.182 as permitted sender) smtp.mail=patch+caf_=patchwork-forward=linaro.org@linaro.org Mailing-list: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org X-Google-Group-Id: 836684582541 List-Archive: 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,