From patchwork Wed Nov 12 11:40:47 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stefano Stabellini X-Patchwork-Id: 40650 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-la0-f72.google.com (mail-la0-f72.google.com [209.85.215.72]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 464F9206A5 for ; Wed, 12 Nov 2014 11:41:35 +0000 (UTC) Received: by mail-la0-f72.google.com with SMTP id mc6sf7627364lab.3 for ; Wed, 12 Nov 2014 03:41:34 -0800 (PST) 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:cc:subject:date:message-id :in-reply-to:references:mime-version:sender:precedence:list-id :x-original-sender:x-original-authentication-results:mailing-list :list-post:list-help:list-archive:list-unsubscribe:content-type; bh=YiXb1bp1rJcw9DRMCqEaNeGAGqwhAoKmj3j1H/8K5NE=; b=KlKHozig8e/6WWH+upXvencpQXlIoKQnCd2G25/7cRmchnM2yEV6r169VZCuOv+p9j CjiKE0W+UjzCLZqM3mTYTMMolLasxuaeoH3km1nYsTiZKsCDiisGFUM5Mzk3QJEkED/t P8r7um10kDVe1L1zgk8vA/wdVxyIpfweTEkLBjXca5uWm3fu+boeEzN4aW9AfIDUJPn7 DQrWYDAlLnctB+P5ZXNZ/x1//nm+wLfnTCV0PM5Jj0V3WiCa41TOeEoZvnmi6dpPfkRq EYcsI/rOPj/YTgM/A1c8st4zSp5UGLGc1Sv8FzUGffQEz6AWT6zpn3+gTGdV8mB16mhr 6KMQ== X-Gm-Message-State: ALoCoQlDlzSDbnP5GSiKnQnIA1Pr/AKIv2NYAAm7CMzx/mpqU8vdeGzmU5nH2pYTFSg9pZ1Y8Mj2 X-Received: by 10.152.30.66 with SMTP id q2mr7825150lah.2.1415792494085; Wed, 12 Nov 2014 03:41:34 -0800 (PST) X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.170.227 with SMTP id ap3ls676222lac.60.gmail; Wed, 12 Nov 2014 03:41:33 -0800 (PST) X-Received: by 10.112.52.37 with SMTP id q5mr41309776lbo.32.1415792493209; Wed, 12 Nov 2014 03:41:33 -0800 (PST) Received: from mail-la0-f53.google.com (mail-la0-f53.google.com. [209.85.215.53]) by mx.google.com with ESMTPS id rg7si11007456lbb.135.2014.11.12.03.41.33 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Wed, 12 Nov 2014 03:41:33 -0800 (PST) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.215.53 as permitted sender) client-ip=209.85.215.53; Received: by mail-la0-f53.google.com with SMTP id mc6so11000206lab.26 for ; Wed, 12 Nov 2014 03:41:33 -0800 (PST) X-Received: by 10.152.42.226 with SMTP id r2mr1872166lal.29.1415792493081; Wed, 12 Nov 2014 03:41:33 -0800 (PST) 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.184.201 with SMTP id ew9csp408082lbc; Wed, 12 Nov 2014 03:41:32 -0800 (PST) X-Received: by 10.67.30.194 with SMTP id kg2mr23373626pad.8.1415792491339; Wed, 12 Nov 2014 03:41:31 -0800 (PST) Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id q2si18398519pdf.63.2014.11.12.03.41.30 for ; Wed, 12 Nov 2014 03:41:31 -0800 (PST) Received-SPF: none (google.com: linux-kernel-owner@vger.kernel.org does not designate permitted sender hosts) client-ip=209.132.180.67; Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752883AbaKLLlV (ORCPT + 25 others); Wed, 12 Nov 2014 06:41:21 -0500 Received: from smtp02.citrix.com ([66.165.176.63]:60341 "EHLO SMTP02.CITRIX.COM" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752278AbaKLLlR (ORCPT ); Wed, 12 Nov 2014 06:41:17 -0500 X-IronPort-AV: E=Sophos;i="5.07,368,1413244800"; d="scan'208";a="191920929" 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; Wed, 12 Nov 2014 06:41:14 -0500 Received: from kaball.uk.xensource.com ([10.80.2.59]) by ukmail1.uk.xensource.com with esmtp (Exim 4.69) (envelope-from ) id 1XoWIO-0003Gl-VC; Wed, 12 Nov 2014 11:41:08 +0000 From: Stefano Stabellini To: CC: , , , , , , , Stefano Stabellini Subject: [PATCH v9 06/13] xen/arm: use is_device_dma_coherent Date: Wed, 12 Nov 2014 11:40:47 +0000 Message-ID: <1415792454-23161-6-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 Sender: linux-kernel-owner@vger.kernel.org Precedence: list List-ID: X-Mailing-List: linux-kernel@vger.kernel.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.215.53 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-Post: , List-Help: , List-Archive: List-Unsubscribe: , Use is_device_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 Reviewed-by: Catalin Marinas 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 5bb8391..3ce9dc1 100644 --- a/arch/arm/xen/mm32.c +++ b/arch/arm/xen/mm32.c @@ -48,7 +48,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_device_dma_coherent(hwdev)) return; if (dma_get_attr(DMA_ATTR_SKIP_CPU_SYNC, attrs)) return; @@ -59,7 +59,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_device_dma_coherent(hwdev)) return; __xen_dma_page_dev_to_cpu(hwdev, handle, size, dir); } @@ -67,7 +67,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_device_dma_coherent(hwdev)) return; __xen_dma_page_cpu_to_dev(hwdev, handle, size, dir); }