Received: by 2002:a25:ab43:0:0:0:0:0 with SMTP id u61csp3011607ybi; Mon, 17 Jun 2019 14:39:03 -0700 (PDT) X-Google-Smtp-Source: APXvYqx+1F8Gy/IYzuG3XFIvgV5jg4sWQhNCyOkM2owOxRGykyOxGGLIPG7pQLj7vPIcJ0n/23T1 X-Received: by 2002:a17:90a:ab0b:: with SMTP id m11mr1248579pjq.73.1560807543323; Mon, 17 Jun 2019 14:39:03 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1560807543; cv=none; d=google.com; s=arc-20160816; b=FZNYRpR7nTR9M0mTE1aVdtnUd9HGaMNXMQTH3KfbUZS0fuTXEDDRZVXHwdUGbnrc8Z igrFHJgXUYwc3pLGqwNVK8XURgt2XFnXqCoY0+jTx48Td+ex6i56KOv1L9pzrId8wAxa eHpeXH+Z8pXsF7amEAFXUrchAicS4mBOu7SWcH8c0+5drjgxzLdTA+xuQw5Hu/8AoxL8 zqdC/dTx3QM/sKyqD7bbjGX9c4ysKEKU01myyrSqDPED7V0jQchIaEo874jPd+TI1ZzK +w5Hq9GwMgRKjNcyDVR5Fjkz1eDP6W6F/jzmrXBOPO4bnSRfRwfmYUdRsPi5AdzEYrMa Y0Yw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=uofuN38NQBSm4L409FVEffSeQDq0Yn3b5CBc7lAspag=; b=AX7g0zspVsDEfaji9QjBzhbMRj4KXSopxLrVl30cTAGd4a5/J46GAUJWIEsjQRyxu5 Kxu7k77H0Jd1JaOGaDEmr/X0TvAUmu9dz+XCLSnnMdRcmFwTyUxMsTTJmnmYU233aNgy sO7cBKLzC+8LmfNPXfWjynfVrvGnDIjCaP/VlZ/BjMVLIHxROePF45OrXB+BgZb1dmnm AXydCUIW5nLsWPPnpb9tC6DzMHsf0qVzQmhE3iQO12bQEdfEVFDvEOeuS4hFOUXh+HgN dzAXMiCogvnpsqaPDQLecEgB/oiZnpD36Y1XJfduLHjslUFWoSibUKuw7eWOBeohQU/p Mk9g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b="s/8LrDpx"; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id 5si3936344pgp.422.2019.06.17.14.38.48; Mon, 17 Jun 2019 14:39:03 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b="s/8LrDpx"; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728654AbfFQVTH (ORCPT + 99 others); Mon, 17 Jun 2019 17:19:07 -0400 Received: from mail.kernel.org ([198.145.29.99]:42706 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728602AbfFQVTE (ORCPT ); Mon, 17 Jun 2019 17:19:04 -0400 Received: from localhost (83-86-89-107.cable.dynamic.v4.ziggo.nl [83.86.89.107]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id E607F2166E; Mon, 17 Jun 2019 21:19:02 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1560806343; bh=oywjT/WGxmlXWiGqewKHuaN1H1kBYOm+AcDn/SJIaZw=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=s/8LrDpx1/Mg/uJV0RYvyY00XRJQCqAzQOoHrMaa5CvogWA/eS5N2rExqThrykAWC G7rmvbm0fstb/u4uX7q2RumuRZy0Qli4EC97oTCi/+OMZIBpJ+V8MtJVTIG/43Glws vaLYgRZA+2MOiGDNjepgF1dMpkmLF5/NvlnelnWE= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Thomas Backlund , Daniel Vetter , Sven Joachim Subject: [PATCH 5.1 002/115] nouveau: Fix build with CONFIG_NOUVEAU_LEGACY_CTX_SUPPORT disabled Date: Mon, 17 Jun 2019 23:08:22 +0200 Message-Id: <20190617210800.045460997@linuxfoundation.org> X-Mailer: git-send-email 2.22.0 In-Reply-To: <20190617210759.929316339@linuxfoundation.org> References: <20190617210759.929316339@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Thomas Backlund Not-entirely-upstream-sha1-but-equivalent: bed2dd8421 ("drm/ttm: Quick-test mmap offset in ttm_bo_mmap()") Setting CONFIG_NOUVEAU_LEGACY_CTX_SUPPORT=n (added by commit: b30a43ac7132) causes the build to fail with: ERROR: "drm_legacy_mmap" [drivers/gpu/drm/nouveau/nouveau.ko] undefined! This does not happend upstream as the offending code got removed in: bed2dd8421 ("drm/ttm: Quick-test mmap offset in ttm_bo_mmap()") Fix that by adding check for CONFIG_NOUVEAU_LEGACY_CTX_SUPPORT around the drm_legacy_mmap() call. Also, as Sven Joachim pointed out, we need to make the check in CONFIG_NOUVEAU_LEGACY_CTX_SUPPORT=n case return -EINVAL as its done for basically all other gpu drivers, especially in upstream kernels drivers/gpu/drm/ttm/ttm_bo_vm.c as of the upstream commit bed2dd8421. NOTE. This is a minimal stable-only fix for trees where b30a43ac7132 is backported as the build error affects nouveau only. Fixes: b30a43ac7132 ("drm/nouveau: add kconfig option to turn off nouveau legacy contexts. (v3)") Signed-off-by: Thomas Backlund Cc: stable@vger.kernel.org Cc: Daniel Vetter Cc: Sven Joachim Signed-off-by: Greg Kroah-Hartman --- drivers/gpu/drm/nouveau/nouveau_ttm.c | 4 ++++ 1 file changed, 4 insertions(+) --- a/drivers/gpu/drm/nouveau/nouveau_ttm.c +++ b/drivers/gpu/drm/nouveau/nouveau_ttm.c @@ -169,7 +169,11 @@ nouveau_ttm_mmap(struct file *filp, stru struct nouveau_drm *drm = nouveau_drm(file_priv->minor->dev); if (unlikely(vma->vm_pgoff < DRM_FILE_PAGE_OFFSET)) +#if defined(CONFIG_NOUVEAU_LEGACY_CTX_SUPPORT) return drm_legacy_mmap(filp, vma); +#else + return -EINVAL; +#endif return ttm_bo_mmap(filp, vma, &drm->ttm.bdev); }