Intel-GFX Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Imre Deak <imre.deak@intel.com>
To: Jani Nikula <jani.nikula@intel.com>
Cc: <intel-gfx@lists.freedesktop.org>, <intel-xe@lists.freedesktop.org>
Subject: Re: [PATCH] drm/i915/dp: use EXPORT_SYMBOL_IF_KUNIT() for kunit helpers
Date: Wed, 16 Sep 2026 12:27:08 +0300	[thread overview]
Message-ID: <aqpg7Ci9a12a14dr@ideak-desk.lan> (raw)
In-Reply-To: <96b06c0f2b846afde41582b5f291a2fd51680c44@intel.com>

On Wed, Sep 16, 2026 at 10:27:52AM +0300, Jani Nikula wrote:
> On Wed, 16 Sep 2026, Imre Deak <imre.deak@intel.com> wrote:
> > On Tue, Sep 15, 2026 at 09:48:14PM +0300, Imre Deak wrote:
> >> On Tue, Sep 15, 2026 at 07:06:20PM +0300, Jani Nikula wrote:
> >> > Use EXPORT_SYMBOL_IF_KUNIT() instead of the regular EXPORT_SYMBOL() to
> >> > export the symbols to the kunit namespace. Otherwise, the symbols get
> >> > exported for all the kernel to see, and the corresponding
> >> > MODULE_IMPORT_NS("EXPORTED_FOR_KUNIT_TESTING") in the tests is
> >> > meaningless.
> >> 
> >> Yes, these symblols are only used by kunit, so no need to export them
> >> otherwise. Should've thought about it while typing the above
> >> MODULE_IMPORT_NS():
> >> 
> >> Reviewed-by: Imre Deak <imre.deak@intel.com>
> >
> > Actually, the symbols are defined and exported only if KUNIT is enabled
> > without this patch already, as both of these are in an
> > IS_ENABLED(CONFIG_KUNIT) block.
> 
> That only gates whether they're exported or not. The change is about
> exporting them to the kunit namespace when they're exported.

Right, so in a kunit build the visibility of symbols was still too
broad. The R-b still applies.

> 
> BR,
> Jani.
> 
> 
> 
> >
> >> > Fixes: 2eb9982ff179 ("drm/i915/kunit: Export link training and caps funcs for testing")
> >> > Cc: Imre Deak <imre.deak@intel.com>
> >> > Signed-off-by: Jani Nikula <jani.nikula@intel.com>
> >> > ---
> >> >  drivers/gpu/drm/i915/display/intel_dp_link_caps.c     | 6 ++++--
> >> >  drivers/gpu/drm/i915/display/intel_dp_link_training.c | 4 ++--
> >> >  2 files changed, 6 insertions(+), 4 deletions(-)
> >> > 
> >> > diff --git a/drivers/gpu/drm/i915/display/intel_dp_link_caps.c b/drivers/gpu/drm/i915/display/intel_dp_link_caps.c
> >> > index 98657aa4d3d5..abec3e2519ca 100644
> >> > --- a/drivers/gpu/drm/i915/display/intel_dp_link_caps.c
> >> > +++ b/drivers/gpu/drm/i915/display/intel_dp_link_caps.c
> >> > @@ -3,6 +3,8 @@
> >> >   * Copyright © 2026 Intel Corporation
> >> >   */
> >> >  
> >> > +#include <kunit/visibility.h>
> >> > +
> >> >  #include <linux/bitops.h>
> >> >  #include <linux/debugfs.h>
> >> >  #include <linux/log2.h>
> >> > @@ -1302,14 +1304,14 @@ void intel_dp_link_caps_cleanup(struct intel_dp_link_caps *link_caps)
> >> >  const struct intel_dp_link_caps_test_ops i915_display_dp_link_caps_test_ops = {
> >> >  	INTEL_DP_LINK_CAPS_TEST_OPS_INIT
> >> >  };
> >> > -EXPORT_SYMBOL(i915_display_dp_link_caps_test_ops);
> >> > +EXPORT_SYMBOL_IF_KUNIT(i915_display_dp_link_caps_test_ops);
> >> >  
> >> >  #else
> >> >  
> >> >  const struct intel_dp_link_caps_test_ops intel_display_dp_link_caps_test_ops = {
> >> >  	INTEL_DP_LINK_CAPS_TEST_OPS_INIT
> >> >  };
> >> > -EXPORT_SYMBOL(intel_display_dp_link_caps_test_ops);
> >> > +EXPORT_SYMBOL_IF_KUNIT(intel_display_dp_link_caps_test_ops);
> >> >  
> >> >  #endif	/* I915 */
> >> >  
> >> > diff --git a/drivers/gpu/drm/i915/display/intel_dp_link_training.c b/drivers/gpu/drm/i915/display/intel_dp_link_training.c
> >> > index cb92cff90614..9a692f4fdfee 100644
> >> > --- a/drivers/gpu/drm/i915/display/intel_dp_link_training.c
> >> > +++ b/drivers/gpu/drm/i915/display/intel_dp_link_training.c
> >> > @@ -2825,14 +2825,14 @@ void intel_dp_link_training_cleanup(struct intel_dp_link_training *link_training
> >> >  const struct intel_dp_link_training_test_ops i915_display_dp_link_training_test_ops = {
> >> >  	INTEL_DP_LINK_TRAINING_TEST_OPS_INIT
> >> >  };
> >> > -EXPORT_SYMBOL(i915_display_dp_link_training_test_ops);
> >> > +EXPORT_SYMBOL_IF_KUNIT(i915_display_dp_link_training_test_ops);
> >> >  
> >> >  #else
> >> >  
> >> >  const struct intel_dp_link_training_test_ops intel_display_dp_link_training_test_ops = {
> >> >  	INTEL_DP_LINK_TRAINING_TEST_OPS_INIT
> >> >  };
> >> > -EXPORT_SYMBOL(intel_display_dp_link_training_test_ops);
> >> > +EXPORT_SYMBOL_IF_KUNIT(intel_display_dp_link_training_test_ops);
> >> >  
> >> >  #endif	/* I915 */
> >> >  
> >> > -- 
> >> > 2.47.3
> >> > 
> 
> -- 
> Jani Nikula, Intel

  reply	other threads:[~2026-09-16  9:27 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-09-15 16:06 [PATCH] drm/i915/dp: use EXPORT_SYMBOL_IF_KUNIT() for kunit helpers Jani Nikula
2026-09-15 18:48 ` Imre Deak
2026-09-16  4:51   ` Imre Deak
2026-09-16  7:27     ` Jani Nikula
2026-09-16  9:27       ` Imre Deak [this message]
2026-09-16 17:35         ` Jani Nikula
2026-09-15 19:52 ` ✓ i915.CI.BAT: success for " Patchwork
2026-09-16  6:12 ` ✓ i915.CI.Full: " Patchwork

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=aqpg7Ci9a12a14dr@ideak-desk.lan \
    --to=imre.deak@intel.com \
    --cc=intel-gfx@lists.freedesktop.org \
    --cc=intel-xe@lists.freedesktop.org \
    --cc=jani.nikula@intel.com \
    /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