Igt-dev Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Janusz Krzysztofik <janusz.krzysztofik@linux.intel.com>
To: igt-dev@lists.freedesktop.org
Cc: twoerner@gmail.com, linux-kselftest@vger.kernel.org,
	magalilemes00@gmail.com, maira.canal@usp.br, dlatypov@google.com,
	tales.aparecida@gmail.com, brendanhiggins@google.com,
	linux-kernel@vger.kernel.org, leandro.ribeiro@collabora.com,
	dri-devel@lists.freedesktop.org, daniel@ffwll.ch,
	n@nfraprado.net, davidgow@google.com, skhan@linuxfoundation.org,
	andrealmeid@riseup.net, Isabella Basso <isabbasso@riseup.net>,
	kunit-dev@googlegroups.com
Subject: Re: [igt-dev] [PATCH i-g-t v2 2/4] lib/igt_kmod.c: check if module is builtin before attempting to unload it
Date: Fri, 09 Sep 2022 17:10:52 +0200	[thread overview]
Message-ID: <13576898.RDIVbhacDa@jkrzyszt-mobl1.ger.corp.intel.com> (raw)
In-Reply-To: <20220829000920.38185-3-isabbasso@riseup.net>

On Monday, 29 August 2022 02:09:18 CEST Isabella Basso wrote:
> This change makes `igt_module_unload_r` safer as it checks whether the

s/igt_module_unload_r/igt_kmod_unload_r/

> module can be unloaded before attempting it.
> 
> Signed-off-by: Isabella Basso <isabbasso@riseup.net>
> ---
>  lib/igt_kmod.c | 3 +++
>  1 file changed, 3 insertions(+)
> 
> diff --git a/lib/igt_kmod.c b/lib/igt_kmod.c
> index bb6cb7bb..97cac7f5 100644
> --- a/lib/igt_kmod.c
> +++ b/lib/igt_kmod.c
> @@ -256,6 +256,9 @@ static int igt_kmod_unload_r(struct kmod_module *kmod, unsigned int flags)
>  	struct kmod_list *holders, *pos;
>  	int err = 0;
>  
> +	if (kmod_module_get_initstate(kmod) == KMOD_MODULE_BUILTIN)
> +		return err;

NIT: I think that return 0; would be more clear.  Anyway,

Acked-by: Janusz Krzysztofik <janusz.krzysztofik@linux.intel.com>

> +
>  	holders = kmod_module_get_holders(kmod);
>  	kmod_list_foreach(pos, holders) {
>  		struct kmod_module *it = kmod_module_get_module(pos);
> 




  parent reply	other threads:[~2022-09-09 15:10 UTC|newest]

Thread overview: 26+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-08-29  0:09 [igt-dev] [PATCH i-g-t v2 0/4] Add support for KUnit tests Isabella Basso
2022-08-29  0:09 ` [igt-dev] [PATCH i-g-t v2 1/4] lib/igt_kmod: rename kselftest functions to ktest Isabella Basso
2022-09-09 15:05   ` Janusz Krzysztofik
2022-08-29  0:09 ` [igt-dev] [PATCH i-g-t v2 2/4] lib/igt_kmod.c: check if module is builtin before attempting to unload it Isabella Basso
2022-08-29  7:43   ` Kamil Konieczny
2022-09-09 15:10   ` Janusz Krzysztofik [this message]
2022-08-29  0:09 ` [igt-dev] [PATCH i-g-t v2 3/4] lib/igt_kmod: add compatibility for KUnit Isabella Basso
2022-09-01  6:37   ` David Gow
2022-09-19 20:43     ` Isabella Basso
2022-09-20  0:25       ` Daniel Latypov
2022-11-01 12:43         ` Mauro Carvalho Chehab
2022-11-01 12:33       ` Mauro Carvalho Chehab
     [not found]         ` <F263C946-123C-407F-984D-7AC284CC1B29@riseup.net>
2022-11-01 18:03           ` Mauro Carvalho Chehab
2022-11-01 12:29     ` Mauro Carvalho Chehab
2022-09-09 15:18   ` Janusz Krzysztofik
2022-09-19 20:55     ` Isabella Basso
2022-11-03  9:48   ` Mauro Carvalho Chehab
2022-11-03 11:40     ` Mauro Carvalho Chehab
2022-11-03 14:57     ` Mauro Carvalho Chehab
2022-08-29  0:09 ` [igt-dev] [PATCH i-g-t v2 4/4] tests: DRM selftests: switch to KUnit Isabella Basso
2022-09-20  8:18   ` Petri Latvala
2022-11-01 12:54     ` Mauro Carvalho Chehab
     [not found]       ` <Y2EcEnAzkt1Qn341@platvala-desk.ger.corp.intel.com>
2022-11-01 13:53         ` Mauro Carvalho Chehab
2022-08-29  0:53 ` [igt-dev] ✓ Fi.CI.BAT: success for Add support for KUnit tests (rev2) Patchwork
2022-08-30 20:14 ` [igt-dev] ✓ Fi.CI.IGT: " Patchwork
2022-09-09 14:49 ` [igt-dev] [PATCH i-g-t v2 0/4] Add support for KUnit tests Janusz Krzysztofik

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=13576898.RDIVbhacDa@jkrzyszt-mobl1.ger.corp.intel.com \
    --to=janusz.krzysztofik@linux.intel.com \
    --cc=andrealmeid@riseup.net \
    --cc=brendanhiggins@google.com \
    --cc=daniel@ffwll.ch \
    --cc=davidgow@google.com \
    --cc=dlatypov@google.com \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=igt-dev@lists.freedesktop.org \
    --cc=isabbasso@riseup.net \
    --cc=kunit-dev@googlegroups.com \
    --cc=leandro.ribeiro@collabora.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-kselftest@vger.kernel.org \
    --cc=magalilemes00@gmail.com \
    --cc=maira.canal@usp.br \
    --cc=n@nfraprado.net \
    --cc=skhan@linuxfoundation.org \
    --cc=tales.aparecida@gmail.com \
    --cc=twoerner@gmail.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