media: dvb_ringbuffer: Add memory barriers
authorSoeren Moch <smoch@web.de>
Wed, 11 May 2016 16:49:11 +0000 (13:49 -0300)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sat, 20 Aug 2016 16:09:18 +0000 (18:09 +0200)
commit9e416faea82dd9231228ba5025c9d62f041e7726
treef810cf48e2464ff7c2b77a730dbb4096952d97ce
parentddc35199f2ad8e30c3a018e5a71c56dc60a791cd
media: dvb_ringbuffer: Add memory barriers

commit ca6e6126db5494f18c6c6615060d4d803b528bff upstream.

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>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/media/dvb-core/dvb_ringbuffer.c