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: 86991 Delivered-To: patch@linaro.org Received: by 10.140.20.101 with SMTP id 92csp233312qgi; Wed, 7 Dec 2016 02:08:06 -0800 (PST) X-Received: by 10.84.218.136 with SMTP id r8mr146360153pli.23.1481105286268; Wed, 07 Dec 2016 02:08:06 -0800 (PST) Return-Path: Received: from gabe.freedesktop.org (gabe.freedesktop.org. [131.252.210.177]) by mx.google.com with ESMTPS id 33si23465578plt.66.2016.12.07.02.08.05 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 07 Dec 2016 02:08:06 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of dri-devel-bounces@lists.freedesktop.org designates 131.252.210.177 as permitted sender) client-ip=131.252.210.177; Authentication-Results: mx.google.com; dkim=neutral (body hash did not verify) header.i=@linaro.org; spf=pass (google.com: best guess record for domain of dri-devel-bounces@lists.freedesktop.org designates 131.252.210.177 as permitted sender) smtp.mailfrom=dri-devel-bounces@lists.freedesktop.org; dmarc=fail (p=NONE dis=NONE) header.from=linaro.org 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" 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;