Skip to content

Commit d6e3f15

Browse files
committed
ASoC: SOF: Intel: hda: reduce verbosity of boot error logs
Previous commits reduced the verbosity of errors during boot iterations, but there are still a couple remaining. Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
1 parent 0f9b8fc commit d6e3f15

File tree

3 files changed

+24
-10
lines changed

3 files changed

+24
-10
lines changed

sound/soc/sof/intel/hda-loader.c

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ static struct hdac_ext_stream *cl_stream_prepare(struct snd_sof_dev *sdev, unsig
8282
* status on core 1, so power up core 1 also momentarily, keep it in
8383
* reset/stall and then turn it off
8484
*/
85-
static int cl_dsp_init(struct snd_sof_dev *sdev, int stream_tag, int iteration)
85+
static int cl_dsp_init(struct snd_sof_dev *sdev, int stream_tag)
8686
{
8787
struct sof_intel_hda_dev *hda = sdev->pdata->hw_pdata;
8888
const struct sof_intel_dsp_desc *chip = hda->desc;
@@ -93,7 +93,7 @@ static int cl_dsp_init(struct snd_sof_dev *sdev, int stream_tag, int iteration)
9393
/* step 1: power up corex */
9494
ret = hda_dsp_core_power_up(sdev, chip->host_managed_cores_mask);
9595
if (ret < 0) {
96-
if (iteration == HDA_FW_BOOT_ATTEMPTS)
96+
if (hda->boot_iteration == HDA_FW_BOOT_ATTEMPTS)
9797
dev_err(sdev->dev, "error: dsp core 0/1 power up failed\n");
9898
goto err;
9999
}
@@ -116,7 +116,7 @@ static int cl_dsp_init(struct snd_sof_dev *sdev, int stream_tag, int iteration)
116116
/* step 3: unset core 0 reset state & unstall/run core 0 */
117117
ret = hda_dsp_core_run(sdev, BIT(0));
118118
if (ret < 0) {
119-
if (iteration == HDA_FW_BOOT_ATTEMPTS)
119+
if (hda->boot_iteration == HDA_FW_BOOT_ATTEMPTS)
120120
dev_err(sdev->dev,
121121
"error: dsp core start failed %d\n", ret);
122122
ret = -EIO;
@@ -132,7 +132,7 @@ static int cl_dsp_init(struct snd_sof_dev *sdev, int stream_tag, int iteration)
132132
HDA_DSP_INIT_TIMEOUT_US);
133133

134134
if (ret < 0) {
135-
if (iteration == HDA_FW_BOOT_ATTEMPTS)
135+
if (hda->boot_iteration == HDA_FW_BOOT_ATTEMPTS)
136136
dev_err(sdev->dev,
137137
"error: %s: timeout for HIPCIE done\n",
138138
__func__);
@@ -148,7 +148,7 @@ static int cl_dsp_init(struct snd_sof_dev *sdev, int stream_tag, int iteration)
148148
/* step 5: power down corex */
149149
ret = hda_dsp_core_power_down(sdev, chip->host_managed_cores_mask & ~(BIT(0)));
150150
if (ret < 0) {
151-
if (iteration == HDA_FW_BOOT_ATTEMPTS)
151+
if (hda->boot_iteration == HDA_FW_BOOT_ATTEMPTS)
152152
dev_err(sdev->dev,
153153
"error: dsp core x power down failed\n");
154154
goto err;
@@ -168,7 +168,7 @@ static int cl_dsp_init(struct snd_sof_dev *sdev, int stream_tag, int iteration)
168168
if (!ret)
169169
return 0;
170170

171-
if (iteration == HDA_FW_BOOT_ATTEMPTS)
171+
if (hda->boot_iteration == HDA_FW_BOOT_ATTEMPTS)
172172
dev_err(sdev->dev,
173173
"error: %s: timeout HDA_DSP_SRAM_REG_ROM_STATUS read\n",
174174
__func__);
@@ -328,6 +328,7 @@ int hda_dsp_cl_boot_firmware_iccmax(struct snd_sof_dev *sdev)
328328

329329
int hda_dsp_cl_boot_firmware(struct snd_sof_dev *sdev)
330330
{
331+
struct sof_intel_hda_dev *hda = sdev->pdata->hw_pdata;
331332
struct snd_sof_pdata *plat_data = sdev->pdata;
332333
const struct sof_dev_desc *desc = plat_data->desc;
333334
const struct sof_intel_dsp_desc *chip_info;
@@ -364,7 +365,8 @@ int hda_dsp_cl_boot_firmware(struct snd_sof_dev *sdev)
364365
dev_dbg(sdev->dev,
365366
"Attempting iteration %d of Core En/ROM load...\n", i);
366367

367-
ret = cl_dsp_init(sdev, stream->hstream.stream_tag, i + 1);
368+
hda->boot_iteration = i;
369+
ret = cl_dsp_init(sdev, stream->hstream.stream_tag);
368370

369371
/* don't retry anymore if successful */
370372
if (!ret)

sound/soc/sof/intel/hda.c

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -418,6 +418,7 @@ void hda_dsp_dump_skl(struct snd_sof_dev *sdev, u32 flags)
418418
/* dump the first 8 dwords representing the extended ROM status */
419419
static void hda_dsp_dump_ext_rom_status(struct snd_sof_dev *sdev)
420420
{
421+
struct sof_intel_hda_dev *hda = sdev->pdata->hw_pdata;
421422
char msg[128];
422423
int len = 0;
423424
u32 value;
@@ -428,11 +429,15 @@ static void hda_dsp_dump_ext_rom_status(struct snd_sof_dev *sdev)
428429
len += snprintf(msg + len, sizeof(msg) - len, " 0x%x", value);
429430
}
430431

431-
dev_err(sdev->dev, "error: extended rom status:%s", msg);
432+
if (hda->boot_iteration == HDA_FW_BOOT_ATTEMPTS)
433+
dev_err(sdev->dev, "error: extended rom status:%s", msg);
434+
else
435+
dev_dbg(sdev->dev, "extended rom status:%s", msg);
432436
}
433437

434438
void hda_dsp_dump(struct snd_sof_dev *sdev, u32 flags)
435439
{
440+
struct sof_intel_hda_dev *hda = sdev->pdata->hw_pdata;
436441
struct sof_ipc_dsp_oops_xtensa xoops;
437442
struct sof_ipc_panic_info panic_info;
438443
u32 stack[HDA_DSP_STACK_DUMP_SIZE];
@@ -452,8 +457,13 @@ void hda_dsp_dump(struct snd_sof_dev *sdev, u32 flags)
452457
snd_sof_get_status(sdev, status, panic, &xoops, &panic_info,
453458
stack, HDA_DSP_STACK_DUMP_SIZE);
454459
} else {
455-
dev_err(sdev->dev, "error: status = 0x%8.8x panic = 0x%8.8x\n",
456-
status, panic);
460+
if (hda->boot_iteration == HDA_FW_BOOT_ATTEMPTS)
461+
dev_err(sdev->dev, "error: status = 0x%8.8x panic = 0x%8.8x\n",
462+
status, panic);
463+
else
464+
dev_dbg(sdev->dev, "status = 0x%8.8x panic = 0x%8.8x\n",
465+
status, panic);
466+
457467
hda_dsp_dump_ext_rom_status(sdev);
458468
hda_dsp_get_status(sdev);
459469
}

sound/soc/sof/intel/hda.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -274,6 +274,7 @@
274274
#define BXT_D0I3_DELAY 5000
275275

276276
#define FW_CL_STREAM_NUMBER 0x1
277+
#define HDA_FW_BOOT_ATTEMPTS 3
277278

278279
/* ADSPCS - Audio DSP Control & Status */
279280

@@ -416,6 +417,7 @@ enum sof_hda_D0_substate {
416417

417418
/* represents DSP HDA controller frontend - i.e. host facing control */
418419
struct sof_intel_hda_dev {
420+
int boot_iteration;
419421

420422
struct hda_bus hbus;
421423

0 commit comments

Comments
 (0)