linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] ALSA: hda: Enable runtime PM when codec probe fails
@ 2020-12-14  6:06 Kai-Heng Feng
  2020-12-14  7:58 ` Takashi Iwai
  2020-12-16 12:47 ` [PATCH v2] ALSA: hda: Continue to probe " Kai-Heng Feng
  0 siblings, 2 replies; 32+ messages in thread
From: Kai-Heng Feng @ 2020-12-14  6:06 UTC (permalink / raw)
  To: tiwai
  Cc: Kai-Heng Feng, Jaroslav Kysela, Kai Vehmanen,
	Pierre-Louis Bossart, Guennadi Liakhovetski, Alex Deucher,
	Mike Rapoport, moderated list:SOUND, open list

When codec probe fails, it doesn't enable runtime suspend, and can
prevent graphics card from getting powered down:
[    4.280991] snd_hda_intel 0000:01:00.1: no codecs initialized

$ cat /sys/bus/pci/devices/0000:01:00.1/power/runtime_status
active

So enable runtime PM when codec probe fails, to let graphics card be
able to runtime suspend again.

Merge azx_probe_continue() into azx_probe() and just let probe fail for
this case could be a better approach. However that's a much bigger task
so let's settle with a quirk workaround.

BugLink: https://bugs.launchpad.net/bugs/1907212
Signed-off-by: Kai-Heng Feng <kai.heng.feng@canonical.com>
---
 sound/pci/hda/hda_intel.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/sound/pci/hda/hda_intel.c b/sound/pci/hda/hda_intel.c
index 6852668f1bcb..3fd920069268 100644
--- a/sound/pci/hda/hda_intel.c
+++ b/sound/pci/hda/hda_intel.c
@@ -2328,7 +2328,7 @@ static int azx_probe_continue(struct azx *chip)
 	if (bus->codec_mask) {
 		err = azx_probe_codecs(chip, azx_max_codecs[chip->driver_type]);
 		if (err < 0)
-			goto out_free;
+			goto out_enable_rpm;
 	}
 
 #ifdef CONFIG_SND_HDA_PATCH_LOADER
@@ -2360,6 +2360,7 @@ static int azx_probe_continue(struct azx *chip)
 
 	set_default_power_save(chip);
 
+out_enable_rpm:
 	if (azx_has_pm_runtime(chip)) {
 		pm_runtime_use_autosuspend(&pci->dev);
 		pm_runtime_allow(&pci->dev);
-- 
2.29.2


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

end of thread, other threads:[~2021-07-02 18:26 UTC | newest]

Thread overview: 32+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-12-14  6:06 [PATCH] ALSA: hda: Enable runtime PM when codec probe fails Kai-Heng Feng
2020-12-14  7:58 ` Takashi Iwai
2020-12-16 12:47 ` [PATCH v2] ALSA: hda: Continue to probe " Kai-Heng Feng
2020-12-16 15:41   ` Takashi Iwai
2020-12-16 15:50     ` Kai-Heng Feng
2020-12-16 15:58       ` Takashi Iwai
2020-12-16 16:07         ` Kai-Heng Feng
2020-12-16 16:22           ` Takashi Iwai
2020-12-16 16:57             ` Takashi Iwai
2020-12-18  5:09               ` Kai-Heng Feng
2020-12-18  8:06                 ` Takashi Iwai
2020-12-21 16:33                   ` Kai-Heng Feng
2020-12-21 16:47                     ` Takashi Iwai
2020-12-21 17:15                       ` Kai-Heng Feng
2020-12-21 17:56                     ` [Nouveau] " Ilia Mirkin
2020-12-22  2:49                       ` Kai-Heng Feng
2021-01-04 13:20                         ` Karol Herbst
2021-04-10 15:51                           ` Roy Spliet
2021-04-10 19:23                             ` Lukas Wunner
2021-04-10 20:48                               ` Roy Spliet
2021-04-12 19:06                                 ` Aaron Plattner
2021-04-12 19:36                                   ` Roy Spliet
2021-04-12 20:00                                     ` Aaron Plattner
2021-04-12 20:03                                       ` Ilia Mirkin
2021-04-13  0:10                                     ` Karol Herbst
2021-04-13  8:24                                       ` Roy Spliet
2021-04-13  9:48                                         ` Karol Herbst
2021-04-13 11:17                                           ` Roy Spliet
2021-04-13 11:49                                             ` Karol Herbst
2021-06-25 12:45   ` Paul Cercueil
2021-07-02 17:59     ` Paul Cercueil
2021-07-02 18:26       ` Paul Cercueil

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).