From patchwork Thu Dec 1 13:48:00 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Benjamin Gaignard X-Patchwork-Id: 86057 Delivered-To: patch@linaro.org Received: by 10.140.20.101 with SMTP id 92csp698729qgi; Thu, 1 Dec 2016 05:49:56 -0800 (PST) X-Received: by 10.84.146.140 with SMTP id g12mr85566660pla.157.1480600196403; Thu, 01 Dec 2016 05:49:56 -0800 (PST) Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id z3si273059plb.85.2016.12.01.05.49.56; Thu, 01 Dec 2016 05:49:56 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1759534AbcLANtw (ORCPT + 25 others); Thu, 1 Dec 2016 08:49:52 -0500 Received: from mail-wm0-f54.google.com ([74.125.82.54]:38004 "EHLO mail-wm0-f54.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1759514AbcLANtu (ORCPT ); Thu, 1 Dec 2016 08:49:50 -0500 Received: by mail-wm0-f54.google.com with SMTP id f82so249017273wmf.1 for ; Thu, 01 Dec 2016 05:49:50 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id; bh=ejIdFU8dvk20CH4lVAlBpe6y2XlQoVPdvuStfMDjxTc=; b=AGPLxBKqApfT1U8WB3zgxTKUzJ3cSsq19ufUBqwmXwZMLVi4SvwBXpU/EKiwFMzq4e 3GHQBvQ2S4YH596CGbQRV+gjZy4d2jHNtgphX/Kbu4pbJMltOtIjU/K7AEd3qcDfsCsE MGFKKcIdaenL2YT5zKLus+mziZcd88JJ2vycY= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=ejIdFU8dvk20CH4lVAlBpe6y2XlQoVPdvuStfMDjxTc=; b=bsg7v44ZRP2gABgtDafbjy8VWXmHHks20waPKpjwA/zUjXkGBK7Mk5PcHwoK3N8lYF xuyV16NU4ADJ7hNbtVCdmYqDLo4AmxLU/VAbiY6ZuPXlN9CQLD6Cuc+wgx+w5nfq0V9e +mx9vQWIZbyVyantHFC4XJNS8VnFtuJruk8pDgCU7DDgqrj0eXEM27IbH3B1JgE2Bl2g bmVbK2DsOhZlrxYewd80ZeMJ/TPxZ3N1vGhPgjgbiQHWohK8VjOVIv3B1Bi5bptwSYID 3gHstQddxEtwIbLlBobOb+1z3P7cRqfjpxqjIkjZ4d8pCFCiAKyVIHrcM3emYy48Ks47 Tleg== X-Gm-Message-State: AKaTC02a43AfwJLvFfE2GsNP/9XxWegU181qDsM7ug3hVqhQbKKAtUx4ESjdWV9DRar+1Jlm X-Received: by 10.28.226.7 with SMTP id z7mr35491327wmg.83.1480600189177; Thu, 01 Dec 2016 05:49:49 -0800 (PST) Received: from lmenx321.st.com. ([80.215.13.28]) by smtp.gmail.com with ESMTPSA id 135sm1009707wmh.14.2016.12.01.05.49.47 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Thu, 01 Dec 2016 05:49:48 -0800 (PST) From: Benjamin Gaignard To: linux@armlinux.org.uk, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, Robin.Murphy@arm.com Cc: Benjamin Gaignard , Catalin Marinas , arnd@arndb.de Subject: [PATCH] nommu: allow mmap when !CONFIG_MMU Date: Thu, 1 Dec 2016 14:48:00 +0100 Message-Id: <1480600080-30196-1-git-send-email-benjamin.gaignard@linaro.org> X-Mailer: git-send-email 1.9.1 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org commit ab6494f0c96f ("nommu: Add noMMU support to the DMA API") have add CONFIG_MMU compilation flag but that prohibit to use dma_mmap_wc() when the platform doesn't have MMU. This patch call vm_iomap_memory() in noMMU case to test if addresses are correct and set wma->vm_flags rather than all return an error. Signed-off-by: Benjamin Gaignard Cc: Catalin Marinas Cc: arnd@arndb.de --- arch/arm/mm/dma-mapping.c | 3 +++ 1 file changed, 3 insertions(+) -- 1.9.1 diff --git a/arch/arm/mm/dma-mapping.c b/arch/arm/mm/dma-mapping.c index ab4f745..230875e 100644 --- a/arch/arm/mm/dma-mapping.c +++ b/arch/arm/mm/dma-mapping.c @@ -868,6 +868,9 @@ static int __arm_dma_mmap(struct device *dev, struct vm_area_struct *vma, vma->vm_end - vma->vm_start, vma->vm_page_prot); } +#else + ret = vm_iomap_memory(vma, vma->vm_start, + (vma->vm_end - vma->vm_start)); #endif /* CONFIG_MMU */ return ret;