From: Peter Ujfalusi <peter.ujfalusi@linux.intel.com>
To: lgirdwood@gmail.com, broonie@kernel.org
Cc: alsa-devel@alsa-project.org, kai.vehmanen@linux.intel.com,
cezary.rojewski@intel.com, pierre-louis.bossart@linux.intel.com,
ranjani.sridharan@linux.intel.com,
amadeuszx.slawinski@linux.intel.com, chao.song@intel.com
Subject: [PATCH v2 14/19] ASoC: SOF: Intel: hda: Add flag to indicate that the firmware is IMR booted
Date: Thu, 20 Oct 2022 15:12:33 +0300 [thread overview]
Message-ID: <20221020121238.18339-15-peter.ujfalusi@linux.intel.com> (raw)
In-Reply-To: <20221020121238.18339-1-peter.ujfalusi@linux.intel.com>
Dynamic loading of external libraries should not be done if the firmware
was booted from IMR since in that case the libraries will be restored along
with the basefw.
The booted_from_imr flag is introduced and set to true if the IMR boot was
successful and to false if cold booting is executed.
The reason for the new flag is that guessing from existing flags, used to
decide if we should try booting from IMR or not is not going to be robust
as the IMR boot itself can fail and in that case a full, cold boot is
executed.
Signed-off-by: Peter Ujfalusi <peter.ujfalusi@linux.intel.com>
Reviewed-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Reviewed-by: Chao Song <chao.song@intel.com>
Reviewed-by: Kai Vehmanen <kai.vehmanen@linux.intel.com>
---
sound/soc/sof/intel/hda-loader.c | 6 +++++-
sound/soc/sof/intel/hda.h | 1 +
2 files changed, 6 insertions(+), 1 deletion(-)
diff --git a/sound/soc/sof/intel/hda-loader.c b/sound/soc/sof/intel/hda-loader.c
index 147ddc5ee932..5ed524e166d2 100644
--- a/sound/soc/sof/intel/hda-loader.c
+++ b/sound/soc/sof/intel/hda-loader.c
@@ -396,12 +396,16 @@ int hda_dsp_cl_boot_firmware(struct snd_sof_dev *sdev)
dev_dbg(sdev->dev, "IMR restore supported, booting from IMR directly\n");
hda->boot_iteration = 0;
ret = hda_dsp_boot_imr(sdev);
- if (!ret)
+ if (!ret) {
+ hda->booted_from_imr = true;
return 0;
+ }
dev_warn(sdev->dev, "IMR restore failed, trying to cold boot\n");
}
+ hda->booted_from_imr = false;
+
chip_info = desc->chip_info;
if (sdev->basefw.fw->size <= sdev->basefw.payload_offset) {
diff --git a/sound/soc/sof/intel/hda.h b/sound/soc/sof/intel/hda.h
index 65657d145dc2..4d9eb321a046 100644
--- a/sound/soc/sof/intel/hda.h
+++ b/sound/soc/sof/intel/hda.h
@@ -481,6 +481,7 @@ enum sof_hda_D0_substate {
struct sof_intel_hda_dev {
bool imrboot_supported;
bool skip_imr_boot;
+ bool booted_from_imr;
int boot_iteration;
--
2.38.1
next prev parent reply other threads:[~2022-10-20 12:17 UTC|newest]
Thread overview: 22+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-10-20 12:12 [PATCH v2 00/19] ASoC: SOF: Intel/IPC4: Support for external firmware libraries Peter Ujfalusi
2022-10-20 12:12 ` [PATCH v2 01/19] ASoC: SOF: loader: Set complete state before post_fw_run op Peter Ujfalusi
2022-10-20 12:12 ` [PATCH v2 02/19] ASoC: SOF: Introduce container struct for SOF firmware Peter Ujfalusi
2022-10-20 12:12 ` [PATCH v2 03/19] ASoC: SOF: amd: Use the basefw firmware container directly Peter Ujfalusi
2022-10-20 12:12 ` [PATCH v2 04/19] ASoC: SOF: Intel: hda-loader: " Peter Ujfalusi
2022-10-20 12:12 ` [PATCH v2 05/19] ASoC: SOF: Intel: hda-loader-skl: " Peter Ujfalusi
2022-10-20 12:12 ` [PATCH v2 06/19] ASoC: SOF: Drop the firmware and fw_offset from snd_sof_pdata Peter Ujfalusi
2022-10-20 12:12 ` [PATCH v2 07/19] ASoC: SOF: ipc: ops: Add support for optional init and exit callbacks Peter Ujfalusi
2022-10-20 12:12 ` [PATCH v2 08/19] ASoC: SOF: ipc4-loader: Save the maximum number of libraries supported Peter Ujfalusi
2022-10-20 12:12 ` [PATCH v2 09/19] ASoC: SOF: ipc4: Convert the firmware handling (loader) to library convention Peter Ujfalusi
2022-10-20 12:12 ` [PATCH v2 10/19] ASoC: SOF: IPC4: Add helper for looking up module by UUID Peter Ujfalusi
2022-10-20 12:12 ` [PATCH v2 11/19] ASoC: SOF: Add path definition for external firmware libraries Peter Ujfalusi
2022-10-20 12:12 ` [PATCH v2 12/19] ASoC: SOF: Intel: Set the default firmware library path for IPC4 Peter Ujfalusi
2022-10-20 12:12 ` [PATCH v2 13/19] ASoC: SOF: ipc4: Define platform dependent library loading callback Peter Ujfalusi
2022-10-20 12:12 ` Peter Ujfalusi [this message]
2022-10-20 12:12 ` [PATCH v2 15/19] ASoC: SOF: Intel: Add ipc4 library loading implementation Peter Ujfalusi
2022-10-20 12:12 ` [PATCH v2 16/19] ASoC: SOF: loader: Add support for IPC dependent post firmware boot ops Peter Ujfalusi
2022-10-20 12:12 ` [PATCH v2 17/19] ASoC: SOF: ipc4: Stop using the query_fw_configuration fw_loader ops Peter Ujfalusi
2022-10-20 12:12 ` [PATCH v2 18/19] ASoC: SOF: loader: Remove the query_fw_configuration ops Peter Ujfalusi
2022-10-20 12:12 ` [PATCH v2 19/19] ASoC: SOF: ipc4-loader: Support for loading external libraries Peter Ujfalusi
2022-10-21 10:38 ` [PATCH v2 00/19] ASoC: SOF: Intel/IPC4: Support for external firmware libraries Amadeusz Sławiński
2022-10-21 19:05 ` Mark Brown
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20221020121238.18339-15-peter.ujfalusi@linux.intel.com \
--to=peter.ujfalusi@linux.intel.com \
--cc=alsa-devel@alsa-project.org \
--cc=amadeuszx.slawinski@linux.intel.com \
--cc=broonie@kernel.org \
--cc=cezary.rojewski@intel.com \
--cc=chao.song@intel.com \
--cc=kai.vehmanen@linux.intel.com \
--cc=lgirdwood@gmail.com \
--cc=pierre-louis.bossart@linux.intel.com \
--cc=ranjani.sridharan@linux.intel.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox