Re: [PATCH] MIPS/loongson2_cpufreq: fix CPU clock rate setting

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 3 April 2014 00:37, Aaro Koskinen <aaro.koskinen@xxxxxx> wrote:
> Loongson2 has been using (incorrectly) kHz for cpu_clk rate. This has
> been unnoticed, as loongson2_cpufreq was the only place where the rate
> was set/get. After commit 652ed95d5fa6074b3c4ea245deb0691f1acb6656
> (cpufreq: introduce cpufreq_generic_get() routine) things however broke,
> and now loops_per_jiffy adjustments are incorrect (1000 times too long).
> The patch fixes this by changing cpu_clk rate to Hz.
>
> Signed-off-by: Aaro Koskinen <aaro.koskinen@xxxxxx>
> Cc: stable@xxxxxxxxxxxxxxx
> ---
>  arch/mips/loongson/lemote-2f/clock.c | 7 +++++--
>  drivers/cpufreq/loongson2_cpufreq.c  | 4 ++--
>  2 files changed, 7 insertions(+), 4 deletions(-)
>
> diff --git a/arch/mips/loongson/lemote-2f/clock.c b/arch/mips/loongson/lemote-2f/clock.c
> index aed32b8..699f388 100644
> --- a/arch/mips/loongson/lemote-2f/clock.c
> +++ b/arch/mips/loongson/lemote-2f/clock.c
> @@ -91,6 +91,7 @@ EXPORT_SYMBOL(clk_put);
>
>  int clk_set_rate(struct clk *clk, unsigned long rate)
>  {
> +       unsigned int rate_khz;

Initialize rate_khz here only instead of doing it separately..

>         int ret = 0;
>         int regval;
>         int i;
> @@ -106,15 +107,17 @@ int clk_set_rate(struct clk *clk, unsigned long rate)
>         if (unlikely(clk->flags & CLK_RATE_PROPAGATES))
>                 propagate_rate(clk);
>
> +       rate_khz = rate / 1000;
> +


[Index of Archives]     [Linux MIPS Home]     [LKML Archive]     [Linux ARM Kernel]     [Linux ARM]     [Linux]     [Git]     [Yosemite News]     [Linux SCSI]     [Linux Hams]

  Powered by Linux