]> git.proxmox.com Git - mirror_ubuntu-hirsute-kernel.git/blobdiff - drivers/hwtracing/coresight/coresight-tmc-etf.c
coresight: tmc: Limit the trace to available data
[mirror_ubuntu-hirsute-kernel.git] / drivers / hwtracing / coresight / coresight-tmc-etf.c
index 466af86fd76f5df9b81d0f9c8b59a18f686c664b..e68289b8c0721c721a44851d072b7eccde17de81 100644 (file)
@@ -48,6 +48,7 @@ static void tmc_etb_dump_hw(struct tmc_drvdata *drvdata)
        int i;
 
        bufp = drvdata->buf;
+       drvdata->len = 0;
        while (1) {
                for (i = 0; i < drvdata->memwidth; i++) {
                        read_data = readl_relaxed(drvdata->base + TMC_RRD);
@@ -55,6 +56,7 @@ static void tmc_etb_dump_hw(struct tmc_drvdata *drvdata)
                                return;
                        memcpy(bufp, &read_data, 4);
                        bufp += 4;
+                       drvdata->len += 4;
                }
        }
 }