From patchwork Wed Mar 28 17:01:00 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Akihiro TSUKADA X-Patchwork-Id: 10313633 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 1B089600F6 for ; Wed, 28 Mar 2018 17:01:46 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 0C6AC29F46 for ; Wed, 28 Mar 2018 17:01:46 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 0AFD729F89; Wed, 28 Mar 2018 17:01:46 +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 A917829F46 for ; Wed, 28 Mar 2018 17:01:45 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752869AbeC1RBm (ORCPT ); Wed, 28 Mar 2018 13:01:42 -0400 Received: from mail-pl0-f65.google.com ([209.85.160.65]:38059 "EHLO mail-pl0-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753353AbeC1RBh (ORCPT ); Wed, 28 Mar 2018 13:01:37 -0400 Received: by mail-pl0-f65.google.com with SMTP id m22-v6so1962132pls.5 for ; Wed, 28 Mar 2018 10:01:37 -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=HS7RukosElX3u13UrTsbb4LI8yQMGa/7wxyhH/jrz4w=; b=Ukgme7ygq9N7y4JRwGjYI/MOiZVBPItLXrF8hxUTuwnQ2YjM19IcUMSblSbVsAI7lC UyVmATjpyrenXJXp5zjGUNDt/42F+bQiC3wGiI6/oP04X5lQ6rFD1JIJDnH4WEpBfxd8 xgoIbczl5S9cG43rHy1gce8d+atP7GuE2yYwAGy9DnjaDn6wItwVrOgRo/FtuJy8FXrk jY8RU5YVH2280FcKgQI1xzxjZ7EyleFBK9G9+rpPDRt7jXmA8zYTmbUcuKhaEXHRtMgr drGKxFf5zgGsv/R6qdMgNvIVH99yQonZwnf1EIaZPRYH+Yd5y3SmteHRmeiPbyo5zbTj n3Qw== 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=HS7RukosElX3u13UrTsbb4LI8yQMGa/7wxyhH/jrz4w=; b=Z5f/tB2aw6f4BSUSUyTNC3Dih7yEa36tDK3y7m68KT66EQK4qurhUHThOas7wnIyHj nGb8mfs/hUZQwblZ/VrRTSIAEfbEnQNUa+fBwrdUP+ia62uU7uXkBplOAa9Ha4nYRDMl p/Chxd8HyjR6HYmmKHfU9X4AXF+mAePjZUP70u1EZfqG6nuUdm4lDIKyMVdzlz/fO9CJ ODvS1d4lPCFNxi2xJsUqVIst7bQYbJEFN+szhHPRWSMo5poE1amggQb81BLK4MAAvL/O ggYSnL4kAxSV2dutf6pz83TZj2DH4utMig7ibBs/ckmo0RYwvnf1Smz1nurPqvGyByJY uiEA== X-Gm-Message-State: AElRT7FoFZMCIuaRZYzN6aGXb7rhBZuaaCBTTrnQy0YchilnUnvYF9aZ Rkb73rT5mDgL9L95j0RkUn99zg== X-Google-Smtp-Source: AIpwx4+3C3HDq2vNhDXF2c3vKhktS/fWkrDcjeForwIeUfwB+QCwXhafFtML6r4S1SeoGPHVHgWjpw== X-Received: by 2002:a17:902:228:: with SMTP id 37-v6mr4604482plc.141.1522256497119; Wed, 28 Mar 2018 10:01:37 -0700 (PDT) Received: from localhost.localdomain (softbank219203027033.bbtec.net. [219.203.27.33]) by smtp.googlemail.com with ESMTPSA id u4sm8950012pfb.43.2018.03.28.10.01.35 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 28 Mar 2018 10:01:36 -0700 (PDT) From: tskd08@gmail.com To: linux-media@vger.kernel.org Cc: mchehab@s-opensource.com, Akihiro Tsukada , crope@iki.fi Subject: [PATCH v4 4/5] dvb-usb-v2/gl861: use usleep_range() for short delay Date: Thu, 29 Mar 2018 02:01:00 +0900 Message-Id: <20180328170101.29385-5-tskd08@gmail.com> X-Mailer: git-send-email 2.16.3 In-Reply-To: <20180328170101.29385-1-tskd08@gmail.com> References: <20180328170101.29385-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 v3: - 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 a0280126bfc..6f6dfa65bba 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);