Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1759533AbcLANtw (ORCPT ); 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 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 List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 989 Lines: 30 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(+) 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; -- 1.9.1