[igt-dev] [PATCH i-g-t v3 3/6] lib/igt_kmod: improve audio unbind logic

Lucas De Marchi lucas.demarchi at intel.com
Wed May 11 17:09:13 UTC 2022


On Fri, May 06, 2022 at 01:48:26PM +0200, Mauro Carvalho Chehab wrote:
>+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;
>+	int ret = 0;
>+
>+	/*
>+	 * On older Kernels, there's no way to check if the audio driver
>+	 * binds into the DRM one. So, always remove audio drivers that
>+	 * might be binding.
>+	 */
>+	if (linux_kernel_version() < LINUX_VERSION(5, 20, 0))

comparing specific kernel version is not very good practice as features
are moved from one kernel to the other, backported, etc.

if at all, we should test if something is present in the kernel. If we
can't, then we either add support for that if we can enough.
For IGT we can probably simply take the approach of landing this only
when the corresponding kernel support is merged.

What we could merge today is: always unload audio drivers.

Lucas De Marchi


More information about the igt-dev mailing list