From patchwork Fri Oct 10 11:51:45 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stefano Stabellini X-Patchwork-Id: 38563 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-wg0-f69.google.com (mail-wg0-f69.google.com [74.125.82.69]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 38C83202DB for ; Fri, 10 Oct 2014 11:55:08 +0000 (UTC) Received: by mail-wg0-f69.google.com with SMTP id b13sf1994272wgh.0 for ; Fri, 10 Oct 2014 04:55:07 -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=x+t1Aes7FsMzoSXjPSRl4pp9EmftHtnwXdTyZheGwDU=; b=FUciTIweu0GfUvuUSRPDgDcOepTccexjEmD6twHk6WmKlx2vLGLlmetfBG1F0zXbDn xS4L8dHU90kJlCCjAoA/XsUfVAAnfzatJfYm2RXLLXPx2MeQ26GN2xcj/txmCOJCZcz0 qUlTN0X0Rbst8RNEdgNaOtnSU9kYhO5sBjkzbw7ByDCFw79/kjGx/Kgni9el8wjnm/5g pxBXEf4mIDwZRHuWNcdZV5azJQOEGm8Ekin+Fux5FXZKMvZVWlrUOvLoDSchw190mRsZ 69/AivEOsLrtaqt2pHHLZ5KnFe/PwntTwSOc4AVKO45gP3aZ6z/kjFfAp+fs5ukxLEYl A0oQ== X-Gm-Message-State: ALoCoQnyGMVSH10oH4uCiM6sXuP7o9ec6AgWUJQiV55IuZFVBxPSCMVUKFQdJdc2VOHRhbDIApXp X-Received: by 10.112.198.226 with SMTP id jf2mr855379lbc.1.1412942107308; Fri, 10 Oct 2014 04:55:07 -0700 (PDT) X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.7.141 with SMTP id j13ls282722laa.5.gmail; Fri, 10 Oct 2014 04:55:06 -0700 (PDT) X-Received: by 10.152.27.40 with SMTP id q8mr2906098lag.92.1412942106839; Fri, 10 Oct 2014 04:55:06 -0700 (PDT) Received: from mail-la0-f41.google.com (mail-la0-f41.google.com [209.85.215.41]) by mx.google.com with ESMTPS id mi5si8868346lbc.61.2014.10.10.04.55.06 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Fri, 10 Oct 2014 04:55:06 -0700 (PDT) Received-SPF: temperror (google.com: error in processing during lookup of patch+caf_=patchwork-forward=linaro.org@linaro.org: DNS timeout) client-ip=209.85.215.41; Received: by mail-la0-f41.google.com with SMTP id pn19so3120563lab.14 for ; Fri, 10 Oct 2014 04:55:06 -0700 (PDT) X-Received: by 10.112.190.69 with SMTP id go5mr4204924lbc.32.1412942106590; Fri, 10 Oct 2014 04:55:06 -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 c5csp412850lbz; Fri, 10 Oct 2014 04:55:05 -0700 (PDT) X-Received: by 10.224.64.135 with SMTP id e7mr8158791qai.62.1412942104614; Fri, 10 Oct 2014 04:55:04 -0700 (PDT) Received: from lists.xen.org (lists.xen.org. [50.57.142.19]) by mx.google.com with ESMTPS id e74si10623579qgd.89.2014.10.10.04.55.04 for (version=TLSv1 cipher=RC4-SHA bits=128/128); Fri, 10 Oct 2014 04:55:04 -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 1XcYm1-0000fP-O0; Fri, 10 Oct 2014 11:54:17 +0000 Received: from mail6.bemta4.messagelabs.com ([85.158.143.247]) by lists.xen.org with esmtp (Exim 4.72) (envelope-from ) id 1XcYlz-0000eM-RC for xen-devel@lists.xensource.com; Fri, 10 Oct 2014 11:54:15 +0000 Received: from [85.158.143.35:38923] by server-2.bemta-4.messagelabs.com id 48/6C-04525-7E8C7345; Fri, 10 Oct 2014 11:54:15 +0000 X-Env-Sender: Stefano.Stabellini@citrix.com X-Msg-Ref: server-4.tower-21.messagelabs.com!1412942052!12048014!1 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 14578 invoked from network); 10 Oct 2014 11:54:14 -0000 Received: from smtp.citrix.com (HELO SMTP.CITRIX.COM) (66.165.176.89) by server-4.tower-21.messagelabs.com with RC4-SHA encrypted SMTP; 10 Oct 2014 11:54:14 -0000 X-IronPort-AV: E=Sophos;i="5.04,691,1406592000"; d="scan'208";a="180114185" Received: from ukmail1.uk.xensource.com (10.80.16.128) by smtprelay.citrix.com (10.13.107.78) with Microsoft SMTP Server id 14.3.181.6; Fri, 10 Oct 2014 07:54:09 -0400 Received: from kaball.uk.xensource.com ([10.80.2.59]) by ukmail1.uk.xensource.com with esmtp (Exim 4.69) (envelope-from ) id 1XcYln-0008ML-T7; Fri, 10 Oct 2014 12:54:03 +0100 From: Stefano Stabellini To: Date: Fri, 10 Oct 2014 12:51:45 +0100 Message-ID: <1412941908-5850-4-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 , linux-kernel@vger.kernel.org, david.vrabel@citrix.com, linux-arm-kernel@lists.infradead.org Subject: [Xen-devel] [PATCH v4 4/7] xen/arm: use 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=temperror (google.com: error in processing during lookup of patch+caf_=patchwork-forward=linaro.org@linaro.org: DNS timeout) 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: Use is_dma_coherent to check whether we need to issue cache maintenance operations rather than checking on the existence of a particular dma_ops function for the device. Signed-off-by: Stefano Stabellini Acked-by: Ian Campbell --- arch/arm/xen/mm32.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/arch/arm/xen/mm32.c b/arch/arm/xen/mm32.c index 6153d61..c7fa673 100644 --- a/arch/arm/xen/mm32.c +++ b/arch/arm/xen/mm32.c @@ -76,7 +76,7 @@ void xen_dma_unmap_page(struct device *hwdev, dma_addr_t handle, struct dma_attrs *attrs) { - if (!__generic_dma_ops(hwdev)->unmap_page) + if (is_dma_coherent(hwdev)) return; if (dma_get_attr(DMA_ATTR_SKIP_CPU_SYNC, attrs)) return; @@ -87,7 +87,7 @@ void xen_dma_unmap_page(struct device *hwdev, dma_addr_t handle, void xen_dma_sync_single_for_cpu(struct device *hwdev, dma_addr_t handle, size_t size, enum dma_data_direction dir) { - if (!__generic_dma_ops(hwdev)->sync_single_for_cpu) + if (is_dma_coherent(hwdev)) return; __xen_dma_page_dev_to_cpu(hwdev, handle, size, dir); } @@ -95,7 +95,7 @@ void xen_dma_sync_single_for_cpu(struct device *hwdev, void xen_dma_sync_single_for_device(struct device *hwdev, dma_addr_t handle, size_t size, enum dma_data_direction dir) { - if (!__generic_dma_ops(hwdev)->sync_single_for_device) + if (is_dma_coherent(hwdev)) return; __xen_dma_page_cpu_to_dev(hwdev, handle, size, dir); }