From patchwork Wed Dec 7 10:06:48 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Benjamin Gaignard X-Patchwork-Id: 9464199 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 3A92060512 for ; Wed, 7 Dec 2016 10:08:07 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 0CA0328478 for ; Wed, 7 Dec 2016 10:08:07 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 00E59284D5; Wed, 7 Dec 2016 10:08:06 +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 gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 9FA1B28478 for ; Wed, 7 Dec 2016 10:08:06 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 2F4626E522; Wed, 7 Dec 2016 10:08:01 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mail-wm0-x230.google.com (mail-wm0-x230.google.com [IPv6:2a00:1450:400c:c09::230]) by gabe.freedesktop.org (Postfix) with ESMTPS id 40FC06E522 for ; Wed, 7 Dec 2016 10:07:57 +0000 (UTC) Received: by mail-wm0-x230.google.com with SMTP id t79so158171906wmt.0 for ; Wed, 07 Dec 2016 02:07:57 -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:in-reply-to:references; bh=ejIdFU8dvk20CH4lVAlBpe6y2XlQoVPdvuStfMDjxTc=; b=aWsoYAFqplC45/ovuvd6p0D9C2Hk4iLp3IaCy72V5CC5MUme+ovGi2AF7WCYbnxZWm bsZIqbiHrHcpYloMYUN5BQiRpvoQDHkPUDTrrN9PQfFG92M0WYhXW6KFp2UaPdLEtlxK yiw0/EDI7PrrrddsMXfQ4bT1TWbHFSbAjgZB0= 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:in-reply-to :references; bh=ejIdFU8dvk20CH4lVAlBpe6y2XlQoVPdvuStfMDjxTc=; b=NIaBfiZu6VW670o0in8HH7eINlXcxwiDNkOIBxCi8QR2mQQTHBYgGzD1mXyVa2/5NO EVf5wqBZ1kPmIJ4mbgMlaxfFKUUBxII7HF9gaszJXfppT5yTtr/JDHKfaVc6y9QeDQ2V 2qPFeatd2xsb41KUC3m8TrlCFYxYoZV0pAC3TcQydQKvsxdoU8N2vRRnD/S6qjaVYUTt kXOuSz9PZ21WqpnRScYbdcjCpxLqGVicu6PYThKzICLG/pd1wNiUvRCds4d6Tf6szEAx OgKgE6ccKzK5SGD/qSzPJe+JbpEXNfkHwU5SXFpA+AwMH6nroaIEPdv5eo/08AjVUQFQ aaaA== X-Gm-Message-State: AKaTC039VGgry7hgnLn2zb9L6AW2gN/PfaP5Lzb9np9j5HYKGK+id5eBAwns0e7S+WF8Ua8n X-Received: by 10.28.165.2 with SMTP id o2mr1987624wme.38.1481105275544; Wed, 07 Dec 2016 02:07:55 -0800 (PST) Received: from lmenx321.st.com. ([80.215.165.156]) by smtp.gmail.com with ESMTPSA id x140sm8748561wme.19.2016.12.07.02.07.52 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Wed, 07 Dec 2016 02:07:55 -0800 (PST) From: Benjamin Gaignard To: dri-devel@lists.freedesktop.org, airlied@redhat.com, daniel@ffwll.ch, laurent.pinchart@ideasonboard.com, michel@daenzer.net Subject: [PATCH v4 1/4] nommu: allow mmap when !CONFIG_MMU Date: Wed, 7 Dec 2016 11:06:48 +0100 Message-Id: <1481105211-18020-2-git-send-email-benjamin.gaignard@linaro.org> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1481105211-18020-1-git-send-email-benjamin.gaignard@linaro.org> References: <1481105211-18020-1-git-send-email-benjamin.gaignard@linaro.org> Cc: linaro-kernel@lists.linaro.org, arnd@arndb.de, Catalin Marinas , philippe.cornu@st.com, yannick.fertre@st.com X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" 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;