linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Maxime Ripard <mripard@kernel.org>
To: Lucas De Marchi <lucas.demarchi@intel.com>
Cc: "Arnd Bergmann" <arnd@kernel.org>,
	"Oded Gabbay" <ogabbay@kernel.org>,
	"Thomas Hellström" <thomas.hellstrom@linux.intel.com>,
	"Arnd Bergmann" <arnd@arndb.de>,
	"Maarten Lankhorst" <maarten.lankhorst@linux.intel.com>,
	"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>,
	"Francois Dugast" <francois.dugast@intel.com>,
	"Jani Nikula" <jani.nikula@intel.com>,
	"Tejas Upadhyay" <tejas.upadhyay@intel.com>,
	"Matthew Auld" <matthew.auld@intel.com>,
	"Mauro Carvalho Chehab" <mchehab@kernel.org>,
	"Michal Wajdeczko" <michal.wajdeczko@intel.com>,
	"Matt Roper" <matthew.d.roper@intel.com>,
	"Daniele Ceraolo Spurio" <daniele.ceraolospurio@intel.com>,
	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
Date: Mon, 26 Feb 2024 10:04:15 +0100	[thread overview]
Message-ID: <e5vndkeqsxozognnsn4snuhbvpvmxvz5foj44nrwpsucajwrkr@kvlqsijrehll> (raw)
In-Reply-To: <7hfobmmgs6ntnusobalqxslcyv3kqdlnhxjoxbaful4ameavj2@niodl55l7b7g>

[-- Attachment #1: Type: text/plain, Size: 1675 bytes --]

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@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.
> > 
> > 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

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 228 bytes --]

  reply	other threads:[~2024-02-26  9:04 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-02-24 12:14 [PATCH 1/3] drm/xe/kunit: fix link failure with built-in xe Arnd Bergmann
2024-02-24 12:15 ` [PATCH 2/3] drm/xe/mmio: fix build warning for BAR resize on 32-bit Arnd Bergmann
2024-02-26  3:44   ` Lucas De Marchi
2024-02-24 12:15 ` [PATCH 3/3] drm/xe/xe2: fix 64-bit division in pte_update_size Arnd Bergmann
2024-02-26  3:47   ` Lucas De Marchi
2024-02-26  3:42 ` [PATCH 1/3] drm/xe/kunit: fix link failure with built-in xe Lucas De Marchi
2024-02-26  9:04   ` Maxime Ripard [this message]
2024-02-26 12:46   ` Arnd Bergmann

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=e5vndkeqsxozognnsn4snuhbvpvmxvz5foj44nrwpsucajwrkr@kvlqsijrehll \
    --to=mripard@kernel.org \
    --cc=airlied@gmail.com \
    --cc=arnd@arndb.de \
    --cc=arnd@kernel.org \
    --cc=daniel@ffwll.ch \
    --cc=daniele.ceraolospurio@intel.com \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=francois.dugast@intel.com \
    --cc=intel-xe@lists.freedesktop.org \
    --cc=jani.nikula@intel.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=lucas.demarchi@intel.com \
    --cc=maarten.lankhorst@linux.intel.com \
    --cc=matthew.auld@intel.com \
    --cc=matthew.brost@intel.com \
    --cc=matthew.d.roper@intel.com \
    --cc=mchehab@kernel.org \
    --cc=michal.wajdeczko@intel.com \
    --cc=ogabbay@kernel.org \
    --cc=rodrigo.vivi@intel.com \
    --cc=tejas.upadhyay@intel.com \
    --cc=thomas.hellstrom@linux.intel.com \
    --cc=tzimmermann@suse.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).