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: 9456165 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 477036074E for ; Thu, 1 Dec 2016 13:51:55 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 3AE2E20855 for ; Thu, 1 Dec 2016 13:51:55 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 2EC8F284D4; Thu, 1 Dec 2016 13:51:55 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-4.1 required=2.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_MED,T_DKIM_INVALID autolearn=ham version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.9]) (using TLSv1.2 with cipher AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id C786728495 for ; Thu, 1 Dec 2016 13:51:54 +0000 (UTC) Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.85_2 #1 (Red Hat Linux)) id 1cCRkd-0000rB-Lg; Thu, 01 Dec 2016 13:50:15 +0000 Received: from mail-wm0-x22a.google.com ([2a00:1450:400c:c09::22a]) by bombadil.infradead.org with esmtps (Exim 4.85_2 #1 (Red Hat Linux)) id 1cCRkZ-00008W-BZ for linux-arm-kernel@lists.infradead.org; Thu, 01 Dec 2016 13:50:12 +0000 Received: by mail-wm0-x22a.google.com with SMTP id u144so60179704wmu.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=VcjdWKkh2QHGECFXXSqTZG6Kr5B8LCUnZ0W1sOopPdhiRejqf5nN48L7soQj1rtOj+ 5SIWpDXEE0OAVd38wlokMHrH0Son7v5YHAZgT2iUOuAB+D86yNJApB6xcMkIcn1RUJqr RkbZDJEZQVnSDoxFKufdDxC18AuHq4M6PrJhfVkGuR6tdkrxYbVlm6ip/uo7lEPUh4Tv 9FhnECZW+zwesa8AcCdLKE+QwPWujnAKNea8hngXM3YvIf1IfuEJh913U+oD+/ODbr9y GEYWa4z8sIBKh7mdrUNwbQeHbkzt2dvozyDVVaQv1y0B+SzKYUxg2iZAL8PdQrCIMzzH xprw== X-Gm-Message-State: AKaTC01HhNFEJSg3geO2WGzU+5OpRtC8GGzG0cFtN81d+a3MbrtYpSi32gfW/nmk5HJrQdQa 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 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 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20161201_055011_619325_BCB0DF73 X-CRM114-Status: GOOD ( 11.69 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Catalin Marinas , arnd@arndb.de, Benjamin Gaignard MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP 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;