[igt-dev] [PATCH] [PATCH i-g-t]lib/sw_sync:Fixing modprobe for sw_sync to return if not supported

Chris Wilson chris at chris-wilson.co.uk
Fri Jul 3 11:04:49 UTC 2020


Quoting Arjun Melkaveri (2020-07-03 11:33:52)
> Few tests that use "igt_require_sw_sync" , would not skip or assert the
> test if it fails to load sw_sync module.
> 
> Mentioned error is seen and test continues executing .
> "igt_kmod-DEBUG: Unknown symbol in module sw_sync or unknown parameter"
> 
> igt_require for modprobe in this file would skip the test if it fails
> to load the module.

Which then fails when it is builtin.

> Cc: Chris Wilson <chris at chris-wilson.co.uk>
> Cc: Tvrtko Ursulin <tvrtko.ursulin at linux.intel.com>
> Signed-off-by: Arjun Melkaveri <arjun.melkaveri at intel.com>
> ---
>  lib/sw_sync.c | 7 ++++---
>  1 file changed, 4 insertions(+), 3 deletions(-)
> 
> diff --git a/lib/sw_sync.c b/lib/sw_sync.c
> index e860a2c1..ed8375ca 100644
> --- a/lib/sw_sync.c
> +++ b/lib/sw_sync.c
> @@ -228,16 +228,17 @@ int sync_fence_status(int fence)
>         return info.status;
>  }
>  
> -static void modprobe(const char *driver)
> +static int modprobe(const char *driver)
>  {
> -       igt_kmod_load(driver, NULL);
> +       return igt_kmod_load(driver, NULL);
>  }
>  
>  static bool kernel_has_sw_sync(void)
>  {
>         char buf[128];
>  
> -       modprobe("sw_sync");
> +       /* Make sure our Kernel supports sw_sync and the module is loaded. */
> +       igt_require(modprobe("sw_sync") == 0);
>  
>         return kernel_sw_sync_path(buf, sizeof(buf));

It's the return from this function that needs to be checked, and indeed
is: igt_require_sw_sync().
-Chris


More information about the igt-dev mailing list