From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753437AbaKJQPP (ORCPT ); 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" 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 Content-Type: text/plain X-DLP: MIA1 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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); } -- 1.7.10.4