From patchwork Wed Jan 11 13:33:34 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arnd Bergmann X-Patchwork-Id: 9510057 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 D684660231 for ; Wed, 11 Jan 2017 13:34:33 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id C759428632 for ; Wed, 11 Jan 2017 13:34:33 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id BC0EC28635; Wed, 11 Jan 2017 13:34:33 +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.2 required=2.0 tests=BAYES_00, RCVD_IN_DNSWL_MED 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 C9A4128632 for ; Wed, 11 Jan 2017 13:34:32 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id B58D56E8E7; Wed, 11 Jan 2017 13:34:30 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mout.kundenserver.de (mout.kundenserver.de [212.227.17.13]) by gabe.freedesktop.org (Postfix) with ESMTPS id 492C16E8E7 for ; Wed, 11 Jan 2017 13:34:27 +0000 (UTC) Received: from wuerfel.lan ([78.43.21.235]) by mrelayeu.kundenserver.de (mreue101 [212.227.15.145]) with ESMTPA (Nemesis) id 0M0z9T-1cjwaD3Hm3-00v9nD; Wed, 11 Jan 2017 14:34:02 +0100 From: Arnd Bergmann To: Daniel Vetter , Daniel Vetter Subject: [PATCH 1/2] drm: fix drm_vm for NOMMU builds Date: Wed, 11 Jan 2017 14:33:34 +0100 Message-Id: <20170111133357.3664191-1-arnd@arndb.de> X-Mailer: git-send-email 2.9.0 X-Provags-ID: V03:K0:WzNsIF4jJL+KTx0ViudjDVKYU6xDvEL9yNuHPeBHxFO9f/cVJGB 4wDcoIqyI8Zx6gMGT0T4BA50NzwQW4leV42F/1XovTQHq82Fo2qfc2c6R6EkDYJ/3n1HIOF SOODJXs40Aaem8refH6MeVxDr6W2ixktFEHIaicu4HAgxARFi7hGvccJ0ZL7puj45LiMeoI s50+zoO/IFZQdtV2e1rPw== X-UI-Out-Filterresults: notjunk:1; V01:K0:qrvIVr40gjo=:UM38pTvqhmRxleeyQvegAs XB2NG8Nr6W11tKB1qS2qWd6KgTA1tT/mFXthsjaeC+RHFGhHtzeY5zj9KDDTxMv6paB9wOdkB khdEe0OQHBAJIfP3i3kbAAnfKa6NpG+WhwomW1U7wq9SejXkBL3uP0kHgAri+cDUX47zbregO RpvVFuD6DWwLHLYCgcNxHks8CgPYRNI8yK1IK/IvjNVOqPTUCCtURuVUqcgW3F3dknCKA/HxQ OGRaEEdh/rF8QABez3P7Nbwfp4au5ZcOh+hoW+woq+rEcvbf7MZwPZpcLZt248xylLOrGKlhu 0tAxBB8ed86GIlJbZqjgNL/J4WR17T8fIr6To05Ktlwdjr96oQQhrTYE5RZelivEVbO3Wo6ep bEc3B/a1xcui0zDkow1/UcAUEW83MV1gjJWCsCRXJ0+9rtMZXNS9aPKbAbHYw8rKe+cOEnt17 8a9+kHlIenmptoH4q4lMkPdCz5L6B4UUzKxNJ/bq5AruOkmV/8ahqVPTMNtVr/WkXS38jl3j1 EnXV55dOgf1CavmmSaCGYzbc5ktLOSyslsLf4h8CCT3/7vCPuGg8hzOFGryPu2zOd3OJPYgFB IPfXmMfojUj4bpduMHjy1SvlwgmhZDxPe/eX1DKvQNu2dC0sju8uV28wMFZNxhuh5Kkc3+2TV ZvHSULSvvmusDXJR/0SSZv65CFlp/HQz3UocXHkByowU8+l3bxA9nszUYl8rcGqI4j1I= Cc: Arnd Bergmann , linux-kernel@vger.kernel.org, dri-devel@lists.freedesktop.org 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 When building DRM without an MMU, we run into a compile-time error because pte_wrprotect() is not defined: drivers/gpu/drm/drm_vm.c: In function 'drm_mmap_dma': drivers/gpu/drm/drm_vm.c:496:9: error: implicit declaration of function 'pte_wrprotect' [-Werror=implicit-function-declaration] The line is not meaningful here, so we can simply add another compile-time check around it. Fixes: 62a0d98a188c ("drm: allow to use mmuless SoC") Signed-off-by: Arnd Bergmann --- drivers/gpu/drm/drm_vm.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/gpu/drm/drm_vm.c b/drivers/gpu/drm/drm_vm.c index bd311c77c254..038946588ed7 100644 --- a/drivers/gpu/drm/drm_vm.c +++ b/drivers/gpu/drm/drm_vm.c @@ -488,7 +488,7 @@ static int drm_mmap_dma(struct file *filp, struct vm_area_struct *vma) vma->vm_flags &= ~(VM_WRITE | VM_MAYWRITE); #if defined(__i386__) || defined(__x86_64__) pgprot_val(vma->vm_page_prot) &= ~_PAGE_RW; -#else +#elif IS_ENABLED(CONFIG_MMU) /* Ye gads this is ugly. With more thought we could move this up higher and use `protection_map' instead. */ @@ -572,7 +572,7 @@ static int drm_mmap_locked(struct file *filp, struct vm_area_struct *vma) vma->vm_flags &= ~(VM_WRITE | VM_MAYWRITE); #if defined(__i386__) || defined(__x86_64__) pgprot_val(vma->vm_page_prot) &= ~_PAGE_RW; -#else +#elif defined (CONFIG_MMU) /* Ye gads this is ugly. With more thought we could move this up higher and use `protection_map' instead. */