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] [day] [month] [year] [list]
Date:	Fri, 5 Jul 2013 09:51:14 +0900
From:	Kyungmin Park <kmpark@...radead.org>
To:	Konstantin Krivyakin <k.krivyakin@...sung.com>,
	"Rafael J. Wysocki" <rjw@...k.pl>, viresh.kumar@...aro.org,
	mingo@...hat.com, Peter Zijlstra <peterz@...radead.org>
Cc:	i.zhbanov@...sung.com, e.voevodin@...sung.com,
	linux-kernel@...r.kernel.org
Subject: Re: [PATCH RFC 3/3] Update current cpu power when cpu freq change for exynos.

+ cpufreq maintainers

On Fri, Jul 5, 2013 at 12:17 AM, Konstantin Krivyakin
<k.krivyakin@...sung.com> wrote:
> Signed-off-by: Konstantin Krivyakin <k.krivyakin@...sung.com>
> ---
>  drivers/cpufreq/exynos-cpufreq.c     |    2 ++
>  drivers/cpufreq/exynos-cpufreq.h     |    1 +
>  drivers/cpufreq/exynos4x12-cpufreq.c |   19 ++++++++++++++++++-
>  3 files changed, 21 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/cpufreq/exynos-cpufreq.c b/drivers/cpufreq/exynos-cpufreq.c
> index 0d32f02..02f17bc 100644
> --- a/drivers/cpufreq/exynos-cpufreq.c
> +++ b/drivers/cpufreq/exynos-cpufreq.c
> @@ -178,6 +178,8 @@ static int exynos_target(struct cpufreq_policy *policy,
>         }
>
>         new_freq = freq_table[index].frequency;
> +       if (exynos_info->power_table)
> +               policy->current_power = exynos_info->power_table[index];
>
>         ret = exynos_cpufreq_scale(new_freq);
>
> diff --git a/drivers/cpufreq/exynos-cpufreq.h b/drivers/cpufreq/exynos-cpufreq.h
> index 92b852e..64f964f 100644
> --- a/drivers/cpufreq/exynos-cpufreq.h
> +++ b/drivers/cpufreq/exynos-cpufreq.h
> @@ -38,6 +38,7 @@ struct exynos_dvfs_info {
>         unsigned int    pll_safe_idx;
>         struct clk      *cpu_clk;
>         unsigned int    *volt_table;
> +       u64             *power_table;
>         struct cpufreq_frequency_table  *freq_table;
>         void (*set_freq)(unsigned int, unsigned int);
>         bool (*need_apll_change)(unsigned int, unsigned int);
> diff --git a/drivers/cpufreq/exynos4x12-cpufreq.c b/drivers/cpufreq/exynos4x12-cpufreq.c
> index 08b7477..8905f9b 100644
> --- a/drivers/cpufreq/exynos4x12-cpufreq.c
> +++ b/drivers/cpufreq/exynos4x12-cpufreq.c
> @@ -219,6 +219,7 @@ static void exynos4x12_set_frequency(unsigned int old_index,
>  int exynos4x12_cpufreq_init(struct exynos_dvfs_info *info)
>  {
>         unsigned long rate;
> +       int freq_count;
>
>         cpu_clk = clk_get(NULL, "armclk");
>         if (IS_ERR(cpu_clk))
> @@ -252,8 +253,24 @@ int exynos4x12_cpufreq_init(struct exynos_dvfs_info *info)
>         info->set_freq = exynos4x12_set_frequency;
>         info->need_apll_change = exynos4x12_pms_change;
>
> -       return 0;
> +       freq_count = sizeof(exynos4x12_freq_table) /
> +               sizeof(struct cpufreq_frequency_table);
> +       info->power_table = kzalloc(sizeof(u64) * freq_count, GFP_KERNEL);
> +       if (!info->power_table)
> +               goto err_power_table;
> +
> +       for (i = 0; i <= freq_count; ++i) {
> +               u64 freq = info->freq_table[i].frequency;
> +               u64 volt = info->volt_table[i];
>
> +               do_div(freq, 1000);
> +               do_div(volt, 1000);
> +               info->power_table[i] = freq * volt * volt;
> +       }
> +
> +       return 0;
> +err_power_table:
> +       clk_put(mout_appl);
>  err_mout_apll:
>         clk_put(mout_mpll);
>  err_mout_mpll:
> --
> 1.7.9.5
>
> --
> To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
> the body of a message to majordomo@...r.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
> Please read the FAQ at  http://www.tux.org/lkml/
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists