1
0
Fork 0

ASoC: Intel: Allow for ROM init retry on CNL platforms

commit 024aa45f55 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: cb6a552846 ("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>
5.4-rM2-2.2.x-imx-squashed
Cezary Rojewski 2020-11-29 12:41:45 +01:00 committed by Greg Kroah-Hartman
parent 4029a29f93
commit a28144d62d
3 changed files with 11 additions and 7 deletions

View File

@ -38,8 +38,6 @@
/* Delay before scheduling D0i3 entry */
#define BXT_D0I3_DELAY 5000
#define BXT_FW_ROM_INIT_RETRY 3
static unsigned int bxt_get_errorcode(struct sst_dsp *ctx)
{
return sst_dsp_shim_read(ctx, BXT_ADSP_ERROR_CODE);

View File

@ -109,7 +109,7 @@ static int cnl_load_base_firmware(struct sst_dsp *ctx)
{
struct firmware stripped_fw;
struct skl_dev *cnl = ctx->thread_context;
int ret;
int ret, i;
if (!ctx->fw) {
ret = request_firmware(&ctx->fw, ctx->fw_name, ctx->dev);
@ -131,12 +131,16 @@ static int cnl_load_base_firmware(struct sst_dsp *ctx)
stripped_fw.size = ctx->fw->size;
skl_dsp_strip_extended_manifest(&stripped_fw);
ret = cnl_prepare_fw(ctx, stripped_fw.data, stripped_fw.size);
if (ret < 0) {
dev_err(ctx->dev, "prepare firmware failed: %d\n", ret);
goto cnl_load_base_firmware_failed;
for (i = 0; i < BXT_FW_ROM_INIT_RETRY; i++) {
ret = cnl_prepare_fw(ctx, stripped_fw.data, stripped_fw.size);
if (!ret)
break;
dev_dbg(ctx->dev, "prepare firmware failed: %d\n", ret);
}
if (ret < 0)
goto cnl_load_base_firmware_failed;
ret = sst_transfer_fw_host_dma(ctx);
if (ret < 0) {
dev_err(ctx->dev, "transfer firmware failed: %d\n", ret);
@ -158,6 +162,7 @@ static int cnl_load_base_firmware(struct sst_dsp *ctx)
return 0;
cnl_load_base_firmware_failed:
dev_err(ctx->dev, "firmware load failed: %d\n", ret);
release_firmware(ctx->fw);
ctx->fw = NULL;

View File

@ -67,6 +67,7 @@ struct skl_dev;
#define SKL_FW_INIT 0x1
#define SKL_FW_RFW_START 0xf
#define BXT_FW_ROM_INIT_RETRY 3
#define SKL_ADSPIC_IPC 1
#define SKL_ADSPIS_IPC 1