[media] media: dvb_ringbuffer: Add memory barriers
commit2342f6e61999e3ae252b42b617829eaa2d217cf2
authorSoeren Moch <smoch@web.de>
Wed, 11 May 2016 16:49:11 +0000 (11 13:49 -0300)
committerSasha Levin <alexander.levin@verizon.com>
Wed, 17 Aug 2016 16:58:31 +0000 (17 12:58 -0400)
treed945388a3d98da8c3fce0b2f1a08bd4f87b78f89
parent7235df953569546d2bab7c335635c13939ea6506
[media] media: dvb_ringbuffer: Add memory barriers

[ Upstream commit ca6e6126db5494f18c6c6615060d4d803b528bff ]

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>
Signed-off-by: Sasha Levin <alexander.levin@verizon.com>
drivers/media/dvb-core/dvb_ringbuffer.c