From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga14.intel.com (mga14.intel.com [192.55.52.115]) by gabe.freedesktop.org (Postfix) with ESMTPS id C8A8F10E1D9 for ; Fri, 1 Apr 2022 02:21:46 +0000 (UTC) Date: Thu, 31 Mar 2022 19:21:45 -0700 Message-ID: <87pmm1h7ba.wl-ashutosh.dixit@intel.com> From: "Dixit, Ashutosh" To: "Ceraolo Spurio, Daniele" In-Reply-To: References: <20220330183259.3003663-1-daniele.ceraolospurio@intel.com> <20220330183259.3003663-2-daniele.ceraolospurio@intel.com> <87r16hh868.wl-ashutosh.dixit@intel.com> MIME-Version: 1.0 (generated by SEMI-EPG 1.14.7 - "Harue") Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Subject: Re: [igt-dev] [PATCH i-g-t 1/2] lib/igt_kmod: Wait for a kmod to finish its probe before unloding it. List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: igt-dev@lists.freedesktop.org Errors-To: igt-dev-bounces@lists.freedesktop.org Sender: "igt-dev" List-ID: On Thu, 31 Mar 2022 19:11:23 -0700, Ceraolo Spurio, Daniele wrote: > > On 3/31/2022 7:03 PM, Dixit, Ashutosh wrote: > > On Wed, 30 Mar 2022 11:32:58 -0700, Daniele Ceraolo Spurio wrote: > >> diff --git a/lib/igt_kmod.c b/lib/igt_kmod.c > >> index cf7a3b22..d2ac8a56 100644 > >> --- a/lib/igt_kmod.c > >> +++ b/lib/igt_kmod.c > >> @@ -143,6 +143,12 @@ out: > >> return ret; > >> } > >> > >> +static bool > >> +igt_kmod_is_loading(struct kmod_module *kmod) > >> +{ > >> + return kmod_module_get_initstate(kmod) =3D=3D KMOD_MODULE_COMING; > > One idea would be to check for KMOD_MODULE_LIVE here which will basical= ly > > invert the logic in the loop but will be a more exact check? But anyway > > it's equivalent so no need to change I guess. > > I was undecided myself, but decided to go with "COMING" because that > matches the exact case I was looking for (i.e. init in progress). I can > flip it to check for KMOD_MODULE_LIVE=A0 if you think that works better > and/or is more generic. Leave as is. Or you decide, either is ok with me. Thanks.