Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751646AbdINXXJ (ORCPT ); Thu, 14 Sep 2017 19:23:09 -0400 Received: from mail.kernel.org ([198.145.29.99]:37846 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751586AbdINXXI (ORCPT ); Thu, 14 Sep 2017 19:23:08 -0400 DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 357B7218F9 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=kernel.org Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=sstabellini@kernel.org Date: Thu, 14 Sep 2017 16:23:05 -0700 (PDT) From: Stefano Stabellini X-X-Sender: sstabellini@sstabellini-ThinkPad-X260 To: stable@vger.kernel.org cc: sstabellini@kernel.org, linux-kernel@vger.kernel.org, julien.grall@arm.com, jgross@suse.com, boris.ostrovsky@oracle.com, gregkh@linuxfoundation.org Subject: [BACKPORT] swiotlb-xen: implement xen_swiotlb_dma_mmap callback Message-ID: User-Agent: Alpine 2.10 (DEB 1266 2009-07-14) MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1929 Lines: 57 Hi all, We are getting reports from Xen on ARM users about DMA issues. The problem is that the commit below (7e91c7df29b5e196de3dc6f086c8937973bd0b88) is necessary to support mmap on Xen on ARM. It is self-contained and doesn't affect anything outside of Xen on ARM, so I think is a good candidate for backporting. It went upstream in 4.11. Could you please backport the following commit: commit 7e91c7df29b5e196de3dc6f086c8937973bd0b88 Author: Stefano Stabellini Date: Tue Feb 7 19:58:02 2017 +0200 swiotlb-xen: implement xen_swiotlb_dma_mmap callback This function creates userspace mapping for the DMA-coherent memory. to the stable trees up until 3.14? Because of 00085f1efa387a8ce100e3734920f7639c80caa3 "dma-mapping: use unsigned long for dma_attrs", the appended patch (to be applied on top) is required for trees older than 4.8. Thank you! - Stefano diff --git a/drivers/xen/swiotlb-xen.c b/drivers/xen/swiotlb-xen.c index a0a819c..c6d47e5 100644 --- a/drivers/xen/swiotlb-xen.c +++ b/drivers/xen/swiotlb-xen.c @@ -693,7 +693,7 @@ EXPORT_SYMBOL_GPL(xen_swiotlb_set_dma_mask); int xen_swiotlb_dma_mmap(struct device *dev, struct vm_area_struct *vma, void *cpu_addr, dma_addr_t dma_addr, size_t size, - unsigned long attrs) + struct dma_attrs *attrs) { #if defined(CONFIG_ARM) || defined(CONFIG_ARM64) if (__generic_dma_ops(dev)->mmap) diff --git a/include/xen/swiotlb-xen.h b/include/xen/swiotlb-xen.h index fab4fb9..4d7fdbf 100644 --- a/include/xen/swiotlb-xen.h +++ b/include/xen/swiotlb-xen.h @@ -62,5 +62,5 @@ xen_swiotlb_set_dma_mask(struct device *dev, u64 dma_mask); extern int xen_swiotlb_dma_mmap(struct device *dev, struct vm_area_struct *vma, void *cpu_addr, dma_addr_t dma_addr, size_t size, - unsigned long attrs); + struct dma_attrs *attrs); #endif /* __LINUX_SWIOTLB_XEN_H */