Skip to content

Commit 9479e75

Browse files
committed
ALSA: hda: Keep the controller initialization even if no codecs found
Currently, when the HD-audio controller driver doesn't detect any codecs, it tries to abort the probe. But this abort happens at the delayed probe, i.e. the primary probe call already returned success, hence the driver is never unbound until user does so explicitly. As a result, it may leave the HD-audio device in the running state without the runtime PM. More badly, if the device is a HD-audio bus that is tied with a GPU, GPU cannot reach to the full power down and consumes unnecessarily much power. This patch changes the logic after no-codec situation; it continues probing without the further codec initialization but keep the controller driver running normally. BugLink: https://bugzilla.kernel.org/show_bug.cgi?id=207043 Tested-by: Roy Spliet <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Takashi Iwai <[email protected]>
1 parent 2393e75 commit 9479e75

File tree

1 file changed

+7
-5
lines changed

1 file changed

+7
-5
lines changed

sound/pci/hda/hda_intel.c

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2009,7 +2009,7 @@ static int azx_first_init(struct azx *chip)
20092009
/* codec detection */
20102010
if (!azx_bus(chip)->codec_mask) {
20112011
dev_err(card->dev, "no codecs found!\n");
2012-
return -ENODEV;
2012+
/* keep running the rest for the runtime PM */
20132013
}
20142014

20152015
if (azx_acquire_irq(chip, 0) < 0)
@@ -2303,9 +2303,11 @@ static int azx_probe_continue(struct azx *chip)
23032303
#endif
23042304

23052305
/* create codec instances */
2306-
err = azx_probe_codecs(chip, azx_max_codecs[chip->driver_type]);
2307-
if (err < 0)
2308-
goto out_free;
2306+
if (bus->codec_mask) {
2307+
err = azx_probe_codecs(chip, azx_max_codecs[chip->driver_type]);
2308+
if (err < 0)
2309+
goto out_free;
2310+
}
23092311

23102312
#ifdef CONFIG_SND_HDA_PATCH_LOADER
23112313
if (chip->fw) {
@@ -2319,7 +2321,7 @@ static int azx_probe_continue(struct azx *chip)
23192321
#endif
23202322
}
23212323
#endif
2322-
if ((probe_only[dev] & 1) == 0) {
2324+
if (bus->codec_mask && !(probe_only[dev] & 1)) {
23232325
err = azx_codec_configure(chip);
23242326
if (err < 0)
23252327
goto out_free;

0 commit comments

Comments
 (0)