clear-pkgs-linux-iot-lts2018/1075-ASoC-Intel-Read-remain...

46 lines
1.6 KiB
Diff

From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: "Lulko, KamilX" <kamilx.lulko@intel.com>
Date: Wed, 10 Apr 2019 16:20:44 +0200
Subject: [PATCH] ASoC: Intel: Read remainder of stack dump
When dump complete flag is set and the write pointer
wrapped around, we could miss last few bytes of data.
Attempt to read the remainder after completion.
Change-Id: I5218a8a83862d504a23f565910cc6622e0439e1c
Signed-off-by: Lulko, KamilX <kamilx.lulko@intel.com>
---
sound/soc/intel/skylake/skl-sst-utils.c | 14 ++++++++++++--
1 file changed, 12 insertions(+), 2 deletions(-)
diff --git a/sound/soc/intel/skylake/skl-sst-utils.c b/sound/soc/intel/skylake/skl-sst-utils.c
index 856a6e86be52..4e210992d48b 100644
--- a/sound/soc/intel/skylake/skl-sst-utils.c
+++ b/sound/soc/intel/skylake/skl-sst-utils.c
@@ -409,10 +409,20 @@ int skl_dsp_crash_dump_read(struct skl_sst *ctx, int idx, int stack_size)
stackdump_complete = readl(fw_reg_addr +
EXCEPTION_RECORD_OFFSET(ctx->cores.count, idx));
if (skl_read_ext_exception_data(ctx, idx, ext_core_dump,
- ext_core_dump_sz, &sz_ext_dump) < 0)
+ ext_core_dump_sz, &sz_ext_dump) < 0) {
+ dev_err(ctx->dsp->dev, "Stack Dump read error\n");
break;
- if (time_after(jiffies, timeout))
+ }
+ if (stackdump_complete) {
+ /* Try reading the remainder */
+ skl_read_ext_exception_data(ctx, idx, ext_core_dump,
+ ext_core_dump_sz, &sz_ext_dump);
+ break;
+ }
+ if (time_after(jiffies, timeout)) {
+ dev_err(ctx->dsp->dev, "Stack Dump reading timed out\n");
break;
+ }
}
/* Length representing in DWORD */
--
https://clearlinux.org