소스 검색

[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>
Mauro Carvalho Chehab 12 년 전
부모
커밋
a9b9fbdf0a
2개의 변경된 파일7개의 추가작업 그리고 0개의 파일을 삭제
  1. 5 0
      drivers/media/common/siano/smsdvb-main.c
  2. 2 0
      drivers/media/common/siano/smsdvb.h

+ 5 - 0
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;

+ 2 - 0
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;