From b8e54b447cdec234f0e0d80487af9540063d17dd Mon Sep 17 00:00:00 2001 From: Peter Ujfalusi Date: Mon, 15 Dec 2025 15:29:39 +0200 Subject: [PATCH] ASoC: SOF: ipc4-loader: Remove redundant rpm resume_and_get from load_library The initial library loading is happening during topology loading, which is already protected with pm_runtime_resume_and_get() via pcm.c The redundant rpm code can be dropped from sof_ipc4_load_library() Signed-off-by: Peter Ujfalusi Reviewed-by: Bard Liao Reviewed-by: Kai Vehmanen Reviewed-by: Liam Girdwood Link: https://patch.msgid.link/20251215132946.2155-2-peter.ujfalusi@linux.intel.com Signed-off-by: Mark Brown --- sound/soc/sof/ipc4-loader.c | 19 +------------------ 1 file changed, 1 insertion(+), 18 deletions(-) diff --git a/sound/soc/sof/ipc4-loader.c b/sound/soc/sof/ipc4-loader.c index b0d293f62d1cf..07a78cb3c25c3 100644 --- a/sound/soc/sof/ipc4-loader.c +++ b/sound/soc/sof/ipc4-loader.c @@ -175,7 +175,7 @@ static int sof_ipc4_load_library(struct snd_sof_dev *sdev, unsigned long lib_id, struct sof_ipc4_fw_data *ipc4_data = sdev->private; struct sof_ipc4_fw_library *fw_lib; ssize_t payload_offset; - int ret, i, err; + int ret, i; if (!ipc4_data->load_library) { dev_err(sdev->dev, "Library loading is not supported on this platform\n"); @@ -223,24 +223,7 @@ static int sof_ipc4_load_library(struct snd_sof_dev *sdev, unsigned long lib_id, for (i = 0; i < fw_lib->num_modules; i++) fw_lib->modules[i].man4_module_entry.id |= (lib_id << SOF_IPC4_MOD_LIB_ID_SHIFT); - /* - * Make sure that the DSP is booted and stays up while attempting the - * loading the library for the first time - */ - ret = pm_runtime_resume_and_get(sdev->dev); - if (ret < 0 && ret != -EACCES) { - dev_err_ratelimited(sdev->dev, "%s: pm_runtime resume failed: %d\n", - __func__, ret); - goto release; - } - ret = ipc4_data->load_library(sdev, fw_lib, false); - - err = pm_runtime_put_autosuspend(sdev->dev); - if (err < 0) - dev_err_ratelimited(sdev->dev, "%s: pm_runtime idle failed: %d\n", - __func__, err); - if (ret) goto release; -- 2.47.3