Skip to contentSkip to conversation

ASoC: Intel: Skylake: Recover BXT FW on DSP boot timeout error

PATCH Superseded Pawel Harlozinski 2 participants 3 messages Jun 26, 2019 – Jul 8, 2019

Subsystems (3)

v1 of 3 Superseded Latest is v3 →

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 ASoC: Intel: Skylake: Recover BXT FW on DSP boot timeout error

When DSP boots with timeout error, reinitialize, transfer and boot firmware to recover audio.

---
 sound/soc/intel/skylake/bxt-sst.c | 15 ++++++++++-----
 1 file changed, 10 insertions(+), 5 deletions(-)
sound/soc/intel/skylake/bxt-sst.c +10 -5
index 440bca7afbf1..a2844bdca1b8 100644
@@ -455,13 +455,18 @@ static int bxt_set_dsp_D0(struct sst_dsp *ctx, unsigned int core_id)
 	/* If core 1 was turned on for booting core 0, turn it off */
 		skl_dsp_core_power_down(ctx, SKL_DSP_CORE_MASK(1));
 		if (ret == 0) {
-			dev_err(ctx->dev, "%s: DSP boot timeout\n", __func__);
-			dev_err(ctx->dev, "Error code=0x%x: FW status=0x%x\n",
+			dev_warn(ctx->dev,
+				"DSP boot timeout: Error code=0x%x: FW status=0x%x\n",
 				sst_dsp_shim_read(ctx, BXT_ADSP_ERROR_CODE),
 				sst_dsp_shim_read(ctx, BXT_ADSP_FW_STATUS));
-			dev_err(ctx->dev, "Failed to set core0 to D0 state\n");
-			ret = -EIO;
-			goto err;
+
+			ret = bxt_sst_init_fw(skl->dev, skl);
+			dev_warn(ctx->dev, "Reload fw status: %d\n", ret);
+			if (ret < 0) {
+				dev_err(ctx->dev, "Failed to set core0 to D0 state\n");
+				ret = -EIO;
+				goto err;
+			}
 		}
 	}
 
Signature · 1 line
2.17.1
maintainer
#1 lore raw
Quoted 3 lines · Pawel Harlozinski

When DSP boots with timeout error, reinitialize, transfer and boot firmware to recover audio.

This is so called "recovery". Say "why" we do it, not just "what" the sequence is.

sound/soc/intel/skylake/bxt-sst.c static int bxt_set_dsp_D0(struct sst_dsp *ctx, unsigned int core_id)

Quoted 10 lines
---
  sound/soc/intel/skylake/bxt-sst.c | 15 ++++++++++-----
  1 file changed, 10 insertions(+), 5 deletions(-)
sound/soc/intel/skylake/bxt-sst.c +0 -0
index 440bca7afbf1..a2844bdca1b8 100644
@@ -455,13 +455,18 @@ static int bxt_set_dsp_D0(struct sst_dsp *ctx, unsigned int core_id)

What about its neighbour, cnl_set_dsp_D0?

sound/soc/intel/skylake/bxt-sst.c static int bxt_set_dsp_D0(struct sst_dsp *ctx, unsigned int core_id) · line 459

Quoted 7 lines
sound/soc/intel/skylake/bxt-sst.c +2 -2
  	/* If core 1 was turned on for booting core 0, turn it off */
  		skl_dsp_core_power_down(ctx, SKL_DSP_CORE_MASK(1));
  		if (ret == 0) {
-			dev_err(ctx->dev, "%s: DSP boot timeout\n", __func__);
-			dev_err(ctx->dev, "Error code=0x%x: FW status=0x%x\n",
+			dev_warn(ctx->dev,
+				"DSP boot timeout: Error code=0x%x: FW status=0x%x\n",

Log change (--log_level) without mention in commit msg. Maybe split this into separate commit? The entire log-polish thingy could be a theme for a patchset as this is not the only place where such changes are welcome.

sound/soc/intel/skylake/bxt-sst.c static int bxt_set_dsp_D0(struct sst_dsp *ctx, unsigned int core_id) · line 469

Quoted 13 lines
sound/soc/intel/skylake/bxt-sst.c +8 -3
  				sst_dsp_shim_read(ctx, BXT_ADSP_ERROR_CODE),
  				sst_dsp_shim_read(ctx, BXT_ADSP_FW_STATUS));
-			dev_err(ctx->dev, "Failed to set core0 to D0 state\n");
-			ret = -EIO;
-			goto err;
+
+			ret = bxt_sst_init_fw(skl->dev, skl);
+			dev_warn(ctx->dev, "Reload fw status: %d\n", ret);
+			if (ret < 0) {
+				dev_err(ctx->dev, "Failed to set core0 to D0 state\n");
+				ret = -EIO;
+				goto err;
+			}

Double message is unnecessary, routine is verbose enough. Either leave "always report stuff" and resign from mentioning anything at all on failure -or- do it only on failure explicitly.

Quoted 4 lines
sound/soc/intel/skylake/bxt-sst.c +0 -0
  		}
  	}
 
#2 lore raw
Quoted 4 lines · Cezary Rojewski
Quoted 3 lines · Pawel Harlozinski

When DSP boots with timeout error, reinitialize, transfer and boot firmware to recover audio.

done in PATCH v2

Quoted 7 lines

This is so called "recovery". Say "why" we do it, not just "what" the sequence is.

Quoted 5 lines

---
  sound/soc/intel/skylake/bxt-sst.c | 15 ++++++++++-----

  1 file changed, 10 insertions(+), 5 deletions(-)
Quoted 8 lines

sound/soc/intel/skylake/bxt-sst.c static int bxt_set_dsp_D0(struct sst_dsp *ctx, · line 455

Quoted 6 lines
sound/soc/intel/skylake/bxt-sst.c +0 -0
index 440bca7afbf1..a2844bdca1b8 100644
@@ -455,13 +455,18 @@ static int bxt_set_dsp_D0(struct sst_dsp *ctx, 
 unsigned int core_id)

What about its neighbour, cnl_set_dsp_D0?

In current implementation CNL handles FW init quite different way,
So implementation of FW recovery for CNL have to wait at least for patch unifying firmware loading mechanism. That is already prepared - just waiting  in queue with other cleanup patches to be send.

Quoted 10 lines

sound/soc/intel/skylake/bxt-sst.c static int bxt_set_dsp_D0(struct sst_dsp *ctx, unsigned int core_id) · line 459

Quoted 8 lines
sound/soc/intel/skylake/bxt-sst.c +2 -2
       /* If core 1 was turned on for booting core 0, turn it off */
           skl_dsp_core_power_down(ctx, SKL_DSP_CORE_MASK(1));
           if (ret == 0) {
-            dev_err(ctx->dev, "%s: DSP boot timeout\n", __func__);
-            dev_err(ctx->dev, "Error code=0x%x: FW status=0x%x\n",
+            dev_warn(ctx->dev,
+                "DSP boot timeout: Error code=0x%x: FW status=0x%x\n",

Log change (--log_level) without mention in commit msg. Maybe split this into separate commit? The entire log-polish thingy could be a theme for a patchset as this is not the only place where such changes are welcome.

This log_level change should be part of this commit, because of added recovery after boot timeout. Only recovery fail should be logged on err level.

Quoted 15 lines
Quoted 4 lines
sound/soc/intel/skylake/bxt-sst.c +0 -1
                   sst_dsp_shim_read(ctx, BXT_ADSP_ERROR_CODE),
                   sst_dsp_shim_read(ctx, BXT_ADSP_FW_STATUS));
-            dev_err(ctx->dev, "Failed to set core0 to D0 state\n");

sound/soc/intel/skylake/bxt-sst.c static int bxt_set_dsp_D0(struct sst_dsp *ctx, unsigned int core_id) · line 469

Quoted 10 lines
sound/soc/intel/skylake/bxt-sst.c +8 -2
-            ret = -EIO;
-            goto err;
+
+            ret = bxt_sst_init_fw(skl->dev, skl);
+            dev_warn(ctx->dev, "Reload fw status: %d\n", ret);
+            if (ret < 0) {
+                dev_err(ctx->dev, "Failed to set core0 to D0 state\n");
+                ret = -EIO;
+                goto err;
+            }
Quoted 2 lines

Double message is unnecessary, routine is verbose enough. Either leave "always report stuff" and resign from mentioning anything at all on failure -or- do it only on failure explicitly.

done in PATCH v2

Quoted 7 lines

sound/soc/intel/skylake/bxt-sst.c static int bxt_set_dsp_D0(struct sst_dsp *ctx, · line 472

Quoted 3 lines
sound/soc/intel/skylake/bxt-sst.c +0 -0
           }
       }

_______________________________________________
Alsa-devel mailing list
[email protected]
https://mailman.alsa-project.org/mailman/listinfo/alsa-devel

_______________________________________________
Alsa-devel mailing list
[email protected]
https://mailman.alsa-project.org/mailman/listinfo/alsa-devel