From patchwork Mon Oct 27 15:09:25 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stefano Stabellini X-Patchwork-Id: 39638 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 811562118A for ; Mon, 27 Oct 2014 15:14:43 +0000 (UTC) Received: by mail-la0-f72.google.com with SMTP id mc6sf1236576lab.11 for ; Mon, 27 Oct 2014 08:14:42 -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: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=Wc6bOjqKPd+ELuvwHhMrvmJoNoNvgHs+RFN6QmRyZrI=; b=Y7+CUwrasjLEMwl+hafiXeJaz+dD8fXAteDMpBynFZfiShFefaQ/0a9zAwxUIKunQC nMRMa7W7n5orbxHXCcHOe/VpArOM8EVwTIJ/nNkqK5Dmx4/FyvYkAxNoarvHH3sSlBEF edsy5WszNmlqFohCDvijTWHYXCKDbTP6xfskc7HygK8PRvAW+1uc5K82sYtvBUUu9/io 7XdZuWE1Nx+eHk4poocdw/x4n2cxlIAkw5++SIRsU5B8FGYZNb+ASPWVsefulzCcqXI1 RihJK6QaN6FQieu4BAgqk5wUQGbKkuQkumaeDWVnzG5LO8XuGOTyyyuMpl2CmVWJDjg/ 7aIA== X-Gm-Message-State: ALoCoQm4F238Lf5iEVTNfy6d8ZKg3A1h5U+6p/uU9IcHd/aZ60p7Fw+pR0Tb4EYRxsYH/h43PzcA X-Received: by 10.180.73.73 with SMTP id j9mr2850788wiv.3.1414422882289; Mon, 27 Oct 2014 08:14:42 -0700 (PDT) X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.27.201 with SMTP id v9ls691764lag.25.gmail; Mon, 27 Oct 2014 08:14:41 -0700 (PDT) X-Received: by 10.112.77.129 with SMTP id s1mr24977582lbw.36.1414422881817; Mon, 27 Oct 2014 08:14:41 -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 s10si20438215lal.38.2014.10.27.08.14.41 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Mon, 27 Oct 2014 08:14:41 -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 f15so5002546lbj.27 for ; Mon, 27 Oct 2014 08:14:41 -0700 (PDT) X-Received: by 10.112.189.10 with SMTP id ge10mr24178721lbc.23.1414422881463; Mon, 27 Oct 2014 08:14:41 -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 c5csp310156lbz; Mon, 27 Oct 2014 08:14:40 -0700 (PDT) X-Received: by 10.68.110.1 with SMTP id hw1mr18121985pbb.7.1414422879840; Mon, 27 Oct 2014 08:14:39 -0700 (PDT) Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id kp4si10685651pdb.195.2014.10.27.08.14.39 for ; Mon, 27 Oct 2014 08:14:39 -0700 (PDT) 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 S1753411AbaJ0POg (ORCPT + 26 others); Mon, 27 Oct 2014 11:14:36 -0400 Received: from smtp.citrix.com ([66.165.176.89]:28545 "EHLO SMTP.CITRIX.COM" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753137AbaJ0PNI (ORCPT ); Mon, 27 Oct 2014 11:13:08 -0400 X-IronPort-AV: E=Sophos;i="5.04,796,1406592000"; d="scan'208";a="185211235" Received: from ukmail1.uk.xensource.com (10.80.16.128) by smtprelay.citrix.com (10.13.107.80) with Microsoft SMTP Server id 14.3.181.6; Mon, 27 Oct 2014 11:12:05 -0400 Received: from kaball.uk.xensource.com ([10.80.2.59]) by ukmail1.uk.xensource.com with esmtp (Exim 4.69) (envelope-from ) id 1Xilxg-0006cI-Br; Mon, 27 Oct 2014 15:12:00 +0000 From: Stefano Stabellini To: CC: , , , , , , Stefano Stabellini Subject: [PATCH v7 5/8] xen/arm: use is_device_dma_coherent Date: Mon, 27 Oct 2014 15:09:25 +0000 Message-ID: <1414422568-19103-5-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.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-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 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..d8ed359 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_device_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_device_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_device_dma_coherent(hwdev)) return; __xen_dma_page_cpu_to_dev(hwdev, handle, size, dir); }