[media] siano: don't request statistics too fast
authorMauro Carvalho Chehab <mchehab@redhat.com>
Sun, 10 Mar 2013 13:51:25 +0000 (10:51 -0300)
committerMauro Carvalho Chehab <mchehab@redhat.com>
Thu, 21 Mar 2013 10:49:04 +0000 (07:49 -0300)
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>
drivers/media/common/siano/smsdvb-main.c
drivers/media/common/siano/smsdvb.h

index c14f10d5d6c056997f9add4894fffcc15838c6e7..4242005082ed33204f49668a7d36c7fd0cca918f 100644 (file)
@@ -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;
index 09982bcf253553eaebc57aa63fb3e550a05b42af..34220696d87d9c0bad1f4ed8352500b5cff24ad2 100644 (file)
@@ -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;