From patchwork Thu Dec 1 14:37:40 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Linus Walleij X-Patchwork-Id: 128705 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from mail-ey0-f184.google.com (mail-ey0-f184.google.com [209.85.215.184]) (using TLSv1 with cipher RC4-SHA (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority" (verified OK)) by ozlabs.org (Postfix) with ESMTPS id D36221007D1 for ; Fri, 2 Dec 2011 01:38:08 +1100 (EST) Received: by eaaa14 with SMTP id a14sf2674381eaa.11 for ; Thu, 01 Dec 2011 06:38:04 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlegroups.com; s=beta; h=x-beenthere:received-spf:from:to:cc:subject:date:message-id :x-mailer:mime-version:x-original-sender :x-original-authentication-results:reply-to:precedence:mailing-list :list-id:x-google-group-id:list-post:list-help:list-archive:sender :list-subscribe:list-unsubscribe:content-type; bh=yRSCp0EBDM+sisSy86rmYI1wUPEtdwqHk6FrBGi9Wuk=; b=hIWWtMzFer1ogANswEgSkJgoZiHwAZ8H/1K0zSV+D4SPGplBhvAie43NGG9vxfIfKr CVdh6ZM+D8nlK9zeQ5LM06NXgQ8N5GlTK9lrLZrLrnorNLH99zM8NgAbxWAVulL7xn4o L9l1e7s1yW0j1M2iZN9egIF0GtIQcEnugjThw= Received: by 10.216.132.93 with SMTP id n71mr77841wei.52.1322750283140; Thu, 01 Dec 2011 06:38:03 -0800 (PST) X-BeenThere: rtc-linux@googlegroups.com Received: by 10.14.50.200 with SMTP id z48ls1039648eeb.1.canary; Thu, 01 Dec 2011 06:38:02 -0800 (PST) Received: by 10.14.17.137 with SMTP id j9mr574974eej.10.1322750282433; Thu, 01 Dec 2011 06:38:02 -0800 (PST) Received: by 10.14.17.137 with SMTP id j9mr574973eej.10.1322750282418; Thu, 01 Dec 2011 06:38:02 -0800 (PST) Received: from eu1sys200aog103.obsmtp.com (eu1sys200aog103.obsmtp.com. [207.126.144.115]) by gmr-mx.google.com with SMTP id n13si3592398eef.2.2011.12.01.06.37.55 (version=TLSv1/SSLv3 cipher=OTHER); Thu, 01 Dec 2011 06:38:02 -0800 (PST) Received-SPF: neutral (google.com: 207.126.144.115 is neither permitted nor denied by best guess record for domain of linus.walleij@stericsson.com) client-ip=207.126.144.115; Received: from beta.dmz-ap.st.com ([138.198.100.35]) (using TLSv1) by eu1sys200aob103.postini.com ([207.126.147.11]) with SMTP ID DSNKTteRQr7lAYIXq7wrU4Uma4FvnDNnBzVK@postini.com; Thu, 01 Dec 2011 14:38:02 UTC Received: from zeta.dmz-ap.st.com (ns6.st.com [138.198.234.13]) by beta.dmz-ap.st.com (STMicroelectronics) with ESMTP id 017E0FC; Thu, 1 Dec 2011 14:29:23 +0000 (GMT) Received: from relay1.stm.gmessaging.net (unknown [10.230.100.17]) by zeta.dmz-ap.st.com (STMicroelectronics) with ESMTP id 8E896D96; Thu, 1 Dec 2011 14:37:49 +0000 (GMT) Received: from exdcvycastm004.EQ1STM.local (alteon-source-exch [10.230.100.61]) (using TLSv1 with cipher RC4-MD5 (128/128 bits)) (Client CN "exdcvycastm004", Issuer "exdcvycastm004" (not verified)) by relay1.stm.gmessaging.net (Postfix) with ESMTPS id 7054624C2F0; Thu, 1 Dec 2011 15:37:41 +0100 (CET) Received: from localhost.localdomain (10.230.100.153) by smtp.stericsson.com (10.230.100.2) with Microsoft SMTP Server (TLS) id 8.3.83.0; Thu, 1 Dec 2011 15:37:48 +0100 From: Linus Walleij To: Andrew Morton Cc: Alessandro Zummo , , Linus Walleij , Jonas Aaberg Subject: [rtc-linux] [PATCH] rtc/ab8500: change to msleep to usleep_range Date: Thu, 1 Dec 2011 15:37:40 +0100 Message-ID: <1322750260-26157-1-git-send-email-linus.walleij@stericsson.com> X-Mailer: git-send-email 1.7.3.2 MIME-Version: 1.0 X-Original-Sender: linus.walleij@stericsson.com X-Original-Authentication-Results: gmr-mx.google.com; spf=neutral (google.com: 207.126.144.115 is neither permitted nor denied by best guess record for domain of linus.walleij@stericsson.com) smtp.mail=linus.walleij@stericsson.com Reply-To: rtc-linux@googlegroups.com Precedence: list Mailing-list: list rtc-linux@googlegroups.com; contact rtc-linux+owners@googlegroups.com List-ID: X-Google-Group-Id: 712029733259 List-Post: , List-Help: , List-Archive: Sender: rtc-linux@googlegroups.com List-Subscribe: , List-Unsubscribe: , From: Linus Walleij The resolution of msleep is related to HZ, so with HZ set to 100 any msleep of less than 10ms will become ~10ms. This is not what we want. Use usleep_range() and allow for some slack in the non-critical path so we have more control of what is happening here. Cc: Jonas Aaberg Signed-off-by: Linus Walleij --- This replaces the earlier patch titled "change msleep to mdelay". --- drivers/rtc/rtc-ab8500.c | 6 +++--- 1 files changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/rtc/rtc-ab8500.c b/drivers/rtc/rtc-ab8500.c index 82a3480..919b2e5 100644 --- a/drivers/rtc/rtc-ab8500.c +++ b/drivers/rtc/rtc-ab8500.c @@ -90,7 +90,7 @@ static int ab8500_rtc_read_time(struct device *dev, struct rtc_time *tm) /* Early AB8500 chips will not clear the rtc read request bit */ if (abx500_get_chip_id(dev) == 0) { - msleep(1); + usleep_range(1000, 1000); } else { /* Wait for some cycles after enabling the rtc read in ab8500 */ while (time_before(jiffies, timeout)) { @@ -102,7 +102,7 @@ static int ab8500_rtc_read_time(struct device *dev, struct rtc_time *tm) if (!(value & RTC_READ_REQUEST)) break; - msleep(1); + usleep_range(1000, 5000); } } @@ -295,7 +295,7 @@ static int __devinit ab8500_rtc_probe(struct platform_device *pdev) return err; /* Wait for reset by the PorRtc */ - msleep(1); + usleep_range(1000, 5000); err = abx500_get_register_interruptible(&pdev->dev, AB8500_RTC, AB8500_RTC_STAT_REG, &rtc_ctrl);