From patchwork Mon Mar 26 18:06:51 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Akihiro TSUKADA X-Patchwork-Id: 10308469 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 70BD760386 for ; Mon, 26 Mar 2018 18:08:36 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 6380328B58 for ; Mon, 26 Mar 2018 18:08:36 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 5720528BCD; Mon, 26 Mar 2018 18:08:36 +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=-7.0 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, FREEMAIL_FROM, 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 001BC28C47 for ; Mon, 26 Mar 2018 18:08:35 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752562AbeCZSIe (ORCPT ); Mon, 26 Mar 2018 14:08:34 -0400 Received: from mail-pg0-f65.google.com ([74.125.83.65]:37333 "EHLO mail-pg0-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752463AbeCZSIc (ORCPT ); Mon, 26 Mar 2018 14:08:32 -0400 Received: by mail-pg0-f65.google.com with SMTP id n11so7569836pgp.4 for ; Mon, 26 Mar 2018 11:08:32 -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=NPuGRclzoZzZPubp/DJwW/Oy46FiSwJqnNnNRkunu0k=; b=SXQvWG/oVwMvggFvgOVPL5ywzQNKvpimOdi8cBcuHsJ4aeTpYd/vPsF3Tr02OSAiX2 agoVmj6JAdKU6Ubjh8JV0BpnrBP7b2ZJztYv9iZ9Y56lcu7foghTCxnHnAROsRjeSO7z vTanPynV/FgqSWFzFhjhQ+EH+/7DHOeMY5M92TRKg5tO11lC0+la/v7UVGNbGgIypSDD 1MKshmFHnRLmkwYxEl1K9EfFU35SPMm71dGfBQM4UEDBzOD9s/Q1Im9BFCl3G95PNsLI X2jfoULlr9himxOF+s4a7THhmenIsyyjMoTfZOXr3PAvtGl7EIQXeE//I392KNV/RqSq RG1A== 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=NPuGRclzoZzZPubp/DJwW/Oy46FiSwJqnNnNRkunu0k=; b=f8XufdGlETPae7WL+RY1Dy5AZrVUCFzBpsclAyUuaWVjCmfDNPrHIkc2DKs7rPvVWm NkIBEZWGJeFDVrxoi2au7bNmx2yCSRifMJK4o3Xoni3M0dBh1jWTWreSOjzWxcStVsco HBlMj/p7tnJVDTn7ZKdaB73EYHEyWz726uMcIogisGBxxalZrPkR2cZF3NEmnPBhdpM8 qhTIDkYFozkWFmsOZRF9AU8sUmeJLCncPUH7YO8JVbiC6IdfXD2xuF5hym7lRnfXqP2k dleUgbSpsZQ+/NAvJsHP+79JBw0zTQb/RLk9Db/dET+2jsFIVVzWgzu/UL7gxc0/jBqD fMeA== X-Gm-Message-State: AElRT7HWF7waJrR5fO1+/gBhghqRKvTo/WyQa9V/6uypMUrgJQTODeIn ykO+LHW6xE5KIIwq5QD4C9yhxw== X-Google-Smtp-Source: AG47ELt9ZaqZxLqDD7YSSG3sWXG5NX0e7wqrLGAnlGegYzZxksJlhMW/WFJtZpSipAbGRtUCm3me9Q== X-Received: by 10.98.63.75 with SMTP id m72mr29419367pfa.167.1522087711924; Mon, 26 Mar 2018 11:08:31 -0700 (PDT) Received: from localhost.localdomain (softbank219203027033.bbtec.net. [219.203.27.33]) by smtp.googlemail.com with ESMTPSA id q6sm27150368pga.37.2018.03.26.11.08.30 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 26 Mar 2018 11:08:31 -0700 (PDT) From: tskd08@gmail.com To: linux-media@vger.kernel.org Cc: mchehab@s-opensource.com, Akihiro Tsukada Subject: [PATCH v3 4/5] dvb-usb-v2/gl861: use usleep_range() for short delay Date: Tue, 27 Mar 2018 03:06:51 +0900 Message-Id: <20180326180652.5385-5-tskd08@gmail.com> X-Mailer: git-send-email 2.16.2 In-Reply-To: <20180326180652.5385-1-tskd08@gmail.com> References: <20180326180652.5385-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 --- 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 bc18ca33649..a57afb12e84 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);