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: <153270946725.48062.11195853363758024681@swboyd.mtv.corp.google.com>
Date:   Fri, 27 Jul 2018 09:37:47 -0700
From:   Stephen Boyd <sboyd@...nel.org>
To:     Amit Daniel Kachhap <amit.kachhap@....com>,
        linux-arm-kernel@...ts.infradead.org
Cc:     Sudeep Holla <sudeep.holla@....com>,
        Michael Turquette <mturquette@...libre.com>,
        linux-clk@...r.kernel.org, linux-kernel@...r.kernel.org,
        Amit Daniel Kachhap <amit.kachhap@....com>
Subject: Re: [PATCH] clk: scmi: Fix the rounding of clock rate

Quoting Amit Daniel Kachhap (2018-07-27 07:01:52)
> This fix rounds the clock rate properly by using quotient and not
> remainder in the calculation. This issue was found while testing HDMI
> in the Juno platform.
> 
> Signed-off-by: Amit Daniel Kachhap <amit.kachhap@....com>

Any Fixes: tag here?

> ---
>  drivers/clk/clk-scmi.c | 5 ++---
>  1 file changed, 2 insertions(+), 3 deletions(-)
> 
> diff --git a/drivers/clk/clk-scmi.c b/drivers/clk/clk-scmi.c
> index bb2a6f2..a985bf5 100644
> --- a/drivers/clk/clk-scmi.c
> +++ b/drivers/clk/clk-scmi.c
> @@ -60,9 +59,9 @@ static long scmi_clk_round_rate(struct clk_hw *hw, unsigned long rate,
>  
>         ftmp = rate - fmin;
>         ftmp += clk->info->range.step_size - 1; /* to round up */
> -       step = do_div(ftmp, clk->info->range.step_size);
> +       do_div(ftmp, clk->info->range.step_size);
>  
> -       return step * clk->info->range.step_size + fmin;
> +       return ftmp * clk->info->range.step_size + fmin;

Good catch.

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ