[PATCH i-g-t v2 3/6] lib/kunit: Unload base KUnit module only before reloading it

Janusz Krzysztofik janusz.krzysztofik at linux.intel.com
Thu Feb 1 10:24:56 UTC 2024


Hi Lucas,

On Wednesday, 31 January 2024 23:46:59 CET Lucas De Marchi wrote:
> On Wed, Jan 31, 2024 at 07:03:50PM +0100, Janusz Krzysztofik wrote:
> >In preparation for replacement of the current method of reloading base
> >KUnit module when a new set of module parameters is needed with updating
> >those parameters via sysfs, unload the module right before it is now
> >reloaded with new parameters, and stop unloading it in other places.
> >Follow-up patches will remove some of the code added here, but even then
> >they will be shorter and more clean with that adjustment already in place.
> >
> >Signed-off-by: Janusz Krzysztofik <janusz.krzysztofik at linux.intel.com>
> >---
> > lib/igt_kmod.c | 23 ++++++++++++-----------
> > 1 file changed, 12 insertions(+), 11 deletions(-)
> >
> >diff --git a/lib/igt_kmod.c b/lib/igt_kmod.c
> >index d1091bdc79..d2c28d0a64 100644
> >--- a/lib/igt_kmod.c
> >+++ b/lib/igt_kmod.c
> >@@ -1130,6 +1130,7 @@ static void kunit_get_tests(struct igt_list_head *tests,
> > 	 * iterating over KTAP results collected from blind execution of all
> > 	 * Kunit test cases provided by a Kunit test module.
> > 	 */
> >+	igt_ignore_warn(igt_kmod_unload("kunit", KMOD_REMOVE_FORCE));
> 
> with the rw params, we should be able to run with a built-in kunit. Will
> we be able to with this call here?

Please note that next patch drops module unloading completely from the code.  

This patch has been added to the series on request from Kamil (IGT maintainer) 
for splitting the initially single patch into four.  I partially objected that 
requirement, but since there was no response from Kamil, I found the way to do 
it.

The idea is to place calls to igt_kmod_unload("kunit", ...) only in front of 
igt_kmod_load("kunit", ...) or a block of code that results in the module 
being loaded automatically, so next patch can replace those operations with 
kunit_set_parameters() more clearly, not touching other code chunks.

Thanks,
Janusz

> 
> Lucas De Marchi
> 






More information about the igt-dev mailing list