Commit 3af4a4f7 authored by Cezary Rojewski's avatar Cezary Rojewski Committed by Takashi Iwai

ALSA: hda: Fix codec device field initializan

Commit f2bd1c5a ("ALSA: hda: Fix page fault in
snd_hda_codec_shutdown()") relocated initialization of several codec
device fields. Due to differences between codec_exec_verb() and
snd_hdac_bus_exec_bus() in how they handle VERB execution - the latter
does not touch PM - assigning ->exec_verb to codec_exec_verb() causes PM
to be engaged before it is configured for the device. Configuration of
PM for the ASoC HDAudio sound card is done with snd_hda_set_power_save()
during skl_hda_audio_probe() whereas the assignment happens early, in
snd_hda_codec_device_init().

Revert to previous behavior to avoid problems caused by too early PM
manipulation.
Suggested-by: default avatarJason Montleon <jmontleo@redhat.com>
Link: https://lore.kernel.org/regressions/CALFERdzKUodLsm6=Ub3g2+PxpNpPtPq3bGBLbff=eZr9_S=YVA@mail.gmail.com
Fixes: f2bd1c5a ("ALSA: hda: Fix page fault in snd_hda_codec_shutdown()")
Signed-off-by: default avatarCezary Rojewski <cezary.rojewski@intel.com>
Link: https://lore.kernel.org/r/20230210165541.3543604-1-cezary.rojewski@intel.comSigned-off-by: default avatarTakashi Iwai <tiwai@suse.de>
parent 18d7e16c
...@@ -927,7 +927,6 @@ snd_hda_codec_device_init(struct hda_bus *bus, unsigned int codec_addr, ...@@ -927,7 +927,6 @@ snd_hda_codec_device_init(struct hda_bus *bus, unsigned int codec_addr,
codec->depop_delay = -1; codec->depop_delay = -1;
codec->fixup_id = HDA_FIXUP_ID_NOT_SET; codec->fixup_id = HDA_FIXUP_ID_NOT_SET;
codec->core.dev.release = snd_hda_codec_dev_release; codec->core.dev.release = snd_hda_codec_dev_release;
codec->core.exec_verb = codec_exec_verb;
codec->core.type = HDA_DEV_LEGACY; codec->core.type = HDA_DEV_LEGACY;
mutex_init(&codec->spdif_mutex); mutex_init(&codec->spdif_mutex);
...@@ -998,6 +997,7 @@ int snd_hda_codec_device_new(struct hda_bus *bus, struct snd_card *card, ...@@ -998,6 +997,7 @@ int snd_hda_codec_device_new(struct hda_bus *bus, struct snd_card *card,
if (snd_BUG_ON(codec_addr > HDA_MAX_CODEC_ADDRESS)) if (snd_BUG_ON(codec_addr > HDA_MAX_CODEC_ADDRESS))
return -EINVAL; return -EINVAL;
codec->core.exec_verb = codec_exec_verb;
codec->card = card; codec->card = card;
codec->addr = codec_addr; codec->addr = codec_addr;
......
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