Skip to content

Commit a28144d

Browse files
crojewsk-intelgregkh
authored andcommitted
ASoC: Intel: Allow for ROM init retry on CNL platforms
commit 024aa45 upstream. Due to unconditional initial timeouts, firmware may fail to load during its initialization. This issue cannot be resolved on driver side as it is caused by external sources such as CSME but has to be accounted for nonetheless. Fixes: cb6a552 ("ASoC: Intel: cnl: Add sst library functions for cnl platform") Signed-off-by: Cezary Rojewski <cezary.rojewski@intel.com> Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com> Link: https://lore.kernel.org/r/20200305145314.32579-7-cezary.rojewski@intel.com Signed-off-by: Mark Brown <broonie@kernel.org> Cc: <stable@vger.kernel.org> # 5.4.x Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
1 parent 4029a29 commit a28144d

3 files changed

Lines changed: 11 additions & 7 deletions

File tree

sound/soc/intel/skylake/bxt-sst.c

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,8 +38,6 @@
3838
/* Delay before scheduling D0i3 entry */
3939
#define BXT_D0I3_DELAY 5000
4040

41-
#define BXT_FW_ROM_INIT_RETRY 3
42-
4341
static unsigned int bxt_get_errorcode(struct sst_dsp *ctx)
4442
{
4543
return sst_dsp_shim_read(ctx, BXT_ADSP_ERROR_CODE);

sound/soc/intel/skylake/cnl-sst.c

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,7 @@ static int cnl_load_base_firmware(struct sst_dsp *ctx)
109109
{
110110
struct firmware stripped_fw;
111111
struct skl_dev *cnl = ctx->thread_context;
112-
int ret;
112+
int ret, i;
113113

114114
if (!ctx->fw) {
115115
ret = request_firmware(&ctx->fw, ctx->fw_name, ctx->dev);
@@ -131,12 +131,16 @@ static int cnl_load_base_firmware(struct sst_dsp *ctx)
131131
stripped_fw.size = ctx->fw->size;
132132
skl_dsp_strip_extended_manifest(&stripped_fw);
133133

134-
ret = cnl_prepare_fw(ctx, stripped_fw.data, stripped_fw.size);
135-
if (ret < 0) {
136-
dev_err(ctx->dev, "prepare firmware failed: %d\n", ret);
137-
goto cnl_load_base_firmware_failed;
134+
for (i = 0; i < BXT_FW_ROM_INIT_RETRY; i++) {
135+
ret = cnl_prepare_fw(ctx, stripped_fw.data, stripped_fw.size);
136+
if (!ret)
137+
break;
138+
dev_dbg(ctx->dev, "prepare firmware failed: %d\n", ret);
138139
}
139140

141+
if (ret < 0)
142+
goto cnl_load_base_firmware_failed;
143+
140144
ret = sst_transfer_fw_host_dma(ctx);
141145
if (ret < 0) {
142146
dev_err(ctx->dev, "transfer firmware failed: %d\n", ret);
@@ -158,6 +162,7 @@ static int cnl_load_base_firmware(struct sst_dsp *ctx)
158162
return 0;
159163

160164
cnl_load_base_firmware_failed:
165+
dev_err(ctx->dev, "firmware load failed: %d\n", ret);
161166
release_firmware(ctx->fw);
162167
ctx->fw = NULL;
163168

sound/soc/intel/skylake/skl-sst-dsp.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,7 @@ struct skl_dev;
6767

6868
#define SKL_FW_INIT 0x1
6969
#define SKL_FW_RFW_START 0xf
70+
#define BXT_FW_ROM_INIT_RETRY 3
7071

7172
#define SKL_ADSPIC_IPC 1
7273
#define SKL_ADSPIS_IPC 1

0 commit comments

Comments
 (0)