From patchwork Mon Nov 10 16:13:58 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stefano Stabellini X-Patchwork-Id: 40504 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 13734218DE for ; Mon, 10 Nov 2014 16:15:35 +0000 (UTC) Received: by mail-lb0-f198.google.com with SMTP id 10sf4257575lbg.9 for ; Mon, 10 Nov 2014 08:15: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=Zeqb9vtz9fTRIzN44RpqzIIaxM5/4n9A9SsVLv1E+Nc=; b=EkYZoBLxfCgd1+nHTUo7M9Gh+ln9gT6fQCnfDwE2a6dzX7tIahs8CuBrV974Cg5PRq JLB6teqOiIBzXlu5f+GGo8KVvvzgTr82EQqyghmVhHQwybLKw2oV/3DtsuCpJdSDZUQN bTUWRYPuKpr+ERdk8z2Uu6S6KzzYnRImUZ6cdc28jbP8x0whyYEeXROLpy5rcvP/15X3 p06CvFJvJTBfGQmuYiIYfmpK0LJkGMTY9/z6l2apqkC1mBliiU4ZKF3XlhjRc/S+BF5I +8hoMGiU6DOta9wylUA002C5tmTJDPGAAQ6SwjXcTaViqUxV/fPAuHN8VJJBdnxx2y/t X3JQ== X-Gm-Message-State: ALoCoQnOeznUOpHppgYdudZmSJZr8E3xjY3a+vM2qCyeaYUEnZjMFCgB4BnaG+uXqFw8VMBcrFjz X-Received: by 10.112.180.71 with SMTP id dm7mr57820lbc.18.1415636133989; Mon, 10 Nov 2014 08:15:33 -0800 (PST) X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.19.39 with SMTP id b7ls399114lae.38.gmail; Mon, 10 Nov 2014 08:15:33 -0800 (PST) X-Received: by 10.152.206.11 with SMTP id lk11mr30857001lac.42.1415636133526; Mon, 10 Nov 2014 08:15:33 -0800 (PST) Received: from mail-la0-f41.google.com (mail-la0-f41.google.com. [209.85.215.41]) by mx.google.com with ESMTPS id zs1si27724784lbb.27.2014.11.10.08.15.33 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Mon, 10 Nov 2014 08:15:33 -0800 (PST) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.215.41 as permitted sender) client-ip=209.85.215.41; Received: by mail-la0-f41.google.com with SMTP id s18so8042642lam.0 for ; Mon, 10 Nov 2014 08:15:33 -0800 (PST) X-Received: by 10.152.29.8 with SMTP id f8mr30345976lah.56.1415636133448; Mon, 10 Nov 2014 08:15: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 ew9csp116064lbc; Mon, 10 Nov 2014 08:15:30 -0800 (PST) X-Received: by 10.68.164.65 with SMTP id yo1mr32925265pbb.126.1415636130032; Mon, 10 Nov 2014 08:15:30 -0800 (PST) Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id bf4si16873969pdb.162.2014.11.10.08.15.29 for ; Mon, 10 Nov 2014 08:15:30 -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 S1753438AbaKJQPP (ORCPT + 25 others); Mon, 10 Nov 2014 11:15:15 -0500 Received: from smtp.citrix.com ([66.165.176.89]:15449 "EHLO SMTP.CITRIX.COM" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752594AbaKJQPM (ORCPT ); Mon, 10 Nov 2014 11:15:12 -0500 X-IronPort-AV: E=Sophos;i="5.07,353,1413244800"; d="scan'208";a="189798978" 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; Mon, 10 Nov 2014 11:14:23 -0500 Received: from kaball.uk.xensource.com ([10.80.2.59]) by ukmail1.uk.xensource.com with esmtp (Exim 4.69) (envelope-from ) id 1Xnrbe-0000Mx-0O; Mon, 10 Nov 2014 16:14:18 +0000 From: Stefano Stabellini To: CC: , , , , , , , Stefano Stabellini Subject: [PATCH v8 06/13] xen/arm: use is_device_dma_coherent Date: Mon, 10 Nov 2014 16:13:58 +0000 Message-ID: <1415636045-24669-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.41 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 b26bf84..7824498 100644 --- a/arch/arm/xen/mm32.c +++ b/arch/arm/xen/mm32.c @@ -50,7 +50,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; @@ -61,7 +61,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); } @@ -69,7 +69,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); }