Skip to content

Commit a0645da

Browse files
harshapriya-ntiwai
authored andcommitted
ALSA: HDA: Early Forbid of runtime PM
For certain codecs (like Realtek), pm_runtime_forbid() is invoked in the probe function after build_controls(). In a stress test, its observed occasionally that runtime PM calls are invoked before controls are built. This causes the codec to be runtime suspended before probe completes. Because of this, not all controls are enumerated correctly, and audio does not work until system is rebooted. This issue being common across all codecs, pm_runtime_forbid() is called when the codec object is created to fix this issue. A codec enables or disables runtime pm in its own probe function. Multiple stress tests of 2000+ cycles has been done to test the fix. Signed-off-by: Harsha Priya <[email protected]> Signed-off-by: Emmanuel Jillela <[email protected]> Reviewed-by: Kailang Yang <[email protected]> Signed-off-by: Kai Vehmanen <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Takashi Iwai <[email protected]>
1 parent f4794c6 commit a0645da

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

sound/pci/hda/hda_codec.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1000,6 +1000,9 @@ int snd_hda_codec_device_new(struct hda_bus *bus, struct snd_card *card,
10001000
if (err < 0)
10011001
goto error;
10021002

1003+
/* PM runtime needs to be enabled later after binding codec */
1004+
pm_runtime_forbid(&codec->core.dev);
1005+
10031006
return 0;
10041007

10051008
error:

0 commit comments

Comments
 (0)