summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMauro Carvalho Chehab <mchehab@redhat.com>2013-03-10 10:51:25 -0300
committerMauro Carvalho Chehab <mchehab@redhat.com>2013-03-21 07:49:04 -0300
commita9b9fbdf0a6a65359cd97254a282526822de5257 (patch)
treee65d8cf85fd26a49b75d8ef8c3d29ac849ae00c1
parent4cce1f4eb29765def538e7c975dac73346a0d306 (diff)
downloadlinux-a9b9fbdf0a6a65359cd97254a282526822de5257.tar.bz2
[media] siano: don't request statistics too fast
As each DVBv3 call may generate an stats overhead, prevent doing it too fast. This is specially useful if a burst of get stats DVBv3 call is sent. Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
-rw-r--r--drivers/media/common/siano/smsdvb-main.c5
-rw-r--r--drivers/media/common/siano/smsdvb.h2
2 files changed, 7 insertions, 0 deletions
diff --git a/drivers/media/common/siano/smsdvb-main.c b/drivers/media/common/siano/smsdvb-main.c
index c14f10d5d6c0..4242005082ed 100644
--- a/drivers/media/common/siano/smsdvb-main.c
+++ b/drivers/media/common/siano/smsdvb-main.c
@@ -663,6 +663,11 @@ static int smsdvb_send_statistics_request(struct smsdvb_client_t *client)
int rc;
struct SmsMsgHdr_ST Msg;
+ /* Don't request stats too fast */
+ if (client->get_stats_jiffies &&
+ (!time_after(jiffies, client->get_stats_jiffies)))
+ return 0;
+ client->get_stats_jiffies = jiffies + msecs_to_jiffies(100);
Msg.msgSrcId = DVBT_BDA_CONTROL_MSG_ID;
Msg.msgDstId = HIF_TASK;
diff --git a/drivers/media/common/siano/smsdvb.h b/drivers/media/common/siano/smsdvb.h
index 09982bcf2535..34220696d87d 100644
--- a/drivers/media/common/siano/smsdvb.h
+++ b/drivers/media/common/siano/smsdvb.h
@@ -52,6 +52,8 @@ struct smsdvb_client_t {
int event_fe_state;
int event_unc_state;
+ unsigned long get_stats_jiffies;
+
/* Stats debugfs data */
struct dentry *debugfs;