[media] dvb_frontend: Don't let drivers to trash data at cache
authorMauro Carvalho Chehab <mchehab@osg.samsung.com>
Thu, 4 Feb 2016 15:26:22 +0000 (13:26 -0200)
committerMauro Carvalho Chehab <mchehab@osg.samsung.com>
Thu, 4 Feb 2016 18:27:41 +0000 (16:27 -0200)
commitbb31d2381c730485be00a7da44c45416e9781709
tree4100d6fb96408eeae4132945c12f30689b3ca7fa
parent7e3e68bcfd7713fb1470070c8fa0f108609dd76b
[media] dvb_frontend: Don't let drivers to trash data at cache

GET_FRONTEND and G_PROPERTY can be called anytime, even when the
tuner/demod is not fully locked. However, several parameters
returned by those calls are available only after the demod get
VITERBI lock.

While several drivers do the right thing by checking the status before
returning the parameter, some drivers simply blindly update the
DTV properties cache without checking if the registers at the
hardware contain valid values.

Due to that, programs that call G_PROPERTY (or GET_FRONTEND)
before having a tuner lock may interfere at the zigzag logic,
as the DVB kthread calls the set_frontend() callback several
times, to fine tune the frequency and to identify if the signal
is inverted or not.

While the drivers should be fixed to report the right status,
we should prevent that such bugs would actually interfere at the
device operation.

So, let's use a separate var for userspace calls to get frontend.

As we copy the content of the cache, this should not cause any
troubles.

Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
drivers/media/dvb-core/dvb_frontend.c
This page took 0.041158 seconds and 5 git commands to generate.