From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga17.intel.com (mga17.intel.com [192.55.52.151]) by gabe.freedesktop.org (Postfix) with ESMTPS id 0F59310F284 for ; Wed, 18 May 2022 09:56:14 +0000 (UTC) Date: Wed, 18 May 2022 11:56:08 +0200 From: Andi Shyti Message-ID: References: <20220517124447.211014-1-mauro.chehab@linux.intel.com> <20220517124447.211014-4-mauro.chehab@linux.intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20220517124447.211014-4-mauro.chehab@linux.intel.com> Subject: Re: [igt-dev] [PATCH i-g-t v5 3/9] lib/igt_kmod: improve audio unbind logic List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: igt-dev-bounces@lists.freedesktop.org Sender: "igt-dev" To: Mauro Carvalho Chehab Cc: igt-dev@lists.freedesktop.org, Jonathan Cavitt , Petri Latvala List-ID: Hi Mauro, On Tue, May 17, 2022 at 02:44:41PM +0200, Mauro Carvalho Chehab wrote: > From: Mauro Carvalho Chehab > > 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 > Signed-off-by: Mauro Carvalho Chehab Reviewed-by: Andi Shyti Andi