summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRichard Fitzgerald <rf@opensource.cirrus.com>2023-07-31 18:57:23 +0200
committerTakashi Iwai <tiwai@suse.de>2023-08-01 08:30:07 +0200
commit0ba0dfd969926563016e706346a9caba7f5a15ac (patch)
tree444a74cfb27ff62d7315ed840b43b9b52662d4ff
parentALSA: hda/cs35l56: Call cs_dsp_power_down() before calling cs_dsp_remove() (diff)
downloadlinux-0ba0dfd969926563016e706346a9caba7f5a15ac.tar.xz
linux-0ba0dfd969926563016e706346a9caba7f5a15ac.zip
ALSA: hda/cs35l56: cs_dsp_power_down() on cs35l56_hda_fw_load() error path
If cs35l56_hda_fw_load() successfully called cs_dsp_power_up() the error path must balance that with a call to cs_dsp_power_down(). Signed-off-by: Richard Fitzgerald <rf@opensource.cirrus.com> Link: https://lore.kernel.org/r/20230731165726.7940-7-rf@opensource.cirrus.com Signed-off-by: Takashi Iwai <tiwai@suse.de>
-rw-r--r--sound/pci/hda/cs35l56_hda.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/sound/pci/hda/cs35l56_hda.c b/sound/pci/hda/cs35l56_hda.c
index e8c41a4a0c40..803fa2da9ea4 100644
--- a/sound/pci/hda/cs35l56_hda.c
+++ b/sound/pci/hda/cs35l56_hda.c
@@ -567,20 +567,20 @@ static int cs35l56_hda_fw_load(struct cs35l56_hda *cs35l56)
if (cs35l56->base.secured) {
ret = cs35l56_mbox_send(&cs35l56->base, CS35L56_MBOX_CMD_AUDIO_REINIT);
if (ret)
- goto err;
+ goto err_powered_up;
} else if (wmfw_firmware || coeff_firmware) {
/* If we downloaded firmware, reset the device and wait for it to boot */
cs35l56_system_reset(&cs35l56->base, false);
regcache_mark_dirty(cs35l56->base.regmap);
ret = cs35l56_wait_for_firmware_boot(&cs35l56->base);
if (ret)
- goto err;
+ goto err_powered_up;
}
/* Disable auto-hibernate so that runtime_pm has control */
ret = cs35l56_mbox_send(&cs35l56->base, CS35L56_MBOX_CMD_PREVENT_AUTO_HIBERNATE);
if (ret)
- goto err;
+ goto err_powered_up;
regcache_sync(cs35l56->base.regmap);
@@ -592,6 +592,9 @@ static int cs35l56_hda_fw_load(struct cs35l56_hda *cs35l56)
if (ret)
dev_dbg(cs35l56->base.dev, "%s: cs_dsp_run ret %d\n", __func__, ret);
+err_powered_up:
+ if (!cs35l56->base.fw_patched)
+ cs_dsp_power_down(&cs35l56->cs_dsp);
err:
pm_runtime_put(cs35l56->base.dev);
mutex_unlock(&cs35l56->base.irq_lock);