Message ID | 20240226124736.1272949-1-arnd@kernel.org |
---|---|
State | New |
Headers |
Return-Path: <linux-kernel+bounces-81405-ouuuleilei=gmail.com@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7300:a81b:b0:108:e6aa:91d0 with SMTP id bq27csp2048579dyb; Mon, 26 Feb 2024 04:48:14 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCV1ve2COZN0KiJGUP+TSbr4Yr9fGtXrU7BKpybsGmttXuYyj//dcDgQTEfzm1JWdgUWj5GfAlCaPLqjrPcYp9HOkABNZw== X-Google-Smtp-Source: AGHT+IFirNTw45Df9FfcHvoFGaW6Orj42Lio8XRpQ2v6dnclYks8BlLT0CJvxVChjzjfKbj3ed1/ X-Received: by 2002:a17:906:fb07:b0:a43:4876:983b with SMTP id lz7-20020a170906fb0700b00a434876983bmr1897927ejb.57.1708951693801; Mon, 26 Feb 2024 04:48:13 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1708951693; cv=pass; d=google.com; s=arc-20160816; b=uW1fTek+aW/VbTIpo34ieDCUALC4mcALMaKB/jToYOLZUcn0yAoKEiAQfWfyYVAjJf ZUXQBh+A4tMt3/vx/PKI8KiwUtQgBPTeJ7XHBs3cfRytK9JmLmCwKXFNh4YxZzETwdjN crcooRfrP6uTP4z85275TBzARpPGtfTE9lAWNCsQGpoVJAW+PAGmOOhPM1AL6Ux0rwJ6 TbgstM7ilDcfaK9Of9ou7D5ikz4Sgm8aGdANXUJ/RzFvl98v9mIEyRPSwgPgwUCT/KAJ mKu1OW0lDPJGElmVjDBS15gpeIZPbPlkOXaTc56tF7LL9kAeVkWpTQjdo17SiHAx6LyT 51cQ== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:message-id:date:subject:cc:to :from:dkim-signature; bh=iD3v2Ou7opydLf7BV2zQNv5Q6avksFmwr21fP3d+Tu8=; fh=f8i86EdiQTzDTREZDCLliK+apaxdqTjVfw1axe/nDog=; b=t3c5NVQWNBAnVXZ8HYPNfEsnYAPjncj+7bPhhwahAbEARc02Fzfd+SsI1DHLJmhXRc 02XDhUiBDoDJh2tjZfY84m3vRTGdHdJCSOg4bMxRL0G05Vp+yKNChVbKvUWoJLOid5a4 ss6/O6JQwC7b9jaqSx4e3SK8roojJGCJ285WlJE2dZnJHE/yBILVcbCwZmeloqmh4lTK M+xd956vFOLCbp1pkWYcCDpmMtcql5QEnfkMgwt6LzbXnXjIOmPdPNZLUaxoBbCtA5s9 NQ5nWCtUmp24x5qUvKgE6whisskzXkwaGt8WmAaYwqQy8n8yVqjAGS5pt6vvXSAJqnMs M7/w==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=FYqHb7pj; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-81405-ouuuleilei=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-81405-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [147.75.80.249]) by mx.google.com with ESMTPS id dp18-20020a170906c15200b00a42f340eba9si1956248ejc.472.2024.02.26.04.48.13 for <ouuuleilei@gmail.com> (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 26 Feb 2024 04:48:13 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-81405-ouuuleilei=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) client-ip=147.75.80.249; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=FYqHb7pj; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-81405-ouuuleilei=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-81405-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by am.mirrors.kernel.org (Postfix) with ESMTPS id 6DC7A1F245E4 for <ouuuleilei@gmail.com>; Mon, 26 Feb 2024 12:48:13 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id CE36D8063A; Mon, 26 Feb 2024 12:47:46 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="FYqHb7pj" Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 3C468604D4 for <linux-kernel@vger.kernel.org>; Mon, 26 Feb 2024 12:47:43 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708951664; cv=none; b=mI+EZq0Iko+mkndVDSoZQVJP5ioUeKyrTav+rnXAHZ+XC+i/xdSXwgn7nE9ka7gAgbu9h76QZQG6nCYOyUQny3LqO/jOLRboUwTWEPuVWeisJsQi0hK/uBSjHMuAtkv4ZOknbxNyQSllRMz5Lm6SyhX1JIaamqScgbwnPyMhV5A= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708951664; c=relaxed/simple; bh=vPnudlAxEBtSwaSh16NplVrq2SvEXPSzaOEsHkk1YQc=; h=From:To:Cc:Subject:Date:Message-Id:MIME-Version; b=mWotCCamXp9X8CXrHWneJfGbSQAjMLcAKs0RFBSQUApGyLvugdZDmuJyeA4DSHTeDMtDbrl322ygSwXRdN6CWsyqhTJpr4oqQ9YUFfyOXblT/6i/QX0mTbtRykefO77PooZt7eSa5B1XiKOZlGUFh6jDS/SzJb8cAKnhEqJJ2AE= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=FYqHb7pj; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id 7236EC433C7; Mon, 26 Feb 2024 12:47:40 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1708951663; bh=vPnudlAxEBtSwaSh16NplVrq2SvEXPSzaOEsHkk1YQc=; h=From:To:Cc:Subject:Date:From; b=FYqHb7pjQYLZRQcpUsUksBUteFXpvb15TA3fQeT3qftscQBkT/quRXHxaBoDeIZK/ OHn7d7D0euJdnIYvpn8QsSgcGMOgThM0dfJKN1CsdkG9G0bzYJkpNraiDWziCSkgaW zGh4Kx1eVSqy2ZXI0YrpKu3sXdtn2lfpfixfieFK/MZWgDYZT+dMfAdA9m1yi1UOiW fXbq3nlo9J+G7J81H5P8n2Yy/+Kxbym8cwD//m2h3qFI7C3hcgky8XB6ZN02yY7b4i Wd9aKoGJYKdN729IMDTUYV65OV2Mdp0SYGBNZ9ggOKbyptFCiY7OViVw4HJe7M+aO8 Lo7b2hwIQuOMw== From: Arnd Bergmann <arnd@kernel.org> To: Lucas De Marchi <lucas.demarchi@intel.com>, Oded Gabbay <ogabbay@kernel.org>, =?utf-8?q?Thomas_Hellstr=C3=B6m?= <thomas.hellstrom@linux.intel.com> Cc: Arnd Bergmann <arnd@arndb.de>, Maarten Lankhorst <maarten.lankhorst@linux.intel.com>, Maxime Ripard <mripard@kernel.org>, Thomas Zimmermann <tzimmermann@suse.de>, David Airlie <airlied@gmail.com>, Daniel Vetter <daniel@ffwll.ch>, Rodrigo Vivi <rodrigo.vivi@intel.com>, Matthew Brost <matthew.brost@intel.com>, Jani Nikula <jani.nikula@intel.com>, Matt Roper <matthew.d.roper@intel.com>, intel-xe@lists.freedesktop.org, dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org Subject: [PATCH 1/3] [v2] drm/xe/kunit: fix link failure with built-in xe Date: Mon, 26 Feb 2024 13:46:36 +0100 Message-Id: <20240226124736.1272949-1-arnd@kernel.org> X-Mailer: git-send-email 2.39.2 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: <linux-kernel.vger.kernel.org> List-Subscribe: <mailto:linux-kernel+subscribe@vger.kernel.org> List-Unsubscribe: <mailto:linux-kernel+unsubscribe@vger.kernel.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1791965730829931839 X-GMAIL-MSGID: 1791965730829931839 |
Series |
[1/3,v2] drm/xe/kunit: fix link failure with built-in xe
|
|
Commit Message
Arnd Bergmann
Feb. 26, 2024, 12:46 p.m. UTC
From: Arnd Bergmann <arnd@arndb.de> When the driver is built-in but the tests are in loadable modules, the helpers don't actually get put into the driver: ERROR: modpost: "xe_kunit_helper_alloc_xe_device" [drivers/gpu/drm/xe/tests/xe_test.ko] undefined! Change the Makefile to ensure they are always part of the driver even when the rest of the kunit tests are in loadable modules. Fixes: 5095d13d758b ("drm/xe/kunit: Define helper functions to allocate fake xe device") Signed-off-by: Arnd Bergmann <arnd@arndb.de> --- v2: don't remove KUNIT dependency --- drivers/gpu/drm/xe/Kconfig | 1 + drivers/gpu/drm/xe/Kconfig.debug | 1 - drivers/gpu/drm/xe/Makefile | 6 ++++-- 3 files changed, 5 insertions(+), 3 deletions(-)
Comments
On Mon, Feb 26, 2024 at 01:46:36PM +0100, Arnd Bergmann wrote: >From: Arnd Bergmann <arnd@arndb.de> > >When the driver is built-in but the tests are in loadable modules, >the helpers don't actually get put into the driver: > >ERROR: modpost: "xe_kunit_helper_alloc_xe_device" [drivers/gpu/drm/xe/tests/xe_test.ko] undefined! > >Change the Makefile to ensure they are always part of the driver >even when the rest of the kunit tests are in loadable modules. > >Fixes: 5095d13d758b ("drm/xe/kunit: Define helper functions to allocate fake xe device") >Signed-off-by: Arnd Bergmann <arnd@arndb.de> Reviewed-by: Lucas De Marchi <lucas.demarchi@intel.com> thanks Lucas De Marchi >--- >v2: don't remove KUNIT dependency >--- > drivers/gpu/drm/xe/Kconfig | 1 + > drivers/gpu/drm/xe/Kconfig.debug | 1 - > drivers/gpu/drm/xe/Makefile | 6 ++++-- > 3 files changed, 5 insertions(+), 3 deletions(-) > >diff --git a/drivers/gpu/drm/xe/Kconfig b/drivers/gpu/drm/xe/Kconfig >index 6d4428b19a4c..c3a3b204ae5b 100644 >--- a/drivers/gpu/drm/xe/Kconfig >+++ b/drivers/gpu/drm/xe/Kconfig >@@ -11,6 +11,7 @@ config DRM_XE > select DRM_BUDDY > select DRM_EXEC > select DRM_KMS_HELPER >+ select DRM_KUNIT_TEST_HELPERS if DRM_XE_KUNIT_TEST != n > select DRM_PANEL > select DRM_SUBALLOC_HELPER > select DRM_DISPLAY_DP_HELPER >diff --git a/drivers/gpu/drm/xe/Kconfig.debug b/drivers/gpu/drm/xe/Kconfig.debug >index 549065f57a78..df02e5d17d26 100644 >--- a/drivers/gpu/drm/xe/Kconfig.debug >+++ b/drivers/gpu/drm/xe/Kconfig.debug >@@ -76,7 +76,6 @@ config DRM_XE_KUNIT_TEST > depends on DRM_XE && KUNIT && DEBUG_FS > default KUNIT_ALL_TESTS > select DRM_EXPORT_FOR_TESTS if m >- select DRM_KUNIT_TEST_HELPERS > help > Choose this option to allow the driver to perform selftests under > the kunit framework >diff --git a/drivers/gpu/drm/xe/Makefile b/drivers/gpu/drm/xe/Makefile >index 4c6ffe4b2172..b596e4482a9b 100644 >--- a/drivers/gpu/drm/xe/Makefile >+++ b/drivers/gpu/drm/xe/Makefile >@@ -158,8 +158,10 @@ xe-$(CONFIG_PCI_IOV) += \ > xe_lmtt_2l.o \ > xe_lmtt_ml.o > >-xe-$(CONFIG_DRM_XE_KUNIT_TEST) += \ >- tests/xe_kunit_helpers.o >+# include helpers for tests even when XE is built-in >+ifdef CONFIG_DRM_XE_KUNIT_TEST >+xe-y += tests/xe_kunit_helpers.o >+endif > > # i915 Display compat #defines and #includes > subdir-ccflags-$(CONFIG_DRM_XE_DISPLAY) += \ >-- >2.39.2 >
On Mon, 26 Feb 2024 13:46:36 +0100, Arnd Bergmann wrote: > When the driver is built-in but the tests are in loadable modules, > the helpers don't actually get put into the driver: > > ERROR: modpost: "xe_kunit_helper_alloc_xe_device" [drivers/gpu/drm/xe/tests/xe_test.ko] undefined! > > Change the Makefile to ensure they are always part of the driver > even when the rest of the kunit tests are in loadable modules. > > [...] All 3 patches applied to drm-xe-next. Thanks! [1/3] drm/xe/kunit: fix link failure with built-in xe commit: 0e6fec6da25167a568fbaeb8401d8172069124ad [2/3] drm/xe/mmio: fix build warning for BAR resize on 32-bit commit: f5d3983366c0b88ec388b3407b29c1c0862ee2b8 [3/3] drm/xe/xe2: fix 64-bit division in pte_update_size commit: 1408784b599927d2f361bac6dc5170d2ee275f17 Best regards,
diff --git a/drivers/gpu/drm/xe/Kconfig b/drivers/gpu/drm/xe/Kconfig index 6d4428b19a4c..c3a3b204ae5b 100644 --- a/drivers/gpu/drm/xe/Kconfig +++ b/drivers/gpu/drm/xe/Kconfig @@ -11,6 +11,7 @@ config DRM_XE select DRM_BUDDY select DRM_EXEC select DRM_KMS_HELPER + select DRM_KUNIT_TEST_HELPERS if DRM_XE_KUNIT_TEST != n select DRM_PANEL select DRM_SUBALLOC_HELPER select DRM_DISPLAY_DP_HELPER diff --git a/drivers/gpu/drm/xe/Kconfig.debug b/drivers/gpu/drm/xe/Kconfig.debug index 549065f57a78..df02e5d17d26 100644 --- a/drivers/gpu/drm/xe/Kconfig.debug +++ b/drivers/gpu/drm/xe/Kconfig.debug @@ -76,7 +76,6 @@ config DRM_XE_KUNIT_TEST depends on DRM_XE && KUNIT && DEBUG_FS default KUNIT_ALL_TESTS select DRM_EXPORT_FOR_TESTS if m - select DRM_KUNIT_TEST_HELPERS help Choose this option to allow the driver to perform selftests under the kunit framework diff --git a/drivers/gpu/drm/xe/Makefile b/drivers/gpu/drm/xe/Makefile index 4c6ffe4b2172..b596e4482a9b 100644 --- a/drivers/gpu/drm/xe/Makefile +++ b/drivers/gpu/drm/xe/Makefile @@ -158,8 +158,10 @@ xe-$(CONFIG_PCI_IOV) += \ xe_lmtt_2l.o \ xe_lmtt_ml.o -xe-$(CONFIG_DRM_XE_KUNIT_TEST) += \ - tests/xe_kunit_helpers.o +# include helpers for tests even when XE is built-in +ifdef CONFIG_DRM_XE_KUNIT_TEST +xe-y += tests/xe_kunit_helpers.o +endif # i915 Display compat #defines and #includes subdir-ccflags-$(CONFIG_DRM_XE_DISPLAY) += \