From patchwork Sat Oct 25 13:57:19 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stefano Stabellini X-Patchwork-Id: 39527 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-lb0-f198.google.com (mail-lb0-f198.google.com [209.85.217.198]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id B446C24026 for ; Sat, 25 Oct 2014 14:01:54 +0000 (UTC) Received: by mail-lb0-f198.google.com with SMTP id 10sf2680536lbg.1 for ; Sat, 25 Oct 2014 07:01:53 -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=SlSm49IrMta85WNHcBhNSinOJ6fdutzV3eeP5sswy6s=; b=mNzwBH4PziyP55tb/176TGnO3LpMefCB/ZR6rMA0M29smjCAmt4JHP5lkBbSFE6rnV kF9XtQ+S9WKJhgtebB0a6/RqySnYd+i6ITSR8PU5Z1XhejPOhAEXjrlZg6fb/uKaxYZb h60KgAhCC8EzLoqMryXsS40pYqj5KRl/1rnyaww8/YisZt7p+/3h9yUIo7/GOkxMKcOo WAnpIIJecEoG28EhiWCBu5fxl6pE5kpuoZUXdkF+ZQw1hWsXl1vQYr2zbkmuQe64hCP5 d9h6S+BF8URYjd2cO8i80Cvlvy+pMAxi+wIkirN8GHaiCguCZKjwTojvjrkTQJpFPM+x c+9w== X-Gm-Message-State: ALoCoQm+GU5HqEg/RwayqMLu8ymsgranKmAlXYrs7Y0c5HdHq8XpH1zsV1h1SQ0vH8IXy0qRR0Fs X-Received: by 10.112.55.10 with SMTP id n10mr16568lbp.14.1414245713523; Sat, 25 Oct 2014 07:01:53 -0700 (PDT) X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.234.233 with SMTP id uh9ls544412lac.70.gmail; Sat, 25 Oct 2014 07:01:53 -0700 (PDT) X-Received: by 10.152.87.98 with SMTP id w2mr10963794laz.27.1414245713345; Sat, 25 Oct 2014 07:01:53 -0700 (PDT) Received: from mail-lb0-f170.google.com (mail-lb0-f170.google.com. [209.85.217.170]) by mx.google.com with ESMTPS id dd4si11409126lad.100.2014.10.25.07.01.53 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Sat, 25 Oct 2014 07:01:53 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.217.170 as permitted sender) client-ip=209.85.217.170; Received: by mail-lb0-f170.google.com with SMTP id u10so3821696lbd.29 for ; Sat, 25 Oct 2014 07:01:53 -0700 (PDT) X-Received: by 10.112.77.74 with SMTP id q10mr11040477lbw.66.1414245713252; Sat, 25 Oct 2014 07:01:53 -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 c5csp42495lbz; Sat, 25 Oct 2014 07:01:52 -0700 (PDT) X-Received: by 10.52.139.194 with SMTP id ra2mr6422912vdb.25.1414245711878; Sat, 25 Oct 2014 07:01:51 -0700 (PDT) Received: from lists.xen.org (lists.xen.org. [50.57.142.19]) by mx.google.com with ESMTPS id ek18si4035323vcb.59.2014.10.25.07.01.51 for (version=TLSv1 cipher=RC4-SHA bits=128/128); Sat, 25 Oct 2014 07:01:51 -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 1Xi1t0-0000CU-Mx; Sat, 25 Oct 2014 14:00:06 +0000 Received: from mail6.bemta3.messagelabs.com ([195.245.230.39]) by lists.xen.org with esmtp (Exim 4.72) (envelope-from ) id 1Xi1sz-0000Bv-5t for xen-devel@lists.xensource.com; Sat, 25 Oct 2014 14:00:05 +0000 Received: from [85.158.137.68] by server-8.bemta-3.messagelabs.com id 78/BE-03668-4ECAB445; Sat, 25 Oct 2014 14:00:04 +0000 X-Env-Sender: Stefano.Stabellini@citrix.com X-Msg-Ref: server-4.tower-31.messagelabs.com!1414245602!11481389!2 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 12680 invoked from network); 25 Oct 2014 14:00:03 -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:03 -0000 X-IronPort-AV: E=Sophos;i="5.04,786,1406592000"; d="scan'208";a="184886128" 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-Qp; Sat, 25 Oct 2014 14:59:55 +0100 From: Stefano Stabellini To: Date: Sat, 25 Oct 2014 14:57:19 +0100 Message-ID: <1414245442-4306-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 v6 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=pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.217.170 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: 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. This is correct because coherent devices don't need cache maintenance operations - arm_coherent_dma_ops does not set the hooks that we were previously checking for existance. 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 2b259f1..4daf931 100644 --- a/arch/arm/xen/mm32.c +++ b/arch/arm/xen/mm32.c @@ -82,7 +82,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; @@ -93,7 +93,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); } @@ -101,7 +101,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); }