From patchwork Sun Apr 8 17:21:37 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Akihiro TSUKADA X-Patchwork-Id: 10328389 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 652E2604D4 for ; Sun, 8 Apr 2018 17:22:30 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 55B52288D7 for ; Sun, 8 Apr 2018 17:22:30 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 4A67F28B04; Sun, 8 Apr 2018 17:22:30 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-8.0 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, FREEMAIL_FROM, MAILING_LIST_MULTI, RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 00E9C288D7 for ; Sun, 8 Apr 2018 17:22:30 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752460AbeDHRW3 (ORCPT ); Sun, 8 Apr 2018 13:22:29 -0400 Received: from mail-pl0-f68.google.com ([209.85.160.68]:42099 "EHLO mail-pl0-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752412AbeDHRW1 (ORCPT ); Sun, 8 Apr 2018 13:22:27 -0400 Received: by mail-pl0-f68.google.com with SMTP id t20-v6so865955ply.9 for ; Sun, 08 Apr 2018 10:22:27 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=94fpNYYizE7luEC6Eih6cAE3DjEj6hq186rdFge9Apo=; b=Yo81+72glfA8wdopf19xY4Qlbtk8jeNt/qs5McT17J0JauTYr/p4dTSYnm5BSy62K0 kHeOvt6M8hT62dYvQFygteTRU7Bc33FRTTjUPtNWTQcg31KtcWRT2KVLi0uNuMOER45y 93t+uKuqxWsceEZaTad9J+hUVQXTKpiqyj30sp4N1J+Lho1rEXfaYBfwc+4HDMyqY6sv Y7PfSXtCLwIp4LO0VB6W9kT6YhaCadbA//7SjKkQEFr1Yk+OTydd47dK0svUYXwKoxM9 DKooWfNyFXuWcTOchG5yuZb0BON+dEDI9IQDsPqvw1WiMke7PdwJk/4aPiaLqZBumiwV S0FA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=94fpNYYizE7luEC6Eih6cAE3DjEj6hq186rdFge9Apo=; b=uHjJkzzZDYra+4GG64KsAzm4yE4xuXZpIWCcv3v60lDHWfJiK332obqihOo+ccOh6l cvRw/hNV8mUwvhxzWx7l599Lyezv+JnU1S/GYaM8aPNSKet6nBtHj3pHIQSc23Lchx7u HNg4XN5xysNCMLoBcI+zRE5WdSs8N8uLAjb2HQS4BR5vsaTCWIE0/f1dgD+2mDEeyp4j riGmtdQuD4rFOqplEF1KvTQxDjPgMSGXw7jkIclvRSJvVO7lTxmlpgPDpXxz6dSZg6sk CXb4f2/CUVlpY8YgH6hFpL5ksX9D6jI7Ws16h8a3JDmhzaCD3gYwMlU0FFR0TQcNDbc3 HrsQ== X-Gm-Message-State: ALQs6tBr6+VjN2rMEIoVmZE6zQvERIU0o/nYoNLd6jr4DKhOGOostxQ3 wEyqmoX6t4saMKI9rvypuCm8zQ== X-Google-Smtp-Source: AIpwx4/YM5/JBLfwbMN1GfOIiC0bFq6UsRxzs5n1qS2ch/dvLEtW4jCzPew60fKu5relPZK9+CYcaw== X-Received: by 2002:a17:902:b082:: with SMTP id p2-v6mr355166plr.11.1523208147254; Sun, 08 Apr 2018 10:22:27 -0700 (PDT) Received: from localhost.localdomain (softbank219203027033.bbtec.net. [219.203.27.33]) by smtp.googlemail.com with ESMTPSA id j125sm33717026pfg.188.2018.04.08.10.22.25 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sun, 08 Apr 2018 10:22:26 -0700 (PDT) From: tskd08@gmail.com To: linux-media@vger.kernel.org Cc: mchehab@s-opensource.com, Akihiro Tsukada , crope@iki.fi Subject: [PATCH v5 4/5] dvb-usb-v2/gl861: use usleep_range() for short delay Date: Mon, 9 Apr 2018 02:21:37 +0900 Message-Id: <20180408172138.9974-5-tskd08@gmail.com> X-Mailer: git-send-email 2.17.0 In-Reply-To: <20180408172138.9974-1-tskd08@gmail.com> References: <20180408172138.9974-1-tskd08@gmail.com> Sender: linux-media-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP From: Akihiro Tsukada As the kernel doc "timers-howto.txt" reads, short delay with msleep() can take much longer. In a case of raspbery-pi platform where CONFIG_HZ_100 was set, it actually affected the init of Friio devices since it issues lots of i2c transactions with short delay. Signed-off-by: Akihiro Tsukada --- Changes since v4: - none drivers/media/usb/dvb-usb-v2/gl861.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/media/usb/dvb-usb-v2/gl861.c b/drivers/media/usb/dvb-usb-v2/gl861.c index ecff0062bfb..cdd7bfcb883 100644 --- a/drivers/media/usb/dvb-usb-v2/gl861.c +++ b/drivers/media/usb/dvb-usb-v2/gl861.c @@ -45,7 +45,7 @@ static int gl861_i2c_msg(struct dvb_usb_device *d, u8 addr, return -EINVAL; } - msleep(1); /* avoid I2C errors */ + usleep_range(1000, 2000); /* avoid I2C errors */ return usb_control_msg(d->udev, usb_rcvctrlpipe(d->udev, 0), req, type, value, index, rbuf, rlen, 2000);