Commit a0645daf authored by Harsha Priya's avatar Harsha Priya Committed by Takashi Iwai

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: default avatarHarsha Priya <harshapriya.n@intel.com>
Signed-off-by: default avatarEmmanuel Jillela <emmanuel.jillela@intel.com>
Reviewed-by: default avatarKailang Yang <kailang@realtek.com>
Signed-off-by: default avatarKai Vehmanen <kai.vehmanen@linux.intel.com>
Link: https://lore.kernel.org/r/20200930114140.3839617-2-kai.vehmanen@linux.intel.comSigned-off-by: default avatarTakashi Iwai <tiwai@suse.de>
parent f4794c60
...@@ -1000,6 +1000,9 @@ int snd_hda_codec_device_new(struct hda_bus *bus, struct snd_card *card, ...@@ -1000,6 +1000,9 @@ int snd_hda_codec_device_new(struct hda_bus *bus, struct snd_card *card,
if (err < 0) if (err < 0)
goto error; goto error;
/* PM runtime needs to be enabled later after binding codec */
pm_runtime_forbid(&codec->core.dev);
return 0; return 0;
error: error:
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment