Linux Sound subsystem development
 help / color / mirror / Atom feed
* [PATCH] ALSA: hda: intel: Release i915 component when delayed probe fails
@ 2026-11-19 16:22 Kai Vehmanen
  2026-11-19 16:32 ` Michał Grzelak
  2026-11-19 16:45 ` sashiko-bot
  0 siblings, 2 replies; 3+ messages in thread
From: Kai Vehmanen @ 2026-11-19 16:22 UTC (permalink / raw)
  To: linux-sound, tiwai, Peter Ujfalusi; +Cc: kai.vehmanen, Michal Grzelak

Commit fbaccb1b19c7 ("ALSA: hda: intel: Don't free card in the probe
work") stopped freeing the card from azx_probe_work() when the delayed
probe fails, and only disconnects it, leaving the free to azx_remove().
This avoids the double free, but the resources that were released by
the card free via azx_free() are now kept until the PCI device is
unbound. In particular the display power reference and the audio
component binding to the graphics driver stay held for a controller
that will never become operational. This blocks unloading of the i915
driver, which breaks display driver reload.

Release the display power and the i915 audio component in the probe
work error path. Both snd_hdac_display_power() and snd_hdac_acomp_exit()
are safe to repeat, so the later azx_free() call from azx_remove() is
not affected. azx_free() can't be called directly here as it would
run before the codec instances are released by the card free.

Fixes: fbaccb1b19c7 ("ALSA: hda: intel: Don't free card in the probe work")
Link: https://gitlab.freedesktop.org/drm/i915/kernel/-/work_items/17751
Reported-by: Michal Grzelak <michal.grzelak@intel.com>
Tested-by-by: Michal Grzelak <michal.grzelak@intel.com>
Signed-off-by: Kai Vehmanen <kai.vehmanen@linux.intel.com>
---
 sound/hda/controllers/intel.c | 14 +++++++++++++-
 1 file changed, 13 insertions(+), 1 deletion(-)

diff --git a/sound/hda/controllers/intel.c b/sound/hda/controllers/intel.c
index 0a62723b3454..73ff42faccb7 100644
--- a/sound/hda/controllers/intel.c
+++ b/sound/hda/controllers/intel.c
@@ -1740,9 +1740,21 @@ static void azx_probe_work(struct work_struct *work)
 	struct hda_intel *hda = container_of(work, struct hda_intel, probe_work.work);
 
 	if (azx_probe_continue(&hda->chip, false) < 0) {
+		struct azx *chip = &hda->chip;
+
 		hda->init_failed = 1;
 		complete_all(&hda->probe_wait);
-		snd_card_disconnect(hda->chip.card);
+		snd_card_disconnect(chip->card);
+
+		/*
+		 * The card itself is left to azx_remove() to free, but the
+		 * graphics driver must not be kept bound to a controller that
+		 * will never become operational; this would e.g. block
+		 * unloading i915. Both calls are safe to repeat from azx_free().
+		 */
+		display_power(chip, false);
+		if (chip->driver_caps & AZX_DCAPS_I915_COMPONENT)
+			snd_hdac_i915_exit(azx_bus(chip));
 	}
 }
 

base-commit: ec925d3740159f4b4bd3b7640be5d0d2b4664106
-- 
2.43.0


^ permalink raw reply related	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2026-11-19 16:45 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-11-19 16:22 [PATCH] ALSA: hda: intel: Release i915 component when delayed probe fails Kai Vehmanen
2026-11-19 16:32 ` Michał Grzelak
2026-11-19 16:45 ` sashiko-bot

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox