From: Jemma Denson Date: Tue, 19 May 2015 20:23:14 +0000 (-0300) Subject: [media] cx24120: Check for lock before updating BER & UCB X-Git-Tag: firefly_0821_release~176^2~795^2~714 X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=e3f2f63e8cc8a9b9a16f351b55a108ab82de6d2e;p=firefly-linux-kernel-4.4.55.git [media] cx24120: Check for lock before updating BER & UCB BER & UCB aren't available unless we're locked; don't update dvbv5 stats when not locked and mark these counters as unavailable. Signed-off-by: Jemma Denson Signed-off-by: Patrick Boettcher Signed-off-by: Mauro Carvalho Chehab --- diff --git a/drivers/media/dvb-frontends/cx24120.c b/drivers/media/dvb-frontends/cx24120.c index ce784248b328..dc80e6affeae 100644 --- a/drivers/media/dvb-frontends/cx24120.c +++ b/drivers/media/dvb-frontends/cx24120.c @@ -663,6 +663,15 @@ static void cx24120_get_stats(struct cx24120_state *state) c->cnr.stat[0].scale = FE_SCALE_NOT_AVAILABLE; } + /* BER & UCB require lock */ + if (!(state->fe_status & FE_HAS_LOCK)) { + c->post_bit_error.stat[0].scale = FE_SCALE_NOT_AVAILABLE; + c->post_bit_count.stat[0].scale = FE_SCALE_NOT_AVAILABLE; + c->block_error.stat[0].scale = FE_SCALE_NOT_AVAILABLE; + c->block_count.stat[0].scale = FE_SCALE_NOT_AVAILABLE; + return; + } + /* BER */ if (time_after(jiffies, state->ber_jiffies_stats)) { msecs = (state->berw_usecs + 500) / 1000;