From patchwork Fri Jun 10 22:03:04 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alexandre Belloni X-Patchwork-Id: 9170651 X-Patchwork-Delegate: sboyd@codeaurora.org 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 4166E6048F for ; Fri, 10 Jun 2016 22:18:10 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 3371F28210 for ; Fri, 10 Jun 2016 22:18:10 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 2873E282F9; Fri, 10 Jun 2016 22:18:10 +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=-6.9 required=2.0 tests=BAYES_00,RCVD_IN_DNSWL_HI autolearn=unavailable version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id C6C9828210 for ; Fri, 10 Jun 2016 22:18:09 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752941AbcFJWEK (ORCPT ); Fri, 10 Jun 2016 18:04:10 -0400 Received: from down.free-electrons.com ([37.187.137.238]:44166 "EHLO mail.free-electrons.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1752113AbcFJWEJ (ORCPT ); Fri, 10 Jun 2016 18:04:09 -0400 Received: by mail.free-electrons.com (Postfix, from userid 110) id A28DF349; Sat, 11 Jun 2016 00:04:06 +0200 (CEST) Received: from localhost (unknown [88.191.26.124]) by mail.free-electrons.com (Postfix) with ESMTPSA id 6337F1BB; Sat, 11 Jun 2016 00:04:06 +0200 (CEST) From: Alexandre Belloni To: Nicolas Ferre Cc: Boris Brezillon , Jean-Christophe Plagniol-Villard , linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, Cyrille Pitchen , Stephen Boyd , linux-clk@vger.kernel.org, Alexandre Belloni Subject: [PATCH 01/48] clk: at91: replace usleep() by udelay() calls Date: Sat, 11 Jun 2016 00:03:04 +0200 Message-Id: <1465596231-21766-2-git-send-email-alexandre.belloni@free-electrons.com> X-Mailer: git-send-email 2.8.1 In-Reply-To: <1465596231-21766-1-git-send-email-alexandre.belloni@free-electrons.com> References: <1465596231-21766-1-git-send-email-alexandre.belloni@free-electrons.com> Sender: linux-clk-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-clk@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP From: Cyrille Pitchen Fix the main and slow clock .prepare() implementations which used to call usleep() when the scheduler wasn't ready yet. Cc: Stephen Boyd Cc: linux-clk@vger.kernel.org Signed-off-by: Cyrille Pitchen Signed-off-by: Alexandre Belloni --- drivers/clk/at91/clk-main.c | 2 +- drivers/clk/at91/clk-slow.c | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/drivers/clk/at91/clk-main.c b/drivers/clk/at91/clk-main.c index 58b5baca670c..12c5062aeb92 100644 --- a/drivers/clk/at91/clk-main.c +++ b/drivers/clk/at91/clk-main.c @@ -342,7 +342,7 @@ static int clk_main_probe_frequency(struct regmap *regmap) regmap_read(regmap, AT91_CKGR_MCFR, &mcfr); if (mcfr & AT91_PMC_MAINRDY) return 0; - usleep_range(MAINF_LOOP_MIN_WAIT, MAINF_LOOP_MAX_WAIT); + udelay(MAINF_LOOP_MIN_WAIT); } while (time_before(prep_time, timeout)); return -ETIMEDOUT; diff --git a/drivers/clk/at91/clk-slow.c b/drivers/clk/at91/clk-slow.c index 61090b1146cf..612e893ce994 100644 --- a/drivers/clk/at91/clk-slow.c +++ b/drivers/clk/at91/clk-slow.c @@ -76,7 +76,7 @@ static int clk_slow_osc_prepare(struct clk_hw *hw) writel(tmp | AT91_SCKC_OSC32EN, sckcr); - usleep_range(osc->startup_usec, osc->startup_usec + 1); + udelay(osc->startup_usec); return 0; } @@ -195,7 +195,7 @@ static int clk_slow_rc_osc_prepare(struct clk_hw *hw) writel(readl(sckcr) | AT91_SCKC_RCEN, sckcr); - usleep_range(osc->startup_usec, osc->startup_usec + 1); + udelay(osc->startup_usec); return 0; } @@ -304,7 +304,7 @@ static int clk_sam9x5_slow_set_parent(struct clk_hw *hw, u8 index) writel(tmp, sckcr); - usleep_range(SLOWCK_SW_TIME_USEC, SLOWCK_SW_TIME_USEC + 1); + udelay(SLOWCK_SW_TIME_USEC); return 0; }