[igt-dev] [PATCH i-g-t v2 5/6] lib/igt_kmod: make it less pedantic with audio driver removal
Andi Shyti
andi.shyti at intel.com
Thu May 5 17:57:48 UTC 2022
Hi Mauro,
> Current Linux Kernel don't report if the audio driver binds
> into the DRM driver. As this is CPU specific, allow audio
> driver unload fail without skipping the IGT tests on legacy
> Kernels, as this may not be mandatory.
>
> On new kernels where lsmod will properly display de dependency
/de/the/
> between the audio and DRM drivers, skip the core hotunplug
> test if it fails to unload the audio driver, as this is is
/is//
[...]
> int igt_audio_driver_unload(const char **who)
> {
> + const char *drm_driver = "i915";
> unsigned int num_mod, i, j;
> struct module_ref *mod;
> int pos = -1;
> @@ -572,7 +588,7 @@ int igt_audio_driver_unload(const char **who)
> mod = read_module_dependencies(&num_mod);
>
> for (i = 0; i < num_mod; i++) {
> - if (!strcmp(mod[i].name, "i915")) {
> + if (!strcmp(mod[i].name, drm_driver)) {
> break;
> }
> }
> @@ -580,14 +596,15 @@ int igt_audio_driver_unload(const char **who)
> if (i == num_mod)
> return 0;
>
> - /* Recursively remove all drivers that depend on i915 */
> + /* Recursively remove all drivers that depend on the drm driver */
> for (j = 0; j < mod[i].num_required; j++) {
> pos = mod[i].required_by[j];
> if (who)
> *who = strdup(mod[pos].name);
> /*
> - * If a sound driver depends on i915, kill audio processes
> - * first, in order to make it possible to unload the driver
> + * If a sound driver depends on the drm driver, kill audio
> + * processes first, in order to make it possible to unload
> + * the driver.
Why isn't i915 --> drm_driver done in patch 3?
[...]
Looks good, though,
Reviewed-by: Andi Shyti <andi.shyti at linux.intel.com>
Andi
More information about the igt-dev
mailing list