Linux Sound subsystem development
 help / color / mirror / Atom feed
* [PATCH v2 1/2] ALSA: hda: intel: Release i915 power also when delayed probe fails
@ 2026-11-20 15:09 Kai Vehmanen
  2026-11-20 15:09 ` [PATCH v2 2/2] ALSA: hda: intel: Remove unused free_on_error from azx_probe_continue() Kai Vehmanen
  2026-11-22  8:24 ` [PATCH v2 1/2] ALSA: hda: intel: Release i915 power also when delayed probe fails Takashi Iwai
  0 siblings, 2 replies; 3+ messages in thread
From: Kai Vehmanen @ 2026-11-20 15:09 UTC (permalink / raw)
  To: linux-sound, tiwai, Peter Ujfalusi
  Cc: intel-gfx, 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 stay held, blocking
runtime suspend for i915/xe.

Release the display power in the azx_probe_continue() work in all cases.
This power reference is only taken for the purpose of the display codec
probe. If the display codec probe was successful, it will have taken its
own reference. In case of systems with the HDA controller on GPU side
(hda->need_i915_power), functionality is same as before - we have to
keep power.

Fixes: fbaccb1b19c7 ("ALSA: hda: intel: Don't free card in the probe work")
Reported-by: Michal Grzelak <michal.grzelak@intel.com>
Link: https://gitlab.freedesktop.org/drm/i915/kernel/-/work_items/17751
Signed-off-by: Kai Vehmanen <kai.vehmanen@linux.intel.com>
---

Notes for V2:
 - Reduced the scope of change based sashikobot comments. In this version,
   only drop the display power reference taken for probing and do the change
   in in probe_continue(). Leave all the rest to azx_remove().
 - Add a second patch to remove unused code left after commit fbaccb1b19c7

 sound/hda/controllers/intel.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/sound/hda/controllers/intel.c b/sound/hda/controllers/intel.c
index 5a7dd69955d4..1f754f04eea8 100644
--- a/sound/hda/controllers/intel.c
+++ b/sound/hda/controllers/intel.c
@@ -2452,6 +2452,9 @@ static int azx_probe_continue(struct azx *chip, bool free_on_error)
 	}
 
 out_free:
+	if (!hda->need_i915_power)
+		display_power(chip, false);
+
 	if (err < 0) {
 		if (hda->vga_switcheroo_registered)
 			dev_warn(&pci->dev, "GPU sound probed, but not operational: please add a quirk to driver_denylist\n");
@@ -2462,8 +2465,6 @@ static int azx_probe_continue(struct azx *chip, bool free_on_error)
 		return err;
 	}
 
-	if (!hda->need_i915_power)
-		display_power(chip, false);
 	complete_all(&hda->probe_wait);
 	to_hda_bus(bus)->bus_probing = 0;
 	hda->probe_retry = 0;

base-commit: 1afd6b7547b2ff0824e91fdf269bbd089f767a5d
-- 
2.43.0


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

end of thread, other threads:[~2026-11-22  8:24 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-11-20 15:09 [PATCH v2 1/2] ALSA: hda: intel: Release i915 power also when delayed probe fails Kai Vehmanen
2026-11-20 15:09 ` [PATCH v2 2/2] ALSA: hda: intel: Remove unused free_on_error from azx_probe_continue() Kai Vehmanen
2026-11-22  8:24 ` [PATCH v2 1/2] ALSA: hda: intel: Release i915 power also when delayed probe fails Takashi Iwai

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