misc: tegra-profiler: add a memory barrier
Igor Nabirushkin [Mon, 6 Mar 2017 10:06:10 +0000 (14:06 +0400)]
Use smp_store_release() to update circle buffer write pointers to
ensure the data is stored before we update write pointer.

Bug 1881996

Change-Id: Icaade5e6f57056c638efa61e65e9a8a6f6e12416
Signed-off-by: Igor Nabirushkin <inabirushkin@nvidia.com>
Reviewed-on: http://git-master/r/1315657
(cherry picked from commit c19fa2487c1d385d9cde0595cab66aeea416c00d)

drivers/misc/tegra-profiler/comm.c

index f85346e..7ade709 100644 (file)
@@ -178,7 +178,7 @@ write_sample(struct quadd_ring_buffer *rb,
                rb_hdr->max_fill_count = fill_count;
        }
 
-       rb_hdr->pos_write = new_hdr.pos_write;
+       smp_store_release(&rb_hdr->pos_write, new_hdr.pos_write);
 
        return length_sample;
 }