public inbox for linux-clk@vger.kernel.org
 help / color / mirror / Atom feed
From: Boris Brezillon <boris.brezillon@free-electrons.com>
To: Alexandre Belloni <alexandre.belloni@free-electrons.com>
Cc: Nicolas Ferre <nicolas.ferre@atmel.com>,
	Jean-Christophe Plagniol-Villard <plagnioj@jcrosoft.com>,
	linux-arm-kernel@lists.infradead.org,
	linux-kernel@vger.kernel.org,
	Cyrille Pitchen <cyrille.pitchen@atmel.com>,
	Stephen Boyd <sboyd@codeaurora.org>,
	linux-clk@vger.kernel.org
Subject: Re: [PATCH 01/48] clk: at91: replace usleep() by udelay() calls
Date: Sat, 11 Jun 2016 09:49:48 +0200	[thread overview]
Message-ID: <20160611094948.07c5487b@bbrezillon> (raw)
In-Reply-To: <1465596231-21766-2-git-send-email-alexandre.belloni@free-electrons.com>

On Sat, 11 Jun 2016 00:03:04 +0200
Alexandre Belloni <alexandre.belloni@free-electrons.com> wrote:

> From: Cyrille Pitchen <cyrille.pitchen@atmel.com>
> 
> Fix the main and slow clock .prepare() implementations which used to call
> usleep() when the scheduler wasn't ready yet.
> 
> Cc: Stephen Boyd <sboyd@codeaurora.org>
> Cc: linux-clk@vger.kernel.org
> Signed-off-by: Cyrille Pitchen <cyrille.pitchen@atmel.com>
> Signed-off-by: Alexandre Belloni <alexandre.belloni@free-electrons.com>
> ---
>  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);

If you're using udelay() you should probably move the code in
->prepare() into ->enable(). The same goes for the following changes.

>  
>  	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;
>  }



-- 
Boris Brezillon, Free Electrons
Embedded Linux and Kernel engineering
http://free-electrons.com

      parent reply	other threads:[~2016-06-11  7:49 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-06-10 22:03 [PATCH 00/48] ARM: at91: rework Atmel TCB drivers Alexandre Belloni
2016-06-10 22:03 ` [PATCH 01/48] clk: at91: replace usleep() by udelay() calls Alexandre Belloni
2016-06-10 22:30   ` Arnd Bergmann
2016-06-10 22:37     ` Alexandre Belloni
2016-06-13 15:24     ` Alexandre Belloni
2016-06-13 19:26       ` Arnd Bergmann
2016-06-14 16:05       ` Afzal Mohammed
2016-06-14 16:18         ` Boris Brezillon
2016-06-11  7:49   ` Boris Brezillon [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20160611094948.07c5487b@bbrezillon \
    --to=boris.brezillon@free-electrons.com \
    --cc=alexandre.belloni@free-electrons.com \
    --cc=cyrille.pitchen@atmel.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-clk@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=nicolas.ferre@atmel.com \
    --cc=plagnioj@jcrosoft.com \
    --cc=sboyd@codeaurora.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox