[media] media: dvb_ringbuffer: Add memory barriers
authorSoeren Moch <smoch@web.de>
Wed, 11 May 2016 16:49:11 +0000 (13:49 -0300)
committerMauro Carvalho Chehab <mchehab@s-opensource.com>
Sat, 9 Jul 2016 10:57:47 +0000 (07:57 -0300)
commitca6e6126db5494f18c6c6615060d4d803b528bff
tree7f58346a04a40eb967699f28e13041580da271bb
parent65ad26cdfdf119be3e382ec9d05916cfc7c6be61
[media] media: dvb_ringbuffer: Add memory barriers

Implement memory barriers according to Documentation/circular-buffers.txt:
- use smp_store_release() to update ringbuffer read/write pointers
- use smp_load_acquire() to load write pointer on reader side
- use ACCESS_ONCE() to load read pointer on writer side

This fixes data stream corruptions observed e.g. on an ARM Cortex-A9
quad core system with different types (PCI, USB) of DVB tuners.

Signed-off-by: Soeren Moch <smoch@web.de>
Cc: stable@vger.kernel.org # 3.14+
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
drivers/media/dvb-core/dvb_ringbuffer.c