summaryrefslogtreecommitdiffstats
path: root/drivers/hwtracing/coresight/coresight-tmc-etr.c
diff options
context:
space:
mode:
authorMathieu Poirier2017-08-02 18:21:57 +0200
committerGreg Kroah-Hartman2017-08-28 16:05:47 +0200
commit0c3fc4d5fa26092853278145aca9b21fa52a3e93 (patch)
tree22445053dce96dc4922d04deb5f029a3aaec8c56 /drivers/hwtracing/coresight/coresight-tmc-etr.c
parentcoresight: etb10: Remove useless conversion to LE (diff)
downloadkernel-qcow2-linux-0c3fc4d5fa26092853278145aca9b21fa52a3e93.tar.gz
kernel-qcow2-linux-0c3fc4d5fa26092853278145aca9b21fa52a3e93.tar.xz
kernel-qcow2-linux-0c3fc4d5fa26092853278145aca9b21fa52a3e93.zip
coresight: Add barrier packet for synchronisation
When a buffer overflow happens the synchronisation patckets usually present at the beginning of the buffer are lost, a situation that prevents the decoder from knowing the context of the traces being decoded. This patch adds a barrier packet to be used by sink IPs when a buffer overflow condition is detected. These barrier packets are then used by the decoding library as markers to force re-synchronisation. Signed-off-by: Mathieu Poirier <mathieu.poirier@linaro.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/hwtracing/coresight/coresight-tmc-etr.c')
-rw-r--r--drivers/hwtracing/coresight/coresight-tmc-etr.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/drivers/hwtracing/coresight/coresight-tmc-etr.c b/drivers/hwtracing/coresight/coresight-tmc-etr.c
index 5d312699b3b9..b8fb981de7b6 100644
--- a/drivers/hwtracing/coresight/coresight-tmc-etr.c
+++ b/drivers/hwtracing/coresight/coresight-tmc-etr.c
@@ -59,6 +59,8 @@ static void tmc_etr_enable_hw(struct tmc_drvdata *drvdata)
static void tmc_etr_dump_hw(struct tmc_drvdata *drvdata)
{
+ const u32 *barrier;
+ u32 *temp;
u32 rwp, val;
rwp = readl_relaxed(drvdata->base + TMC_RWP);
@@ -71,6 +73,16 @@ static void tmc_etr_dump_hw(struct tmc_drvdata *drvdata)
if (val & TMC_STS_FULL) {
drvdata->buf = drvdata->vaddr + rwp - drvdata->paddr;
drvdata->len = drvdata->size;
+
+ barrier = barrier_pkt;
+ temp = (u32 *)drvdata->buf;
+
+ while (*barrier) {
+ *temp = *barrier;
+ temp++;
+ barrier++;
+ }
+
} else {
drvdata->buf = drvdata->vaddr;
drvdata->len = rwp - drvdata->paddr;