From patchwork Mon Jan 16 08:49:34 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dmitry Antipov X-Patchwork-Id: 6228 Return-Path: X-Original-To: patchwork@peony.canonical.com Delivered-To: patchwork@peony.canonical.com Received: from fiordland.canonical.com (fiordland.canonical.com [91.189.94.145]) by peony.canonical.com (Postfix) with ESMTP id C396F23E0C for ; Mon, 16 Jan 2012 08:48:45 +0000 (UTC) Received: from mail-bk0-f52.google.com (mail-bk0-f52.google.com [209.85.214.52]) by fiordland.canonical.com (Postfix) with ESMTP id AA773A183F4 for ; Mon, 16 Jan 2012 08:48:45 +0000 (UTC) Received: by bkbzt4 with SMTP id zt4so270710bkb.11 for ; Mon, 16 Jan 2012 00:48:45 -0800 (PST) Received: by 10.204.41.143 with SMTP id o15mr4466538bke.63.1326703725385; Mon, 16 Jan 2012 00:48:45 -0800 (PST) X-Forwarded-To: linaro-patchwork@canonical.com X-Forwarded-For: patch@linaro.org linaro-patchwork@canonical.com Delivered-To: patches@linaro.org Received: by 10.205.82.144 with SMTP id ac16cs85584bkc; Mon, 16 Jan 2012 00:48:45 -0800 (PST) Received: by 10.205.139.66 with SMTP id iv2mr4480564bkc.27.1326703723760; Mon, 16 Jan 2012 00:48:43 -0800 (PST) Received: from mail-bk0-f50.google.com (mail-bk0-f50.google.com [209.85.214.50]) by mx.google.com with ESMTPS id rg8si9673857bkb.70.2012.01.16.00.48.43 (version=TLSv1/SSLv3 cipher=OTHER); Mon, 16 Jan 2012 00:48:43 -0800 (PST) Received-SPF: neutral (google.com: 209.85.214.50 is neither permitted nor denied by best guess record for domain of dmitry.antipov@linaro.org) client-ip=209.85.214.50; Authentication-Results: mx.google.com; spf=neutral (google.com: 209.85.214.50 is neither permitted nor denied by best guess record for domain of dmitry.antipov@linaro.org) smtp.mail=dmitry.antipov@linaro.org Received: by bkcjk14 with SMTP id jk14so4786379bkc.37 for ; Mon, 16 Jan 2012 00:48:43 -0800 (PST) Received: by 10.204.157.25 with SMTP id z25mr4326671bkw.25.1326703723343; Mon, 16 Jan 2012 00:48:43 -0800 (PST) Received: from localhost.localdomain ([78.153.153.8]) by mx.google.com with ESMTPS id iu2sm38008584bkb.0.2012.01.16.00.48.42 (version=SSLv3 cipher=OTHER); Mon, 16 Jan 2012 00:48:42 -0800 (PST) From: Dmitry Antipov To: netdev@vger.kernel.org Cc: patches@linaro.org, Dmitry Antipov Subject: [PATCH] drivers/net/usb/smsc95xx.c: change msleep() to usleep_range() Date: Mon, 16 Jan 2012 12:49:34 +0400 Message-Id: <1326703774-1154-1-git-send-email-dmitry.antipov@linaro.org> X-Mailer: git-send-email 1.7.7.5 The resolution of msleep is related to HZ, so 10ms msleep() causes ~23ms sleep with OMAP's default CONFIG_HZ=128 timer configuration. This looks too much, and usleep_range() with some slack gives more control of what is happening here. Signed-off-by: Dmitry Antipov --- drivers/net/usb/smsc95xx.c | 6 +++--- 1 files changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/net/usb/smsc95xx.c b/drivers/net/usb/smsc95xx.c index d45520e..5d406d4 100644 --- a/drivers/net/usb/smsc95xx.c +++ b/drivers/net/usb/smsc95xx.c @@ -688,7 +688,7 @@ static int smsc95xx_phy_initialize(struct usbnet *dev) smsc95xx_mdio_write(dev->net, dev->mii.phy_id, MII_BMCR, BMCR_RESET); do { - msleep(10); + usleep_range(10000, 15000); bmcr = smsc95xx_mdio_read(dev->net, dev->mii.phy_id, MII_BMCR); timeout++; } while ((bmcr & BMCR_RESET) && (timeout < 100)); @@ -736,7 +736,7 @@ static int smsc95xx_reset(struct usbnet *dev) netdev_warn(dev->net, "Failed to read HW_CFG: %d\n", ret); return ret; } - msleep(10); + usleep_range(10000, 15000); timeout++; } while ((read_buf & HW_CFG_LRST_) && (timeout < 100)); @@ -759,7 +759,7 @@ static int smsc95xx_reset(struct usbnet *dev) netdev_warn(dev->net, "Failed to read PM_CTRL: %d\n", ret); return ret; } - msleep(10); + usleep_range(10000, 15000); timeout++; } while ((read_buf & PM_CTL_PHY_RST_) && (timeout < 100));