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]
Message-ID: <b960ee7b-9378-0ac8-9e8c-c0701ca85d4d@broadcom.com>
Date:   Mon, 20 Jul 2020 09:12:11 -0700
From:   Ray Jui <ray.jui@...adcom.com>
To:     Michael Turquette <mturquette@...libre.com>,
        Stephen Boyd <sboyd@...nel.org>
Cc:     linux-clk@...r.kernel.org, linux-kernel@...r.kernel.org,
        bcm-kernel-feedback-list@...adcom.com,
        Lori Hikichi <lhikichi@...adcom.com>
Subject: Re: [PATCH] clk: iproc: round clock rate to the closest

Hi Stephen/Michael,

Could you please help to review this patch?

Thanks,

Ray

On 6/12/2020 3:52 PM, Ray Jui wrote:
> From: Lori Hikichi <lhikichi@...adcom.com>
> 
> Change from 'DIV_ROUND_UP' to 'DIV_ROUND_CLOSEST' when calculating the
> clock divisor in the iProc ASIU clock driver to allow to get to the
> closest clock rate.
> 
> Fixes: 5fe225c105fd ("clk: iproc: add initial common clock support")
> Signed-off-by: Lori Hikichi <lhikichi@...adcom.com>
> Signed-off-by: Ray Jui <ray.jui@...adcom.com>
> ---
>  drivers/clk/bcm/clk-iproc-asiu.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/clk/bcm/clk-iproc-asiu.c b/drivers/clk/bcm/clk-iproc-asiu.c
> index 6fb8af506777..e062dd4992ea 100644
> --- a/drivers/clk/bcm/clk-iproc-asiu.c
> +++ b/drivers/clk/bcm/clk-iproc-asiu.c
> @@ -119,7 +119,7 @@ static long iproc_asiu_clk_round_rate(struct clk_hw *hw, unsigned long rate,
>  	if (rate == *parent_rate)
>  		return *parent_rate;
>  
> -	div = DIV_ROUND_UP(*parent_rate, rate);
> +	div = DIV_ROUND_CLOSEST(*parent_rate, rate);
>  	if (div < 2)
>  		return *parent_rate;
>  
> @@ -145,7 +145,7 @@ static int iproc_asiu_clk_set_rate(struct clk_hw *hw, unsigned long rate,
>  		return 0;
>  	}
>  
> -	div = DIV_ROUND_UP(parent_rate, rate);
> +	div = DIV_ROUND_CLOSEST(parent_rate, rate);
>  	if (div < 2)
>  		return -EINVAL;
>  
> 

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ