Skip to content

Commit cda539d

Browse files
Suzuki K Poulosegregkh
authored andcommitted
coresight: tmc-etr: Fix barrier packet insertion for perf buffer
commit 83be0b8 upstream. When the ETR is used in perf mode with a larger buffer (configured via sysfs or the default size of 1M) than the perf aux buffer size, we end up inserting the barrier packet at the wrong offset, while moving the offset forward. i.e, instead of the "new moved offset", we insert it at the current hardware buffer offset. These packets will not be visible as they are never copied and could lead to corruption in the trace decoding side, as the decoder is not aware that it needs to reset the decoding. Fixes: ec13c78 ("coresight: tmc-etr: Add barrier packets when moving offset forward") Cc: Mathieu Poirier <mathieu.poirier@linaro.org> Cc: stable@vger.kernel.org Reported-by: Al Grant <al.grant@arm.com> Tested-by: Mike Leach <mike.leach@arm.com> Signed-off-by: Suzuki K Poulose <suzuki.poulose@arm.com> Signed-off-by: Mathieu Poirier <mathieu.poirier@linaro.org> Link: https://lore.kernel.org/r/20201208182651.1597945-2-mathieu.poirier@linaro.org Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
1 parent 35d07b0 commit cda539d

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

‎drivers/hwtracing/coresight/coresight-tmc-etr.c‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1552,7 +1552,7 @@ tmc_update_etr_buffer(struct coresight_device *csdev,
15521552

15531553
/* Insert barrier packets at the beginning, if there was an overflow */
15541554
if (lost)
1555-
tmc_etr_buf_insert_barrier_packet(etr_buf, etr_buf->offset);
1555+
tmc_etr_buf_insert_barrier_packet(etr_buf, offset);
15561556
tmc_etr_sync_perf_buffer(etr_perf, offset, size);
15571557

15581558
/*

0 commit comments

Comments
 (0)