From patchwork Sun Dec 3 11:11:24 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Baruch Siach X-Patchwork-Id: 10089215 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 359936035E for ; Sun, 3 Dec 2017 11:19:59 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 1F50A2904D for ; Sun, 3 Dec 2017 11:19:59 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 128FF290DC; Sun, 3 Dec 2017 11:19:59 +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=-4.2 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,RCVD_IN_DNSWL_MED autolearn=ham version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [65.50.211.133]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id A322B2904D for ; Sun, 3 Dec 2017 11:19:58 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:MIME-Version:Cc:List-Subscribe: List-Help:List-Post:List-Archive:List-Unsubscribe:List-Id:References: In-Reply-To:Message-Id:Date:Subject:To:From:Reply-To:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Owner; bh=1ZOsfb+Sl13WpD+aUNhxEJzr62RAhZNvGunTtwwOI0E=; b=f1A233TTeGF3gcErhmPBIHnlfY Wbrc1vENDqhjT9a6LKbYYpIu8l7+JVpzCrvIAHva0m+al/MRc28XzCHsz2+HWs9gxbfmPr6TtFhcr GS2kof1qSPCvAFsXQRnAHB9zaoAblA6OuZ2Ocete+0YcJwLoodGoIXdmpVg7KtNTBww/iIpktf3FE K416yNPhrotkR2oz8g1NK8Xdh3NFWJnMrndnZlwHdQTBe9LV++fcdurRtuT/o7a78lDQOsRKO5XIN C6n2O+pU+4Z8vIAMN4KROok7JlYWXbhxZfLnCm+KNPqFTITu5deQGCSVOLSTHjeq3+NCo3DU9uloi BvTq/vtQ==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.87 #1 (Red Hat Linux)) id 1eLSJJ-0007W2-Im; Sun, 03 Dec 2017 11:19:49 +0000 Received: from guitar.tcltek.co.il ([192.115.133.116] helo=mx.tkos.co.il) by bombadil.infradead.org with esmtps (Exim 4.87 #1 (Red Hat Linux)) id 1eLSIj-0006j5-2T for linux-arm-kernel@lists.infradead.org; Sun, 03 Dec 2017 11:19:17 +0000 Received: from sapphire.lan (unknown [10.0.4.3]) by mx.tkos.co.il (Postfix) with ESMTPA id 89F364409C6; Sun, 3 Dec 2017 13:18:51 +0200 (IST) From: Baruch Siach To: Zhang Rui , Eduardo Valentin Subject: [PATCH v2 4/4] thermal: armada: use msleep for long delays Date: Sun, 3 Dec 2017 13:11:24 +0200 Message-Id: <0f09adfb9790009eb4ee4cdc62ce83307c0feede.1512299484.git.baruch@tkos.co.il> X-Mailer: git-send-email 2.15.0 In-Reply-To: References: X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20171203_031913_385611_852D4F70 X-CRM114-Status: UNSURE ( 7.41 ) X-CRM114-Notice: Please train this message. X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: devicetree@vger.kernel.org, Baruch Siach , Jason Cooper , Andrew Lunn , linux-pm@vger.kernel.org, Russell King , Miquel Raynal , Gregory Clement , linux-arm-kernel@lists.infradead.org, Sebastian Hesselbarth MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP Use msleep for long (> 10ms) delays, instead of the busy waiting mdelay. All delays are called from the probe routine, where scheduling is allowed. Signed-off-by: Baruch Siach --- v2: New patch --- drivers/thermal/armada_thermal.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/drivers/thermal/armada_thermal.c b/drivers/thermal/armada_thermal.c index 59b75f63945d..d86538d4f519 100644 --- a/drivers/thermal/armada_thermal.c +++ b/drivers/thermal/armada_thermal.c @@ -119,7 +119,7 @@ static void armada370_init_sensor(struct platform_device *pdev, reg &= ~PMU_TDC0_START_CAL_MASK; writel(reg, priv->control); - mdelay(10); + msleep(10); } static void armada375_init_sensor(struct platform_device *pdev, @@ -133,11 +133,11 @@ static void armada375_init_sensor(struct platform_device *pdev, reg &= ~A375_HW_RESETn; writel(reg, priv->control + 4); - mdelay(20); + msleep(20); reg |= A375_HW_RESETn; writel(reg, priv->control + 4); - mdelay(50); + msleep(50); } static void armada380_init_sensor(struct platform_device *pdev, @@ -151,7 +151,7 @@ static void armada380_init_sensor(struct platform_device *pdev, if (!(reg & A380_HW_RESET)) { reg |= A380_HW_RESET; writel(reg, control_msb); - mdelay(10); + msleep(10); } }