[lkml]   [2021]   [Jul]   [4]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
Messages in this thread
Patch in this message
Subject[PATCH v3 03/10] coresight: tmc-etf: Add comment for store ordering
AUX ring buffer is required to separate the data store and aux_head
store, since the function CS_LOCK() has contained memory barrier mb(),
mb() is a more conservative barrier than smp_wmb() on Arm32/Arm64, 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 <>
drivers/hwtracing/coresight/coresight-tmc-etf.c | 6 ++++++
1 file changed, 6 insertions(+)

diff --git a/drivers/hwtracing/coresight/coresight-tmc-etf.c b/drivers/hwtracing/coresight/coresight-tmc-etf.c
index 45b85edfc690..9a42ee689921 100644
--- a/drivers/hwtracing/coresight/coresight-tmc-etf.c
+++ b/drivers/hwtracing/coresight/coresight-tmc-etf.c
@@ -553,6 +553,12 @@ static unsigned long tmc_update_etf_buffer(struct coresight_device *csdev,
if (buf->snapshot)
handle->head += to_read;

+ /*
+ * AUX ring buffer requires to use memory barrier to separate the trace
+ * data store and aux_head store, because CS_LOCK() contains mb() which
+ * gives more heavy barrier than smp_wmb(), it's not necessary to
+ * explicitly invoke any barrier.
+ */
spin_unlock_irqrestore(&drvdata->spinlock, flags);
 \ /
  Last update: 2021-07-04 09:17    [W:0.235 / U:0.012 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site