From patchwork Mon Apr 11 18:57:21 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bartosz Golaszewski X-Patchwork-Id: 65558 Delivered-To: patch@linaro.org Received: by 10.140.93.198 with SMTP id d64csp1518720qge; Mon, 11 Apr 2016 11:58:10 -0700 (PDT) X-Received: by 10.66.120.46 with SMTP id kz14mr34894526pab.61.1460401089265; Mon, 11 Apr 2016 11:58:09 -0700 (PDT) Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id q84si4921668pfa.197.2016.04.11.11.58.09; Mon, 11 Apr 2016 11:58:09 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-i2c-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=neutral (body hash did not verify) header.i=@baylibre-com.20150623.gappssmtp.com; spf=pass (google.com: best guess record for domain of linux-i2c-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-i2c-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755181AbcDKS54 (ORCPT + 1 other); Mon, 11 Apr 2016 14:57:56 -0400 Received: from mail-pf0-f170.google.com ([209.85.192.170]:35203 "EHLO mail-pf0-f170.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755145AbcDKS5z (ORCPT ); Mon, 11 Apr 2016 14:57:55 -0400 Received: by mail-pf0-f170.google.com with SMTP id n1so129142449pfn.2 for ; Mon, 11 Apr 2016 11:57:54 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=baylibre-com.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=9DXiZj/1pm3qhR0mlPuxyjW5YG7nQGY52JEMjAHlSHQ=; b=J49cyJ+M8pvcbplpZuybtuZy7Xfu5ocFGY91fsMgkLE/y024kNhyvTcAXXPGRSDllB TvY0TUYWmM+scLr9DMndr/AW0L+VaWUgs6LsOD5hv9dOC99YWILhu+IWVrsT1CMJ3ZPp 7xAwJxa4pf+pcnqLR5H5ef8B9zKcrNXHX877qANqq+2gVvrFjxouXwZzicPm1U/fqgb8 8+3kG8BJnp9qJ3uiRxSdxt51SOr3pJkWCgr5lD2PFgPlLxojWUMFcS4aQLjWFY2BAZw/ J4Sr4Jcts7FvUH852JWBcIOdfDXrnsOZiJ29fyU5PTjNELbOmRm5y32AZkd6rSLPHtda XBYg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=9DXiZj/1pm3qhR0mlPuxyjW5YG7nQGY52JEMjAHlSHQ=; b=jpDpOKI7mGDnZOHcclHX9QLxhLjo6R3oho0D9iTQlslOEUzf6H0JEICxqBJgt/vGuD UeCgh13h3lMYL9PChmj2rWGA/jg3YOGJjHpG+I+6zPsEQAalwvc+PNhj8beQTohCYiFT dq4tu7iIpOqxXsehTSUtgoKL7duU60/eGrzhPYNYPeM8VicNYSOitWbFY3FM7Mo1dj5U GDcBdKST6bPfQm+AHNOPOZIk2r+pklUtQM2zGlJ2nKeSzqotS1PS8pHBvL82wBgIQmJA PXsBVvjGHNp1o+NSqop8Mxg8QKJkqaKR15BjBXTPqJuGwSwZ5yP09TJxxTtF9xhvlQxE B7Cg== X-Gm-Message-State: AD7BkJJxm70MtZA9s7udq2qBe94y6G9O8oWiOZfjV2v70kANNH15/T51epl2Nk7TYYv2KjVU X-Received: by 10.98.87.200 with SMTP id i69mr34538542pfj.63.1460401074377; Mon, 11 Apr 2016 11:57:54 -0700 (PDT) Received: from localhost.localdomain (cpe-172-248-200-249.socal.res.rr.com. [172.248.200.249]) by smtp.gmail.com with ESMTPSA id ke7sm22322404pad.44.2016.04.11.11.57.53 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Mon, 11 Apr 2016 11:57:53 -0700 (PDT) From: Bartosz Golaszewski To: Wolfram Sang , linux-i2c , LKML , srinivas.kandagatla@linaro.org, maxime.ripard@free-electrons.com Cc: Andrew Lunn , Bartosz Golaszewski Subject: [RESEND PATCH v2 05/13] eeprom: at24: replace msleep() with usleep_range() Date: Mon, 11 Apr 2016 11:57:21 -0700 Message-Id: <1460401049-25459-6-git-send-email-bgolaszewski@baylibre.com> X-Mailer: git-send-email 2.1.4 In-Reply-To: <1460401049-25459-1-git-send-email-bgolaszewski@baylibre.com> References: <1460401049-25459-1-git-send-email-bgolaszewski@baylibre.com> Sender: linux-i2c-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-i2c@vger.kernel.org We cannot expect msleep(1) to actually sleep for a period shorter than 20 ms. Replace all calls to msleep() with usleep_range(). Signed-off-by: Bartosz Golaszewski --- drivers/misc/eeprom/at24.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) -- 2.7.4 -- To unsubscribe from this list: send the line "unsubscribe linux-i2c" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html diff --git a/drivers/misc/eeprom/at24.c b/drivers/misc/eeprom/at24.c index 9e01428..bc5be1e 100644 --- a/drivers/misc/eeprom/at24.c +++ b/drivers/misc/eeprom/at24.c @@ -240,8 +240,7 @@ static ssize_t at24_eeprom_read(struct at24_data *at24, char *buf, if (status == count) return count; - /* REVISIT: at HZ=100, this is sloooow */ - msleep(1); + usleep_range(1000, 1500); } while (time_before(read_time, timeout)); return -ETIMEDOUT; @@ -355,8 +354,7 @@ static ssize_t at24_eeprom_write(struct at24_data *at24, const char *buf, if (status == count) return count; - /* REVISIT: at HZ=100, this is sloooow */ - msleep(1); + usleep_range(1000, 1500); } while (time_before(write_time, timeout)); return -ETIMEDOUT;