Skip to content

Commit

Permalink
[media] cx24120: Check for lock before updating BER & UCB
Browse files Browse the repository at this point in the history
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 <jdenson@gmail.com>
Signed-off-by: Patrick Boettcher <patrick.boettcher@posteo.de>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
  • Loading branch information
Jemma Denson authored and Mauro Carvalho Chehab committed May 20, 2015
1 parent 80e9710 commit e3f2f63
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions drivers/media/dvb-frontends/cx24120.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit e3f2f63

Please sign in to comment.