[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <e5vndkeqsxozognnsn4snuhbvpvmxvz5foj44nrwpsucajwrkr@kvlqsijrehll>
Date: Mon, 26 Feb 2024 10:04:15 +0100
From: Maxime Ripard <mripard@...nel.org>
To: Lucas De Marchi <lucas.demarchi@...el.com>
Cc: Arnd Bergmann <arnd@...nel.org>, Oded Gabbay <ogabbay@...nel.org>,
Thomas Hellström <thomas.hellstrom@...ux.intel.com>, Arnd Bergmann <arnd@...db.de>,
Maarten Lankhorst <maarten.lankhorst@...ux.intel.com>, Thomas Zimmermann <tzimmermann@...e.de>,
David Airlie <airlied@...il.com>, Daniel Vetter <daniel@...ll.ch>,
Rodrigo Vivi <rodrigo.vivi@...el.com>, Matthew Brost <matthew.brost@...el.com>,
Francois Dugast <francois.dugast@...el.com>, Jani Nikula <jani.nikula@...el.com>,
Tejas Upadhyay <tejas.upadhyay@...el.com>, Matthew Auld <matthew.auld@...el.com>,
Mauro Carvalho Chehab <mchehab@...nel.org>, Michal Wajdeczko <michal.wajdeczko@...el.com>,
Matt Roper <matthew.d.roper@...el.com>, Daniele Ceraolo Spurio <daniele.ceraolospurio@...el.com>,
intel-xe@...ts.freedesktop.org, dri-devel@...ts.freedesktop.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH 1/3] drm/xe/kunit: fix link failure with built-in xe
On Sun, Feb 25, 2024 at 09:42:06PM -0600, Lucas De Marchi wrote:
> On Sat, Feb 24, 2024 at 01:14:59PM +0100, Arnd Bergmann wrote:
> > From: Arnd Bergmann <arnd@...db.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.
> >
> > 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.
>
> See commit 08987a8b6820 ("drm/xe: Fix build with KUNIT=m").
>
> I'm happy to remove it though if it's indeed not needed anymore.
I think the main issue with that original patch is that it keeps the
direct include of the test files.
I assume it was done to allow kunit tests of static functions, but now
that VISIBLE_IF_KUNIT and EXPORT_SYMBOL_IF_KUNIT are a thing, you don't
have the need for that include, and you can build your tests in a module
while the code is builtin.
And the conversion should be pretty minimal.
Maxime
Download attachment "signature.asc" of type "application/pgp-signature" (229 bytes)
Powered by blists - more mailing lists