All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] kunit: Export kunit_running()
@ 2023-01-17 16:50 Arnd Bergmann
  2023-01-18  0:37 ` David Gow
  0 siblings, 1 reply; 4+ messages in thread
From: Arnd Bergmann @ 2023-01-17 16:50 UTC (permalink / raw)
  To: Brendan Higgins, David Gow
  Cc: Arnd Bergmann, Shuah Khan, Daniel Latypov, Jeremy Kerr,
	Joe Fradley, Maxime Ripard, Javier Martinez Canillas,
	Maíra Canal, linux-kselftest, kunit-dev, linux-kernel

From: Arnd Bergmann <arnd@arndb.de>

Using kunit_fail_current_test() in a loadable module causes a link
error like:

ERROR: modpost: "kunit_running" [drivers/gpu/drm/vc4/vc4.ko] undefined!

Export the symbol to allow using it from modules.

Fixes: da43ff045c3f ("drm/vc4: tests: Fail the current test if we access a register")
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
---
 lib/kunit/test.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/lib/kunit/test.c b/lib/kunit/test.c
index c9ebf975e56b..890ba5b3a981 100644
--- a/lib/kunit/test.c
+++ b/lib/kunit/test.c
@@ -21,6 +21,7 @@
 #include "try-catch-impl.h"
 
 DEFINE_STATIC_KEY_FALSE(kunit_running);
+EXPORT_SYMBOL_GPL(kunit_running);
 
 #if IS_BUILTIN(CONFIG_KUNIT)
 /*
-- 
2.39.0


^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH] kunit: Export kunit_running()
  2023-01-17 16:50 [PATCH] kunit: Export kunit_running() Arnd Bergmann
@ 2023-01-18  0:37 ` David Gow
  2023-01-18 11:02   ` Maxime Ripard
  0 siblings, 1 reply; 4+ messages in thread
From: David Gow @ 2023-01-18  0:37 UTC (permalink / raw)
  To: Arnd Bergmann
  Cc: Brendan Higgins, Arnd Bergmann, Shuah Khan, Daniel Latypov,
	Jeremy Kerr, Joe Fradley, Maxime Ripard,
	Javier Martinez Canillas, Maíra Canal, linux-kselftest,
	kunit-dev, linux-kernel

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

On Wed, 18 Jan 2023 at 00:50, Arnd Bergmann <arnd@kernel.org> wrote:
>
> From: Arnd Bergmann <arnd@arndb.de>
>
> Using kunit_fail_current_test() in a loadable module causes a link
> error like:
>
> ERROR: modpost: "kunit_running" [drivers/gpu/drm/vc4/vc4.ko] undefined!
>
> Export the symbol to allow using it from modules.
>
> Fixes: da43ff045c3f ("drm/vc4: tests: Fail the current test if we access a register")
> Signed-off-by: Arnd Bergmann <arnd@arndb.de>
> ---

Thanks for fixing this!

I think the longer-term solution for this is the "hooks" approach
(which works even when KUnit itself is built as a module):
https://lore.kernel.org/all/20230117142737.246446-1-davidgow@google.com/

But this looks good to fix it in the meantime.

Reviewed-by: David Gow <davidgow@google.com>

Cheers,
-- David

>  lib/kunit/test.c | 1 +
>  1 file changed, 1 insertion(+)
>
> diff --git a/lib/kunit/test.c b/lib/kunit/test.c
> index c9ebf975e56b..890ba5b3a981 100644
> --- a/lib/kunit/test.c
> +++ b/lib/kunit/test.c
> @@ -21,6 +21,7 @@
>  #include "try-catch-impl.h"
>
>  DEFINE_STATIC_KEY_FALSE(kunit_running);
> +EXPORT_SYMBOL_GPL(kunit_running);
>
>  #if IS_BUILTIN(CONFIG_KUNIT)
>  /*
> --
> 2.39.0
>

[-- Attachment #2: S/MIME Cryptographic Signature --]
[-- Type: application/pkcs7-signature, Size: 4003 bytes --]

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] kunit: Export kunit_running()
  2023-01-18  0:37 ` David Gow
@ 2023-01-18 11:02   ` Maxime Ripard
  2023-01-20  6:13     ` David Gow
  0 siblings, 1 reply; 4+ messages in thread
From: Maxime Ripard @ 2023-01-18 11:02 UTC (permalink / raw)
  To: David Gow
  Cc: Arnd Bergmann, Brendan Higgins, Arnd Bergmann, Shuah Khan,
	Daniel Latypov, Jeremy Kerr, Joe Fradley,
	Javier Martinez Canillas, Maíra Canal, linux-kselftest,
	kunit-dev, linux-kernel

Hi David, Arnd,

Thanks for fixing this issue

On Wed, Jan 18, 2023 at 08:37:26AM +0800, David Gow wrote:
> On Wed, 18 Jan 2023 at 00:50, Arnd Bergmann <arnd@kernel.org> wrote:
> >
> > From: Arnd Bergmann <arnd@arndb.de>
> >
> > Using kunit_fail_current_test() in a loadable module causes a link
> > error like:
> >
> > ERROR: modpost: "kunit_running" [drivers/gpu/drm/vc4/vc4.ko] undefined!
> >
> > Export the symbol to allow using it from modules.
> >
> > Fixes: da43ff045c3f ("drm/vc4: tests: Fail the current test if we access a register")
> > Signed-off-by: Arnd Bergmann <arnd@arndb.de>
> > ---
> 
> Thanks for fixing this!
> 
> I think the longer-term solution for this is the "hooks" approach
> (which works even when KUnit itself is built as a module):
> https://lore.kernel.org/all/20230117142737.246446-1-davidgow@google.com/
> 
> But this looks good to fix it in the meantime.
> 
> Reviewed-by: David Gow <davidgow@google.com>

How do you want to merge that patch? Will you take it through your tree?

Maxime

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] kunit: Export kunit_running()
  2023-01-18 11:02   ` Maxime Ripard
@ 2023-01-20  6:13     ` David Gow
  0 siblings, 0 replies; 4+ messages in thread
From: David Gow @ 2023-01-20  6:13 UTC (permalink / raw)
  To: Maxime Ripard
  Cc: Arnd Bergmann, Brendan Higgins, Arnd Bergmann, Shuah Khan,
	Daniel Latypov, Jeremy Kerr, Joe Fradley,
	Javier Martinez Canillas, Maíra Canal, linux-kselftest,
	kunit-dev, linux-kernel

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

On Wed, 18 Jan 2023 at 19:02, Maxime Ripard <maxime@cerno.tech> wrote:
>
> Hi David, Arnd,
>
> Thanks for fixing this issue
>
> On Wed, Jan 18, 2023 at 08:37:26AM +0800, David Gow wrote:
> > On Wed, 18 Jan 2023 at 00:50, Arnd Bergmann <arnd@kernel.org> wrote:
> > >
> > > From: Arnd Bergmann <arnd@arndb.de>
> > >
> > > Using kunit_fail_current_test() in a loadable module causes a link
> > > error like:
> > >
> > > ERROR: modpost: "kunit_running" [drivers/gpu/drm/vc4/vc4.ko] undefined!
> > >
> > > Export the symbol to allow using it from modules.
> > >
> > > Fixes: da43ff045c3f ("drm/vc4: tests: Fail the current test if we access a register")
> > > Signed-off-by: Arnd Bergmann <arnd@arndb.de>
> > > ---
> >
> > Thanks for fixing this!
> >
> > I think the longer-term solution for this is the "hooks" approach
> > (which works even when KUnit itself is built as a module):
> > https://lore.kernel.org/all/20230117142737.246446-1-davidgow@google.com/
> >
> > But this looks good to fix it in the meantime.
> >
> > Reviewed-by: David Gow <davidgow@google.com>
>
> How do you want to merge that patch? Will you take it through your tree?
>

We'll take this via the kunit/kselftest tree, thanks!

Cheers,
-- David

[-- Attachment #2: S/MIME Cryptographic Signature --]
[-- Type: application/pkcs7-signature, Size: 4003 bytes --]

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2023-01-20  6:13 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-01-17 16:50 [PATCH] kunit: Export kunit_running() Arnd Bergmann
2023-01-18  0:37 ` David Gow
2023-01-18 11:02   ` Maxime Ripard
2023-01-20  6:13     ` David Gow

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.