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

Andi Shyti andi.shyti at linux.intel.com
Wed May 18 09:56:08 UTC 2022


Hi Mauro,

On Tue, May 17, 2022 at 02:44:41PM +0200, Mauro Carvalho Chehab wrote:
> From: Mauro Carvalho Chehab <mchehab at kernel.org>
> 
> The dependencies between audio and DRM drivers are not trivial.
> 
> On several CPUs, the logic inside snd-hda-intel, for instance, tries to
> hook into i915 driver, via drm_audio_component logic. That also happens
> when there's no runtime PM.
> 
> When the audio driver is bound into i915, removing or unbinding i915
> without first removing the audio driver produce Kernel errors.
> 
> So, the audio driver(s) should be removed first, and this can only
> happen after pulseaudio, pipewire-pulse, audioctl and any other
> userspace program stops using it.
> 
> This is more prune to failures. So, the best is to only try to stop
> the audio driver when it is known to have dependencies on the video
> driver.
> 
> Before an upcoming Kernel patch, there's no way to detect if the
> audio driver required a DRM one. So, the safest way is to always
> remove the audio drivers that are known to cause issues.
> 
> After the new Kernel, the logic can be more selective, only removing
> the audio driver if /proc/modules shows dependencies with the DRM
> driver.
> 
> Reviewed-by Jonathan Cavitt <jonathan.cavitt at intel.com>
> Signed-off-by: Mauro Carvalho Chehab <mchehab at kernel.org>

Reviewed-by: Andi Shyti <andi.shyti at linux.intel.com>

Andi


More information about the igt-dev mailing list