From patchwork Wed Jul 2 15:52:21 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mauro Carvalho Chehab X-Patchwork-Id: 4466531 Return-Path: X-Original-To: patchwork-linux-media@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 0D6D59F390 for ; Wed, 2 Jul 2014 15:52:40 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 47573201F4 for ; Wed, 2 Jul 2014 15:52:38 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 70AA0201E4 for ; Wed, 2 Jul 2014 15:52:37 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755449AbaGBPwe (ORCPT ); Wed, 2 Jul 2014 11:52:34 -0400 Received: from bombadil.infradead.org ([198.137.202.9]:35710 "EHLO bombadil.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754168AbaGBPwd (ORCPT ); Wed, 2 Jul 2014 11:52:33 -0400 Received: from [201.74.152.26] (helo=smtp.w2.samsung.com) by bombadil.infradead.org with esmtpsa (Exim 4.80.1 #2 (Red Hat Linux)) id 1X2Mpi-0006tF-By; Wed, 02 Jul 2014 15:52:30 +0000 Received: from mchehab by smtp.w2.samsung.com with local (Exim 4.80.1) (envelope-from ) id 1X2Mpe-0006Eh-6Q; Wed, 02 Jul 2014 12:52:26 -0300 From: Mauro Carvalho Chehab To: Patrick Boettcher Cc: Mauro Carvalho Chehab , Linux Media Mailing List , Mauro Carvalho Chehab Subject: [PATCH RFC 7/9] dib8000: Fix the sleep time at the state machine Date: Wed, 2 Jul 2014 12:52:21 -0300 Message-Id: <1404316343-23856-8-git-send-email-m.chehab@samsung.com> X-Mailer: git-send-email 1.9.3 In-Reply-To: <1404316343-23856-1-git-send-email-m.chehab@samsung.com> References: <1404316343-23856-1-git-send-email-m.chehab@samsung.com> Sender: linux-media-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org X-Spam-Status: No, score=-6.9 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, T_RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP msleep() is not too precise: its precision depends on the HZ config. As the driver selects precise timings for the state machine, change it to usleep_range(). Signed-off-by: Mauro Carvalho Chehab --- drivers/media/dvb-frontends/dib8000.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/media/dvb-frontends/dib8000.c b/drivers/media/dvb-frontends/dib8000.c index f657cb510bd1..d160a1ed92bb 100644 --- a/drivers/media/dvb-frontends/dib8000.c +++ b/drivers/media/dvb-frontends/dib8000.c @@ -3601,10 +3601,10 @@ static int dib8000_set_frontend(struct dvb_frontend *fe) else if ((time_slave != FE_CALLBACK_TIME_NEVER) && (time_slave > time)) time = time_slave; } - if (time != FE_CALLBACK_TIME_NEVER) - msleep(time / 10); - else + if (time == FE_CALLBACK_TIME_NEVER) break; + + usleep_range(time * 100, (time + 10) * 100); exit_condition = 1; for (index_frontend = 0; (index_frontend < MAX_NUMBER_OF_FRONTENDS) && (state->fe[index_frontend] != NULL); index_frontend++) { if (dib8000_get_tune_state(state->fe[index_frontend]) != CT_AGC_STOP) {