From patchwork Mon Dec 7 11:50:22 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Lee Jones X-Patchwork-Id: 57775 Delivered-To: patch@linaro.org Received: by 10.202.179.86 with SMTP id c83csp945070oif; Mon, 7 Dec 2015 03:53:00 -0800 (PST) X-Received: by 10.98.14.155 with SMTP id 27mr42617782pfo.92.1449489180892; Mon, 07 Dec 2015 03:53:00 -0800 (PST) Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id q196si1188924pfq.192.2015.12.07.03.53.00; Mon, 07 Dec 2015 03:53:00 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dkim=neutral (body hash did not verify) header.i=@linaro-org.20150623.gappssmtp.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932165AbbLGLuy (ORCPT + 28 others); Mon, 7 Dec 2015 06:50:54 -0500 Received: from mail-wm0-f48.google.com ([74.125.82.48]:33474 "EHLO mail-wm0-f48.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932119AbbLGLut (ORCPT ); Mon, 7 Dec 2015 06:50:49 -0500 Received: by wmec201 with SMTP id c201so161529152wme.0 for ; Mon, 07 Dec 2015 03:50:48 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro-org.20150623.gappssmtp.com; s=20150623; h=from:to:subject:date:message-id:in-reply-to:references; bh=HfRjl9YY3ZyPiw/BVkh/w23EhP7j/8lin09nJuoxvtA=; b=I5OmChMPAkmErevkhw8VFz0lgo2s6dSHdmZIw01N7pgMR0Ux4yqcexLpe5Xt/JKyLG dLzMvFX5mnPp6S/fLXkFqwWBA7zOVvZ41HNOd+SXjhO+4N98JEnrJ0FOYk4QWnkEpeDb Vvuud0O3lOGRcrtKtivQz0G2c/oXBMECTXsZypRIFxQyjw9eVqAfD+Pv7/XXVChNHjoq LKbPswjt3bJDAVbb9K3ZryTcp9D1DNl75bjKNB39mAAkxA7uyeNCMIsldLOOcZr1UNUB /+3tfxGs6Dgzbq3R2NbDxrAvoM+rx2hz/mUBeUT8RoL06AWqUeCKoaUTeW0vCKQkrASm UcMg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:subject:date:message-id:in-reply-to :references; bh=HfRjl9YY3ZyPiw/BVkh/w23EhP7j/8lin09nJuoxvtA=; b=VM9nh8pp2qasJV3NyKhJyLpaF3BgdUhi2ICIFZSsNpOytjjuqr0ERqQTCSSh8DEG/E 7tNqeBKxOrYxBkiLDpDrRIQzF4rD264UL6d4wcRgRQx1XkD5QJCSV/GmA/HynZe6LhdV CDRoY4YYKg7iba/ElqUWuILBRto/wm2AWguApXMMJzdiqEYcb8MKyBEy73+HBHGuAEo5 xKsATvo1aJu7syyoJSisnr0je7ZE6zca+/ck9OaujW+6XXD24PnpQhg07iKDgzCP++pc 5x5C4FSaJnOKAPu6IPmorEtcjD3vqloFiOKoYsLek2YRqjly0hpOTFemCKJf5/pLDGfC 7CDA== X-Gm-Message-State: ALoCoQk4QoqTx9OJMfy5Zyqtztj02GxhUUCSEfMpRHQ+DH74RE8QLRzzNifvE2xWWHLJQPm4+HeJ X-Received: by 10.194.220.233 with SMTP id pz9mr36291522wjc.95.1449489048768; Mon, 07 Dec 2015 03:50:48 -0800 (PST) Received: from localhost.localdomain (host81-129-174-134.range81-129.btcentralplus.com. [81.129.174.134]) by smtp.gmail.com with ESMTPSA id z1sm24806533wje.35.2015.12.07.03.50.48 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Mon, 07 Dec 2015 03:50:48 -0800 (PST) From: Lee Jones To: linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Subject: [PATCH 09/19] mfd: arizona-core: msleep() is unreliable for anything <20ms use usleep_range() instead Date: Mon, 7 Dec 2015 11:50:22 +0000 Message-Id: <1449489032-14374-10-git-send-email-lee.jones@linaro.org> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1449489032-14374-1-git-send-email-lee.jones@linaro.org> References: <1449489032-14374-1-git-send-email-lee.jones@linaro.org> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org WARNING: msleep < 20ms can sleep for up to 20ms; see Documentation/timers/timers-howto.txt + msleep(1); WARNING: msleep < 20ms can sleep for up to 20ms; see Documentation/timers/timers-howto.txt + msleep(5); WARNING: msleep < 20ms can sleep for up to 20ms; see Documentation/timers/timers-howto.txt + msleep(1); WARNING: msleep < 20ms can sleep for up to 20ms; see Documentation/timers/timers-howto.txt + msleep(1); total: 0 errors, 4 warnings, 1407 lines checked Cc: patches@opensource.wolfsonmicro.com Signed-off-by: Lee Jones --- drivers/mfd/arizona-core.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) -- 1.9.1 -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/ diff --git a/drivers/mfd/arizona-core.c b/drivers/mfd/arizona-core.c index 44cfdbb..ceba17ca 100644 --- a/drivers/mfd/arizona-core.c +++ b/drivers/mfd/arizona-core.c @@ -239,7 +239,7 @@ static int arizona_poll_reg(struct arizona *arizona, if ((val & mask) == target) return 0; - msleep(1); + usleep_range(1000, 5000); } dev_err(arizona->dev, "Polling reg %u timed out: %x\n", reg, val); @@ -280,14 +280,14 @@ static void arizona_disable_reset(struct arizona *arizona) case WM5110: case WM8280: /* Meet requirements for minimum reset duration */ - msleep(5); + usleep_range(5000, 10000); break; default: break; } gpio_set_value_cansleep(arizona->pdata.reset, 1); - msleep(1); + usleep_range(1000, 5000); } } @@ -1045,7 +1045,7 @@ int arizona_dev_init(struct arizona *arizona) goto err_reset; } - msleep(1); + usleep_range(1000, 5000); } /* Ensure device startup is complete */