From patchwork Mon Mar 8 20:45:49 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Arnd Bergmann X-Patchwork-Id: 395507 Delivered-To: patch@linaro.org Received: by 2002:a02:8562:0:0:0:0:0 with SMTP id g89csp2031520jai; Mon, 8 Mar 2021 12:46:17 -0800 (PST) X-Google-Smtp-Source: ABdhPJwtInx8ZpTWbLFdp9WzHjk7a5VbqhGA215DjRLx225X9QCQDkzPQkudiD76o/ifRH+h9jz0 X-Received: by 2002:a17:90b:4a81:: with SMTP id lp1mr747202pjb.154.1615236376913; Mon, 08 Mar 2021 12:46:16 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1615236376; cv=none; d=google.com; s=arc-20160816; b=PZibyRenWHR53sn9TRTDSCpZOQa482YZq8WtNRkDkNsIYKdoAMjQMY8E5+f4yG0DvS 3d/QmIQmMF5Bmw4vnNlGdHdEsOzkaBkPOlFdezT/IMYMWWqct3wDPCsoWE6GvDegv8aQ yr93ckEGVG2JTrJrTUEKZVLyt/hqKra0TxUMiUPyEKTsEq7MmlYW8+UjEBYOAQPSYKXO HqkNTaPRUjiIkH85fZ+E1y1FUu3MELGfN65RvdtGdUBwPWFGNO+26ODAcfXvReGonkt4 x/U5s2HfgyQcpNoo9IGr6/M/O77WVp0p8RWJrj8kdByQFcTMhN2o9dTKbszVcVHoTIAP +g5Q== 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=Q9PwPHjJI8gm+umL2M62L6LWYhZYF2x6RSKJj6ebpdI=; b=tvAkIfwUZCAcFhekp5ydwrXfi8XFIQzTXfLYngVgiWk2KVOy2Wf0+gwcp9OU+Gxybe hxk7QhdxLDMsYSr4KObZmBYbdhVh+TrLJMlOWOzURsfWdk+6+gtv8Swa+VK7TATaso7t qtEJulmx9RqaDxEBnH70I5YUHfjOvNMsJ6CfwU3Pfd5WwPJ+BZgeThJexBIKnnx6jOUL 8ytH9H35iP4CE6LgjnPQav9vnz+Sa6MlpQFrD07AzxGe5yLy92umaz0ebhL6Xpwhf9Ck lvylfRlEWGk28neSgixcbIfS68x2n7cIolMHDnTC3tpGTYepypJ7VGDZGHLN9o9vj2G5 e50g== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@kernel.org header.s=k20201202 header.b=GstGoT78; 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 q8si12367127pfk.224.2021.03.08.12.46.16 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 08 Mar 2021 12:46:16 -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=GstGoT78; 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 97FC26E88A; Mon, 8 Mar 2021 20:46:13 +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 A3AC76E887; Mon, 8 Mar 2021 20:46:11 +0000 (UTC) Received: by mail.kernel.org (Postfix) with ESMTPSA id 6FCF164DF5; Mon, 8 Mar 2021 20:46:09 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1615236371; bh=fJsMy6YyZc0GKNaInkxN1wNn9x/iFUp/YIamYo3r9jI=; h=From:To:Cc:Subject:Date:From; b=GstGoT78JFxcmwrLZvbduyxRkkzi3fBn4/2ug3/IqmAiiXC/qScbn1IB1l4LQTSe3 BhDMTGvLDckABUwk1+MnssjPMYdAkU0PTrrmwQhtkyw+r1qbuJM6NSejids/mj5rAi Kiq+/4VbA0+8LDY5mhc1/LZi9wwCa1w+ge388GTUqcIL3yH3YGjPL48trvXCRQPzUR qRO6rLigtFBI3biLv9xYgKuqbQv3cpF271T/R8oj0piQYywprrJ3OYm5/mhf0HkJmU FAP4uGMpwOwnkIwV3GWJflWEa8TVwjW9EE8m0hQtYUvsVXpFxZOwL1W8Vc9waTyYN0 +6L6Qlp6gZrag== From: Arnd Bergmann To: Felix Kuehling , Alex Deucher , =?utf-8?q?Christian_K=C3=B6nig?= Subject: [PATCH] [variant b] drm/amdkfd: fix build error with missing AMD_IOMMU_V2 Date: Mon, 8 Mar 2021 21:45:49 +0100 Message-Id: <20210308204606.2634726-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 , David Airlie , linux-kernel@vger.kernel.org, amd-gfx@lists.freedesktop.org, dri-devel@lists.freedesktop.org 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' Change the 'imply' to a weak dependency that still allows compiling in all other configurations but disallows the configuration that causes a link failure. Fixes: 64d1c3a43a6f ("drm/amdkfd: Centralize IOMMUv2 code and make it conditional") Signed-off-by: Arnd Bergmann --- drivers/gpu/drm/amd/amdkfd/Kconfig | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) -- 2.29.2 _______________________________________________ dri-devel mailing list dri-devel@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/dri-devel Reviewed-by: Christian König diff --git a/drivers/gpu/drm/amd/amdkfd/Kconfig b/drivers/gpu/drm/amd/amdkfd/Kconfig index f02c938f75da..d01dba2af3bb 100644 --- a/drivers/gpu/drm/amd/amdkfd/Kconfig +++ b/drivers/gpu/drm/amd/amdkfd/Kconfig @@ -6,7 +6,7 @@ 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 AMD_IOMMU_V2=y || DRM_AMDGPU=m select HMM_MIRROR select MMU_NOTIFIER select DRM_AMDGPU_USERPTR