android_kernel_oneplus_msm8998/drivers/media/dvb-core
Jasmin J ae11b9b3d1 media/dvb-core: Race condition when writing to CAM
[ Upstream commit e7080d4471d805d921a9ea21b32f911a91e248cb ]

It started with a sporadic message in syslog: "CAM tried to send a
buffer larger than the ecount size" This message is not the fault
itself, but a consecutive fault, after a read error from the CAM. This
happens only on several CAMs, several hardware, and of course sporadic.

It is a consecutive fault, if the last read from the CAM did fail. I
guess this will not happen on all CAMs, but at least it did on mine.
There was a write error to the CAM and during the re-initialization
procedure, the CAM finished the last read, although it got a RS.

The write error to the CAM happened because a race condition between HC
write, checking DA and FR.

This patch added an additional check for DA(RE), just after checking FR.
It is important to read the CAMs status register again, to give the CAM
the necessary time for a proper reaction to HC. Please note the
description within the source code (patch below).

[mchehab@s-opensource.com: make checkpatch happy]

Signed-off-by: Jasmin jessich <jasmin@anw.at>
Tested-by: Ralph Metzler <rjkm@metzlerbros.de>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
Signed-off-by: Sasha Levin <alexander.levin@microsoft.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-03-24 10:58:41 +01:00
..
demux.h [media] demux.h: Convert MPEG-TS demux caps to an enum 2015-10-10 10:29:08 -03:00
dmxdev.c [media] dvb: get rid of enum dmx_success 2015-10-06 19:53:02 -03:00
dmxdev.h
dvb-usb-ids.h
dvb_ca_en50221.c media/dvb-core: Race condition when writing to CAM 2018-03-24 10:58:41 +01:00
dvb_ca_en50221.h
dvb_demux.c [media] dvb: get rid of enum dmx_success 2015-10-06 19:53:02 -03:00
dvb_demux.h
dvb_filter.c
dvb_filter.h
dvb_frontend.c media: dvb-core: Don't force CAN_INVERSION_AUTO in oneshot mode 2016-03-03 15:07:13 -08:00
dvb_frontend.h
dvb_math.c
dvb_math.h
dvb_net.c [media] dvb: get rid of enum dmx_success 2015-10-06 19:53:02 -03:00
dvb_net.h
dvb_ringbuffer.c media: dvb_ringbuffer: Add memory barriers 2016-08-20 18:09:18 +02:00
dvb_ringbuffer.h
dvbdev.c
dvbdev.h
Kconfig
Makefile