clear-pkgs-linux-iot-lts2018/1073-ASoC-Intel-Skylake-Fix...

65 lines
2.2 KiB
Diff

From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Dominik Bozek <dominikx.bozek@intel.com>
Date: Fri, 23 Nov 2018 11:33:01 +0100
Subject: [PATCH] ASoC: Intel: Skylake: Fix readout of log buffer
The stack dump is transferred over 4k windows in PCI space.
Host and FW maintain two indexes: read and write. write index
is controlled by FW and may be changed. Software may not
optimize accesst to that index.
Change-Id: I35cbffcdc2f6a3406d6e661c289413e659165e18
Tracked-On: OAM-79127
Signed-off-by: Dominik Bozek <dominikx.bozek@intel.com>
---
sound/soc/intel/skylake/skl-sst-utils.c | 11 +++++------
1 file changed, 5 insertions(+), 6 deletions(-)
diff --git a/sound/soc/intel/skylake/skl-sst-utils.c b/sound/soc/intel/skylake/skl-sst-utils.c
index 01679815791b..344892e70d86 100644
--- a/sound/soc/intel/skylake/skl-sst-utils.c
+++ b/sound/soc/intel/skylake/skl-sst-utils.c
@@ -326,8 +326,8 @@ static int skl_check_ext_excep_data_avail(struct skl_sst *ctx, int idx)
/* move to the source dsp tracing window */
base += (idx * size);
ptr = (u32 *) base;
- read = ptr[0];
- write = ptr[1];
+ read = readl(ptr);
+ write = readl(ptr+1);
if (write == read)
return 0;
@@ -354,8 +354,8 @@ static void skl_read_ext_exception_data(struct skl_sst *ctx, int idx,
/* move to the current core's tracing window */
base += (idx * size);
ptr = (u32 *) base;
- read = ptr[0];
- write = ptr[1];
+ read = readl(ptr);
+ write = readl(ptr+1);
/* in case of read = write, just return */
if (read == write)
@@ -367,7 +367,6 @@ static void skl_read_ext_exception_data(struct skl_sst *ctx, int idx,
(write - read));
*sz_ext_dump = offset + write - read;
/* advance read pointer */
- ptr[0] += write - read;
} else {
/* wrap around condition - copy till the end */
memcpy_fromio((ext_core_dump + offset),
@@ -381,8 +380,8 @@ static void skl_read_ext_exception_data(struct skl_sst *ctx, int idx,
(const void __iomem *) (base + 8), write);
*sz_ext_dump = offset + write;
/* update the read pointer */
- ptr[0] = write;
}
+ writel(write, ptr);
}
int skl_dsp_crash_dump_read(struct skl_sst *ctx, int stack_size)
--
https://clearlinux.org