Skip to contentSkip to conversation

ALSA: hda: Fix codec device field initializan

PATCH In review Cezary Rojewski 2 participants 3 messages Feb 10, 2023 – Feb 13, 2023 Sound

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 ALSA: hda: Fix codec device field initializan

Commit f2bd1c5ae2cb ("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.

---

A result of recent discussion [1] regarding sound regression in v6.1 and onward. Fix made possible by outstanding input from Jason and Sasa (Cced) - Thank you!

Note: I did not receive results from our CI yet, should happen on Monday but posting early so the review can be conducted.

[1]: https://lore.kernel.org/regressions/CALFERdzKUodLsm6=Ub3g2+PxpNpPtPq3bGBLbff=eZr9_S=YVA@mail.gmail.com/

 sound/pci/hda/hda_codec.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
sound/pci/hda/hda_codec.c +1 -1
index ac1cc7c5290e..2e728aad6771 100644
@@ -927,7 +927,6 @@ snd_hda_codec_device_init(struct hda_bus *bus, unsigned int codec_addr,
 	codec->depop_delay = -1;
 	codec->fixup_id = HDA_FIXUP_ID_NOT_SET;
 	codec->core.dev.release = snd_hda_codec_dev_release;
-	codec->core.exec_verb = codec_exec_verb;
 	codec->core.type = HDA_DEV_LEGACY;
 
 	mutex_init(&codec->spdif_mutex);
@@ -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))
 		return -EINVAL;
 
+	codec->core.exec_verb = codec_exec_verb;
 	codec->card = card;
 	codec->addr = codec_addr;
 
Signature · 1 line
2.25.1
#1 lore raw
Quoted 20 lines · Cezary Rojewski

Commit f2bd1c5ae2cb ("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.

---

Quoted 8 lines

A result of recent discussion [1] regarding sound regression in v6.1 and onward. Fix made possible by outstanding input from Jason and Sasa (Cced) - Thank you!

Note: I did not receive results from our CI yet, should happen on Monday but posting early so the review can be conducted.

[1]: https://lore.kernel.org/regressions/CALFERdzKUodLsm6=Ub3g2+PxpNpPtPq3bGBLbff=eZr9_S=YVA@mail.gmail.com/

Applied now. Thanks.

Takashi

author Tested-by on v1 1/1
#2 lore raw
In reply to Cezary Rojewski

On 2023-02-10 5:55 PM, Cezary Rojewski wrote:

...

Quoted 6 lines

A result of recent discussion [1] regarding sound regression in v6.1 and onward. Fix made possible by outstanding input from Jason and Sasa (Cced) - Thank you!

Note: I did not receive results from our CI yet, should happen on Monday but posting early so the review can be conducted.

Current results show no regression on SKL/KBL/APL RVPs with the skylake-driver.

Quoted 1 line

[1]: https://lore.kernel.org/regressions/CALFERdzKUodLsm6=Ub3g2+PxpNpPtPq3bGBLbff=eZr9_S=YVA@mail.gmail.com/