coresight: tmc-etf: Add comment for store ordering
authorLeo Yan <leo.yan@linaro.org>
Mon, 9 Aug 2021 11:14:01 +0000 (19:14 +0800)
committerMathieu Poirier <mathieu.poirier@linaro.org>
Wed, 27 Oct 2021 17:44:43 +0000 (11:44 -0600)
Since the function CS_LOCK() has contained memory barrier mb(), it
ensures the visibility of the AUX trace data before updating the
aux_head, thus it's needless to add any explicit barrier anymore.

Add comment to make clear for the barrier usage for ETF.

Signed-off-by: Leo Yan <leo.yan@linaro.org>
Link: https://lore.kernel.org/r/20210809111407.596077-4-leo.yan@linaro.org
Signed-off-by: Suzuki K Poulose <suzuki.poulose@arm.com>
Signed-off-by: Mathieu Poirier <mathieu.poirier@linaro.org>
drivers/hwtracing/coresight/coresight-tmc-etf.c

index cd0fb7bfba6849cb1efb1a09b8c8ada7af09cee7..8debd4f40f065ddd3a82d3ec1b83bf31fb31f175 100644 (file)
@@ -553,6 +553,11 @@ static unsigned long tmc_update_etf_buffer(struct coresight_device *csdev,
        if (buf->snapshot)
                handle->head += to_read;
 
+       /*
+        * CS_LOCK() contains mb() so it can ensure visibility of the AUX trace
+        * data before the aux_head is updated via perf_aux_output_end(), which
+        * is expected by the perf ring buffer.
+        */
        CS_LOCK(drvdata->base);
 out:
        spin_unlock_irqrestore(&drvdata->spinlock, flags);