From patchwork Mon Mar 8 15:33:50 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arnd Bergmann X-Patchwork-Id: 395443 Delivered-To: patch@linaro.org Received: by 2002:a02:8562:0:0:0:0:0 with SMTP id g89csp1809095jai; Mon, 8 Mar 2021 07:34:10 -0800 (PST) X-Google-Smtp-Source: ABdhPJyjtxYNxqFf3+n12TnOHywx4PGT0IfypBobNVXKftFymTGl48euyM0C7B8HhPkMPf1jxd4G X-Received: by 2002:aa7:9154:0:b029:1ee:fa0d:24dd with SMTP id 20-20020aa791540000b02901eefa0d24ddmr21561723pfi.17.1615217650162; Mon, 08 Mar 2021 07:34:10 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1615217650; cv=none; d=google.com; s=arc-20160816; b=MM9cURyLtFolm/IFh1BrIvkbw+vOP7r9Tr3polPJUEJF+MuxCqRKGVB+Dh3408Wxb4 4ku/Q51uE0jKaqQUEi0dzizmX/Rjch3aRYNVEQluPds1ivXtusMraYgh7KH/5khtlbW0 YWuQWDYzpIJnaLMZWYXfWDNwWG/ZP16VloyzCeQZSFbBLCgEyKPAH5JXjoGy2i69u544 0Xsv9roAhF7z2yPatacSEvYDQ2U75sRl5aXKC2llW+1OGI9UGHZOVmn2lKKMewiYOnhc ETrF54ouJN3ghZDHoeYcyxEN5/2NR9GPzKX2WETGTswUoWoL/b3deznh9SL8YwaSTdA9 Lblw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:content-transfer-encoding:cc:list-subscribe :list-help:list-post:list-archive:list-unsubscribe:list-id :precedence:mime-version:message-id:date:subject:to:from :dkim-signature:delivered-to; bh=VS8wGj4Kenp3MVYMAgc+/U9S1Hf9BEq/7+1l4UuZhBg=; b=vSNtL3iqHBr1si8nQYlV5oHNAUboQjFcj1Vw+aRkgXnwW7C5Ym8ZdckfcbFOeHnLP7 RFwvypkVEAUtkrs/q+/04/oRTHLgQphms5kdU696nL+GH//OMTbobb60OWFZYIZzW4Bh 812xDb7+bfWBWJO7ZOme45OiRAhsxjW7cKdFBVYYv7ByUSc2siRgs91X/RoSHatYQzJl vQpVIvTYND0BvdGINdZxspFuZjyRMTcxdHjBRyhHGDBMwMX8CsuKL8jL8UMej71UQ0xp +RLx/3DKJdBpQ8TN8vKn8TW24cpp8/CfV4SaaoLVKA01aeLA+miM1xlB+HhVgChPtWid UUFQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@kernel.org header.s=k20201202 header.b=qcjdMkkO; 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 sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from gabe.freedesktop.org (gabe.freedesktop.org. [131.252.210.177]) by mx.google.com with ESMTPS id e19si11597972pgt.35.2021.03.08.07.34.09 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 08 Mar 2021 07:34:10 -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=@kernel.org header.s=k20201202 header.b=qcjdMkkO; 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 sp=NONE dis=NONE) header.from=kernel.org Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 136BB6E05A; Mon, 8 Mar 2021 15:34:07 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by gabe.freedesktop.org (Postfix) with ESMTPS id 7E02689DCF; Mon, 8 Mar 2021 15:34:05 +0000 (UTC) Received: by mail.kernel.org (Postfix) with ESMTPSA id 480D265208; Mon, 8 Mar 2021 15:34:02 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1615217644; bh=6ZFTD883CvBSmMqN/Qn0YcbtxAfTIp2pR0HqlUwwxUk=; h=From:To:Cc:Subject:Date:From; b=qcjdMkkOzYpyZlVyeCTa4QwDG22pfrIIAUHqaDOST/To4vn2qSsht+isxl6/P1Rbw ZUuwUFXOwb3aknq5pmSWo0M3uqK7Bzl+XzmI9E1Fn1px9xB90Jf4zoWOfLcGDoRAjq zviCOGwGSfY/CnNEtANwWZf8dh+L7I3e2VwWW3D3hjcHjT3pOltzNSi7QBXf4+zkv4 3YCjFFNFqq21AUCf5U7U3srByanSbiZSXUHrpp3NJt4SnJE2gDGPkdg9shd83khhti UGzHU0OaYx03XjAAeTZrlGDXSvGnn3vGuFjx21cp4Z5lSVA1ThpKbUykvN1J9uXkgi bxFSO9367lE2g== From: Arnd Bergmann To: Felix Kuehling , Alex Deucher , =?utf-8?q?Christian_K=C3=B6nig?= , David Airlie , Daniel Vetter , Oded Gabbay Subject: [PATCH] drm/amdkfd: fix build error with missing AMD_IOMMU_V2 Date: Mon, 8 Mar 2021 16:33:50 +0100 Message-Id: <20210308153359.2513446-1-arnd@kernel.org> X-Mailer: git-send-email 2.29.2 MIME-Version: 1.0 X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Philip Yang , Arnd Bergmann , linux-kernel@vger.kernel.org, dri-devel@lists.freedesktop.org, amd-gfx@lists.freedesktop.org, Colin Ian King Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" From: Arnd Bergmann Using 'imply AMD_IOMMU_V2' does not guarantee that the driver can link against the exported functions. If the GPU driver is built-in but the IOMMU driver is a loadable module, the kfd_iommu.c file is indeed built but does not work: x86_64-linux-ld: drivers/gpu/drm/amd/amdkfd/kfd_iommu.o: in function `kfd_iommu_bind_process_to_device': kfd_iommu.c:(.text+0x516): undefined reference to `amd_iommu_bind_pasid' x86_64-linux-ld: drivers/gpu/drm/amd/amdkfd/kfd_iommu.o: in function `kfd_iommu_unbind_process': kfd_iommu.c:(.text+0x691): undefined reference to `amd_iommu_unbind_pasid' x86_64-linux-ld: drivers/gpu/drm/amd/amdkfd/kfd_iommu.o: in function `kfd_iommu_suspend': kfd_iommu.c:(.text+0x966): undefined reference to `amd_iommu_set_invalidate_ctx_cb' x86_64-linux-ld: kfd_iommu.c:(.text+0x97f): undefined reference to `amd_iommu_set_invalid_ppr_cb' x86_64-linux-ld: kfd_iommu.c:(.text+0x9a4): undefined reference to `amd_iommu_free_device' x86_64-linux-ld: drivers/gpu/drm/amd/amdkfd/kfd_iommu.o: in function `kfd_iommu_resume': kfd_iommu.c:(.text+0xa9a): undefined reference to `amd_iommu_init_device' x86_64-linux-ld: kfd_iommu.c:(.text+0xadc): undefined reference to `amd_iommu_set_invalidate_ctx_cb' x86_64-linux-ld: kfd_iommu.c:(.text+0xaff): undefined reference to `amd_iommu_set_invalid_ppr_cb' x86_64-linux-ld: kfd_iommu.c:(.text+0xc72): undefined reference to `amd_iommu_bind_pasid' x86_64-linux-ld: kfd_iommu.c:(.text+0xe08): undefined reference to `amd_iommu_set_invalidate_ctx_cb' x86_64-linux-ld: kfd_iommu.c:(.text+0xe26): undefined reference to `amd_iommu_set_invalid_ppr_cb' x86_64-linux-ld: kfd_iommu.c:(.text+0xe42): undefined reference to `amd_iommu_free_device' Use a stronger 'select' instead. Fixes: 64d1c3a43a6f ("drm/amdkfd: Centralize IOMMUv2 code and make it conditional") Signed-off-by: Arnd Bergmann --- drivers/gpu/drm/amd/amdkfd/Kconfig | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) -- 2.29.2 _______________________________________________ dri-devel mailing list dri-devel@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/dri-devel diff --git a/drivers/gpu/drm/amd/amdkfd/Kconfig b/drivers/gpu/drm/amd/amdkfd/Kconfig index f02c938f75da..91f85dfb7ba6 100644 --- a/drivers/gpu/drm/amd/amdkfd/Kconfig +++ b/drivers/gpu/drm/amd/amdkfd/Kconfig @@ -5,8 +5,9 @@ config HSA_AMD bool "HSA kernel driver for AMD GPU devices" - depends on DRM_AMDGPU && (X86_64 || ARM64 || PPC64) - imply AMD_IOMMU_V2 if X86_64 + depends on DRM_AMDGPU && ((X86_64 && IOMMU_SUPPORT && ACPI) || ARM64 || PPC64) + select AMD_IOMMU if X86_64 + select AMD_IOMMU_V2 if X86_64 select HMM_MIRROR select MMU_NOTIFIER select DRM_AMDGPU_USERPTR