Received: by 2002:a05:7208:9594:b0:7e:5202:c8b4 with SMTP id gs20csp1279003rbb; Mon, 26 Feb 2024 04:46:31 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCViYyB3FQD/sJ/NVzAm5yxkXJgtVeeAU8fJhprFo3AYfwhlzQBJ1CsIyPZx7Pzdye0paYgeUlWb2N/DEpWEwzQXhqHwsH7nAhsLIkaVig== X-Google-Smtp-Source: AGHT+IFxBTmlFT6pErVSe91b292GhAOumY34elFNB9ME7GUqDgc/Olb5EpOU71WexMm4ukrutKgu X-Received: by 2002:a05:6902:1366:b0:dc2:1dd0:1d1b with SMTP id bt6-20020a056902136600b00dc21dd01d1bmr3800431ybb.19.1708951591258; Mon, 26 Feb 2024 04:46:31 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1708951591; cv=pass; d=google.com; s=arc-20160816; b=kSSFBbVJ6tVoBLr1MpEdwgv87yYMsrBx8tH9iL7EPp+Dsu1NuUjX310j7UzJbssGOP CAChL8DzNU5N6xZU2lVEryFfLmwiaapl2Mo+oFe3+EfAd+wLlBC7ogN0T3tyWcX3HiVU 7eVj77Yagx/P1+1heIpPY5bk6wctW/rdWVbBGnwbNLVGMavW1ATWvC3uKddj0GMHA1ci VEYhO9x9pXUMvuWO3w1MUqhf4L1bckuZ/pAtuysvriri0CzTpCPiUEP2RPijDEnZeSze EDUPekSd3PEWkJtYdithrg/YR7q7tEoztg+omWibhuHGoZCY57OQCBV0uZpsrAt1F6Il TWNg== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=subject:cc:to:from:date:references:in-reply-to:message-id :mime-version:list-unsubscribe:list-subscribe:list-id:precedence :user-agent:feedback-id:dkim-signature:dkim-signature; bh=tolKghCFsQADX1q2Jjm5jKYzOjR/B/HXvaX3V+TXekk=; fh=en2FSCNkec9LvbP3lNjDA6FMM1vpB0bEGbFdbT62528=; b=BTFttBNhci+mKESLF4L0wZI+yB0ECPuFJVmlN3zTTyFYNffWOgmlKV5Tg6A48jdecO dU4OwyXvX6xuN2QeUfAaQsw3j1oQ4waR02Ayp8fFtAP5K1MRbK3hoIc3W3MO1HJCMjv2 Jn9hYdHrP3MU7g6Fwp7l3TaEcFrb/LfAZZq9XpQuOw+ZSXuRlOFPmDnpdXXG2MWdTKT+ R4cHlJmaq55fTlevb6ybxgWHCkPbLO6/ZE9N+Z3oH7ioTs7Wk8ektPLt2k0yAflM6thI DPYKVef9KDgfPx9fJyXFYbzizcel0M/XO3qT8OX44sFaGloLMG2hSIquEyH88ZI8n0aY 0htg==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@arndb.de header.s=fm3 header.b=rvn+xbm7; dkim=pass header.i=@messagingengine.com header.s=fm1 header.b=on+1Xfn4; arc=pass (i=1 spf=pass spfdomain=arndb.de dkim=pass dkdomain=arndb.de dkim=pass dkdomain=messagingengine.com dmarc=pass fromdomain=arndb.de); spf=pass (google.com: domain of linux-kernel+bounces-81403-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-81403-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=arndb.de Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [2604:1380:45d1:ec00::1]) by mx.google.com with ESMTPS id t5-20020a05622a148500b0042e7f75e01esi2960278qtx.565.2024.02.26.04.46.31 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 26 Feb 2024 04:46:31 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-81403-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) client-ip=2604:1380:45d1:ec00::1; Authentication-Results: mx.google.com; dkim=pass header.i=@arndb.de header.s=fm3 header.b=rvn+xbm7; dkim=pass header.i=@messagingengine.com header.s=fm1 header.b=on+1Xfn4; arc=pass (i=1 spf=pass spfdomain=arndb.de dkim=pass dkdomain=arndb.de dkim=pass dkdomain=messagingengine.com dmarc=pass fromdomain=arndb.de); spf=pass (google.com: domain of linux-kernel+bounces-81403-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-81403-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=arndb.de 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 ny.mirrors.kernel.org (Postfix) with ESMTPS id 9F8551C229DF for ; Mon, 26 Feb 2024 12:46:30 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 774C57F7D0; Mon, 26 Feb 2024 12:46:26 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=arndb.de header.i=@arndb.de header.b="rvn+xbm7"; dkim=pass (2048-bit key) header.d=messagingengine.com header.i=@messagingengine.com header.b="on+1Xfn4" Received: from flow4-smtp.messagingengine.com (flow4-smtp.messagingengine.com [103.168.172.139]) (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 BB74F604D4 for ; Mon, 26 Feb 2024 12:46:23 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=103.168.172.139 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708951585; cv=none; b=a8OFAfCKO9UGP2W4mJGlIOB2bMJe8bwrA8zKj5FByTRgPfG2ZFzFHBCdyTuqRXh7zCnSozB932iriBb5Lh32j053kcB0T5alWk4cgTz3bjTc0nUg/isIgUNHWzZxj1xqIdeHrm52ayjHYDostmm8QxCVLSOM+b0XZiERje6XPSc= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708951585; c=relaxed/simple; bh=Hjga4g8h8EsTThE+F4rVKI4ZVs0b3pehd/liyc4Wgbw=; h=MIME-Version:Message-Id:In-Reply-To:References:Date:From:To:Cc: Subject:Content-Type; b=aMzJvq0yBeBdUJ1+2Rf3ziBBhV4f7lR4A2pG2/ndeJxf1tnPiuT2FGFymmL9WZC3wdbSH67Ao0t3sYWF0UptOyiOxAz1xX3tFI22oxtL24hD5HxKZZxJIidTsEqQS+C2mCC9YSFlhSR7VW20XIARTTcwgi3VW+lWwGfQmzIyY+w= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=arndb.de; spf=pass smtp.mailfrom=arndb.de; dkim=pass (2048-bit key) header.d=arndb.de header.i=@arndb.de header.b=rvn+xbm7; dkim=pass (2048-bit key) header.d=messagingengine.com header.i=@messagingengine.com header.b=on+1Xfn4; arc=none smtp.client-ip=103.168.172.139 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=arndb.de Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=arndb.de Received: from compute5.internal (compute5.nyi.internal [10.202.2.45]) by mailflow.nyi.internal (Postfix) with ESMTP id A607420008D; Mon, 26 Feb 2024 07:46:22 -0500 (EST) Received: from imap51 ([10.202.2.101]) by compute5.internal (MEProxy); Mon, 26 Feb 2024 07:46:22 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=arndb.de; h=cc :cc:content-type:content-type:date:date:from:from:in-reply-to :in-reply-to:message-id:mime-version:references:reply-to:subject :subject:to:to; s=fm3; t=1708951582; x=1708958782; bh=tolKghCFsQ ADX1q2Jjm5jKYzOjR/B/HXvaX3V+TXekk=; b=rvn+xbm7pZZyftzDJFztAqH8YF KhQiIypwmL2ercPlH7urWxllkqskmWZXB1J8GEWU9M/K1hvo2pIOA80Vxd9qR8/K 0IgZ0XpE9ek9Aa68n8/AHbqvtcJRtLUf4Rnd4g3NaowWdZJTY+YBGBUQwK4yKX0U emljzCLD+7ME516CNEtArsLjvYy/mvVGOGSH427Kl+VJDD5iGN3KAVEudgZronfZ +JjsYrEuELxooBDTKHPTgwY7I1MhMXn+rmigm+FuopWCpVzf3vbzShTSMYMMtCGn gNhapD2qQONmXWe7ea/ngmaRpUPDHBiARZqw8Csx1sXRsoAkRqx7KFt0ooWQ== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-type:content-type:date:date :feedback-id:feedback-id:from:from:in-reply-to:in-reply-to :message-id:mime-version:references:reply-to:subject:subject:to :to:x-me-proxy:x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s= fm1; t=1708951582; x=1708958782; bh=tolKghCFsQADX1q2Jjm5jKYzOjR/ B/HXvaX3V+TXekk=; b=on+1Xfn4V8nkMVxRKRveEKNq/P0ULsBTXEM6igzd2K5X gnxx/g6WH/hZv0FyxTHNvv6P9muFaVyKr///MXz2oReQN1Hvr5Huy8YCXlSMtgkW 0RcuXxMWc4lT0neu+elBX3STLo8o8EUZuujy7ldWPv6KPqyXzCemOHu6HTHLujiU VqACvGC7iskSWVac+YSDAPFVtNCWk1bsVDusfFi2B1e4MSsPCJYWKMf82nj2myCf yzrL6UepxrwXTD4wKxV9GKqaIg7qbJVk97sjbivy2Umz4ddfISFVW98Sq7/YKcCE l3R1ktxfO0DKvOofL6akLv46VdJlMKt4iR3UVE+SSw== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvledrgedvgdegvdcutefuodetggdotefrodftvf curfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfghnecu uegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenuc fjughrpefofgggkfgjfhffhffvvefutgesthdtredtreertdenucfhrhhomhepfdetrhhn ugcuuegvrhhgmhgrnhhnfdcuoegrrhhnugesrghrnhgusgdruggvqeenucggtffrrghtth gvrhhnpeffheeugeetiefhgeethfejgfdtuefggeejleehjeeutefhfeeggefhkedtkeet ffenucevlhhushhtvghrufhiiigvpedtnecurfgrrhgrmhepmhgrihhlfhhrohhmpegrrh hnugesrghrnhgusgdruggv X-ME-Proxy: Feedback-ID: i56a14606:Fastmail Received: by mailuser.nyi.internal (Postfix, from userid 501) id 3ABBFB6008D; Mon, 26 Feb 2024 07:46:22 -0500 (EST) X-Mailer: MessagingEngine.com Webmail Interface User-Agent: Cyrus-JMAP/3.11.0-alpha0-153-g7e3bb84806-fm-20240215.007-g7e3bb848 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-Id: <79815966-a8fe-46cf-85ee-16657fa2392c@app.fastmail.com> In-Reply-To: <7hfobmmgs6ntnusobalqxslcyv3kqdlnhxjoxbaful4ameavj2@niodl55l7b7g> References: <20240224121528.1972719-1-arnd@kernel.org> <7hfobmmgs6ntnusobalqxslcyv3kqdlnhxjoxbaful4ameavj2@niodl55l7b7g> Date: Mon, 26 Feb 2024 13:46:01 +0100 From: "Arnd Bergmann" To: "Lucas De Marchi" , "Arnd Bergmann" Cc: "Oded Gabbay" , =?UTF-8?Q?Thomas_Hellstr=C3=B6m?= , "Maarten Lankhorst" , "Maxime Ripard" , "Thomas Zimmermann" , "Dave Airlie" , "Daniel Vetter" , "Rodrigo Vivi" , "Matthew Brost" , "Francois Dugast" , "Jani Nikula" , "Tejas Upadhyay" , "Matthew Auld" , "Mauro Carvalho Chehab" , "Michal Wajdeczko" , "Matt Roper" , "Daniele Ceraolo Spurio" , intel-xe@lists.freedesktop.org, dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH 1/3] drm/xe/kunit: fix link failure with built-in xe Content-Type: text/plain On Mon, Feb 26, 2024, at 04:42, Lucas De Marchi wrote: > On Sat, Feb 24, 2024 at 01:14:59PM +0100, Arnd Bergmann wrote: >>From: Arnd Bergmann >> >>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. >> >>The tests/xe_kunit_helpers.c file depends on DRM_KUNIT_TEST_HELPERS, >>so this has to always be selected by the main XE module now, rather >>than the actual tests. In turn, the "depends on (m || (y && KUNIT=y))" >>doesn't really do what it tried and can just be removed. > > it actually did, which was to workaround issues prior to the commit you > are pointing out. What it did was to make sure xe.ko is m, or if it's > built-in, kunit is also built-in. Apparently the problem here is that > the xe_test.ko is missing the symbols. Ah, I misunderstood the intention, as I was thrown off by the redundant 'y &&' which sounds like it was trying to force XE to be built-in rather than modular when Kunit is !=m. The more common way to write this is 'depends on KUNIT || !KUNIT', with some drivers writing it as 'depends on m || KUNIT!=m'. I double-checked now and found that the dependency is indeed still needed: WARNING: unmet direct dependencies detected for DRM_KUNIT_TEST_HELPERS Depends on [m]: HAS_IOMEM [=y] && DRM [=y] && KUNIT [=m] Selected by [y]: - DRM_XE [=y] && HAS_IOMEM [=y] && DRM [=y] && PCI [=y] && MMU [=y] && (ACPI_VIDEO [=y] || !ACPI [=y]) && DRM_XE_KUNIT_TEST [=m]!=n Selected by [m]: - DRM_KUNIT_TEST [=m] && HAS_IOMEM [=y] && DRM [=y] && KUNIT [=m] && MMU [=y] > See commit 08987a8b6820 ("drm/xe: Fix build with KUNIT=m"). > > I'm happy to remove it though if it's indeed not needed anymore. Ideally the xe.ko module should not depend on anything exported by lib/kunit, but for the moment, the tests/xe_kunit_helpers.o file is still included in xe.ko and in turn depends on kunit. Changing this is probably a little more complicated than my patch, so I'll just send a v2 without the incorrect line. Arnd