lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:	Sat, 11 Jun 2016 09:49:48 +0200
From:	Boris Brezillon <boris.brezillon@...e-electrons.com>
To:	Alexandre Belloni <alexandre.belloni@...e-electrons.com>
Cc:	Nicolas Ferre <nicolas.ferre@...el.com>,
	Jean-Christophe Plagniol-Villard <plagnioj@...osoft.com>,
	linux-arm-kernel@...ts.infradead.org, linux-kernel@...r.kernel.org,
	Cyrille Pitchen <cyrille.pitchen@...el.com>,
	Stephen Boyd <sboyd@...eaurora.org>, linux-clk@...r.kernel.org
Subject: Re: [PATCH 01/48] clk: at91: replace usleep() by udelay() calls

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

> From: Cyrille Pitchen <cyrille.pitchen@...el.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@...eaurora.org>
> Cc: linux-clk@...r.kernel.org
> Signed-off-by: Cyrille Pitchen <cyrille.pitchen@...el.com>
> Signed-off-by: Alexandre Belloni <alexandre.belloni@...e-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

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ