All of lore.kernel.org
 help / color / mirror / Atom feed
From: amit daniel kachhap <amit.daniel@samsung.com>
To: Viresh Kumar <viresh.kumar@linaro.org>
Cc: "Rafael J. Wysocki" <rjw@sisk.pl>,
	linaro-kernel@lists.linaro.org,
	"patches@linaro.org" <patches@linaro.org>,
	cpufreq@vger.kernel.org,
	"linux-pm@vger.kernel.org" <linux-pm@vger.kernel.org>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	LAK <linux-arm-kernel@lists.infradead.org>,
	Andrew Lunn <andrew@lunn.ch>,
	"David S. Miller" <davem@davemloft.net>,
	Dmitry Eremin-Solenikov <dbaryshkov@gmail.com>,
	Eric Miao <eric.y.miao@gmail.com>,
	Hans-Christian Egtvedt <egtvedt@samfundet.no>,
	Jesper Nilsson <jesper.nilsson@axis.com>,
	John Crispin <blogic@openwrt.org>,
	Kukjin Kim <kgene.kim@samsung.com>,
	Linus Walleij <linus.walleij@linaro.org>,
	linux-cris-kernel@axis.com, Mikael Starvik <starvik@axis.com>,
	Santosh Shilimkar <santosh.shilimkar@ti.com>,
	Sekhar Nori <nsekhar@ti.com>, Shawn Guo <shawn.guo@linaro.org>,
	sparclinux@vger.kernel.org, Stephen Warren <swarren@nvidia.com>,
	Steven Miao <realmz6@gmail.com>, Tony Luck <tony.luck@intel.com>
Subject: Re: [PATCH V2 01/35] cpufreq: Implement light weight ->target_index() routine
Date: Sun, 18 Aug 2013 16:11:59 +0530	[thread overview]
Message-ID: <CADGdYn4=si46x7b5Qa0EJ1vUDKrP3maXBqWwQ6s7gkep-8MxFg@mail.gmail.com> (raw)
In-Reply-To: <eb988fc9e72b90b7ba99f16405f5dcb072da7840.1376392602.git.viresh.kumar@linaro.org>

Hi Viresh,

On Tue, Aug 13, 2013 at 7:02 PM, Viresh Kumar <viresh.kumar@linaro.org> wrote:
> Currently prototype of cpufreq_drivers target routines is:
>
> int target(struct cpufreq_policy *policy, unsigned int target_freq,
>                 unsigned int relation);
>
> And most of the drivers call cpufreq_frequency_table_target() to get a valid
> index of their frequency table which is closest to the target_freq. And they
> don't use target_freq and relation after it.
>
> So, it makes sense to just do this work in cpufreq core before calling
> cpufreq_frequency_table_target() and simply pass index instead. But this can be
> done only with drivers which expose their frequency table with cpufreq core. For
> others we need to stick with the old prototype of target() until those drivers
> are converted to expose frequency tables.
>
> This patch implements the new light weight prototype for target_index() routine.
> It looks like this:
>
> int target_index(struct cpufreq_policy *policy, unsigned int index);
This new API is fine but I have another idea.
Say During the registration of the frequency table cpufreq_policy can
be registered as SCALE_DIRECT or SCALE_STEPS. With SCALE_DIRECT flag,
valid frequency will be requested. With this flags the governor itself
can  can figure out if frequency scaling is required or not and very
few calls to __cpufreq_driver_target will happen.
But i agree that in this approach cpufreq_frequency_table_target is
still required but again it can be optimized by binary search as
currently the search is linear.

Thanks,
Amit
>
> CPUFreq core will call cpufreq_frequency_table_target() before calling this
> routine and pass index to it. Because CPUFreq core now requires to call routines
> present in freq_table.c CONFIG_CPU_FREQ_TABLE must be enabled all the time.
>
> This also marks target() interface as deprecated. So, that new drivers avoid
> using it. And
>
> Documentation is updated accordingly.
>
> Cc: Andrew Lunn <andrew@lunn.ch>
> Cc: David S. Miller <davem@davemloft.net>
> Cc: Dmitry Eremin-Solenikov <dbaryshkov@gmail.com>
> Cc: Eric Miao <eric.y.miao@gmail.com>
> Cc: Hans-Christian Egtvedt <egtvedt@samfundet.no>
> Cc: Jesper Nilsson <jesper.nilsson@axis.com>
> Cc: John Crispin <blogic@openwrt.org>
> Cc: Kukjin Kim <kgene.kim@samsung.com>
> Cc: Linus Walleij <linus.walleij@linaro.org>
> Cc: linux-cris-kernel@axis.com
> Cc: Mikael Starvik <starvik@axis.com>
> Cc: Santosh Shilimkar <santosh.shilimkar@ti.com>
> Cc: Sekhar Nori <nsekhar@ti.com>
> Cc: Shawn Guo <shawn.guo@linaro.org>
> Cc: sparclinux@vger.kernel.org
> Cc: Stephen Warren <swarren@nvidia.com>
> Cc: Steven Miao <realmz6@gmail.com>
> Cc: Tony Luck <tony.luck@intel.com>
> Signed-off-by: Viresh Kumar <viresh.kumar@linaro.org>
> ---
>  Documentation/cpu-freq/cpu-drivers.txt | 27 +++++++++++------
>  Documentation/cpu-freq/governors.txt   |  4 +--
>  drivers/cpufreq/Kconfig                |  1 +
>  drivers/cpufreq/cpufreq.c              | 55 +++++++++++++++++++++++++++-------
>  include/linux/cpufreq.h                |  4 ++-
>  5 files changed, 68 insertions(+), 23 deletions(-)
>
> diff --git a/Documentation/cpu-freq/cpu-drivers.txt b/Documentation/cpu-freq/cpu-drivers.txt
> index 40282e6..8b1a445 100644
> --- a/Documentation/cpu-freq/cpu-drivers.txt
> +++ b/Documentation/cpu-freq/cpu-drivers.txt
> @@ -23,8 +23,8 @@ Contents:
>  1.1  Initialization
>  1.2  Per-CPU Initialization
>  1.3  verify
> -1.4  target or setpolicy?
> -1.5  target
> +1.4  target/target_index or setpolicy?
> +1.5  target/target_index
>  1.6  setpolicy
>  2.   Frequency Table Helpers
>
> @@ -56,7 +56,8 @@ cpufreq_driver.init -         A pointer to the per-CPU initialization
>  cpufreq_driver.verify -                A pointer to a "verification" function.
>
>  cpufreq_driver.setpolicy _or_
> -cpufreq_driver.target -                See below on the differences.
> +cpufreq_driver.target/
> +target_index           -       See below on the differences.
>
>  And optionally
>
> @@ -66,7 +67,7 @@ cpufreq_driver.resume -               A pointer to a per-CPU resume function
>                                 which is called with interrupts disabled
>                                 and _before_ the pre-suspend frequency
>                                 and/or policy is restored by a call to
> -                               ->target or ->setpolicy.
> +                               ->target/target_index or ->setpolicy.
>
>  cpufreq_driver.attr -          A pointer to a NULL-terminated list of
>                                 "struct freq_attr" which allow to
> @@ -103,8 +104,8 @@ policy->governor            must contain the "default policy" for
>                                 this CPU. A few moments later,
>                                 cpufreq_driver.verify and either
>                                 cpufreq_driver.setpolicy or
> -                               cpufreq_driver.target is called with
> -                               these values.
> +                               cpufreq_driver.target/target_index is called
> +                               with these values.
>
>  For setting some of these values (cpuinfo.min[max]_freq, policy->min[max]), the
>  frequency table helpers might be helpful. See the section 2 for more information
> @@ -133,20 +134,28 @@ range) is within policy->min and policy->max. If necessary, increase
>  policy->max first, and only if this is no solution, decrease policy->min.
>
>
> -1.4 target or setpolicy?
> +1.4 target/target_index or setpolicy?
>  ----------------------------
>
>  Most cpufreq drivers or even most cpu frequency scaling algorithms
>  only allow the CPU to be set to one frequency. For these, you use the
> -->target call.
> +->target/target_index call.
>
>  Some cpufreq-capable processors switch the frequency between certain
>  limits on their own. These shall use the ->setpolicy call
>
>
> -1.4. target
> +1.4. target/target_index
>  -------------
>
> +The target_index call has two arguments: struct cpufreq_policy *policy,
> +and unsigned int index (into the exposed frequency table).
> +
> +The CPUfreq driver must set the new frequency when called here. The
> +actual frequency must be determined by freq_table[index].frequency.
> +
> +Deprecated:
> +----------
>  The target call has three arguments: struct cpufreq_policy *policy,
>  unsigned int target_frequency, unsigned int relation.
>
> diff --git a/Documentation/cpu-freq/governors.txt b/Documentation/cpu-freq/governors.txt
> index 219970b..77ec215 100644
> --- a/Documentation/cpu-freq/governors.txt
> +++ b/Documentation/cpu-freq/governors.txt
> @@ -40,7 +40,7 @@ Most cpufreq drivers (in fact, all except one, longrun) or even most
>  cpu frequency scaling algorithms only offer the CPU to be set to one
>  frequency. In order to offer dynamic frequency scaling, the cpufreq
>  core must be able to tell these drivers of a "target frequency". So
> -these specific drivers will be transformed to offer a "->target"
> +these specific drivers will be transformed to offer a "->target/target_index"
>  call instead of the existing "->setpolicy" call. For "longrun", all
>  stays the same, though.
>
> @@ -71,7 +71,7 @@ CPU can be set to switch independently         |         CPU can only be set
>                     /                          the limits of policy->{min,max}
>                    /                                \
>                   /                                  \
> -       Using the ->setpolicy call,              Using the ->target call,
> +       Using the ->setpolicy call,              Using the ->target/target_index call,
>             the limits and the                    the frequency closest
>              "policy" is set.                     to target_freq is set.
>                                                   It is assured that it
> diff --git a/drivers/cpufreq/Kconfig b/drivers/cpufreq/Kconfig
> index 534fcb8..2d06754 100644
> --- a/drivers/cpufreq/Kconfig
> +++ b/drivers/cpufreq/Kconfig
> @@ -2,6 +2,7 @@ menu "CPU Frequency scaling"
>
>  config CPU_FREQ
>         bool "CPU Frequency scaling"
> +       select CPU_FREQ_TABLE
>         help
>           CPU Frequency scaling allows you to change the clock speed of
>           CPUs on the fly. This is a nice method to save power, because
> diff --git a/drivers/cpufreq/cpufreq.c b/drivers/cpufreq/cpufreq.c
> index 37a6874..f1b0e0f 100644
> --- a/drivers/cpufreq/cpufreq.c
> +++ b/drivers/cpufreq/cpufreq.c
> @@ -47,6 +47,11 @@ static LIST_HEAD(cpufreq_policy_list);
>  static DEFINE_PER_CPU(char[CPUFREQ_NAME_LEN], cpufreq_cpu_governor);
>  #endif
>
> +static inline bool has_target(void)
> +{
> +       return cpufreq_driver->target_index || cpufreq_driver->target;
> +}
> +
>  /*
>   * cpu_policy_rwsem is a per CPU reader-writer semaphore designed to cure
>   * all cpufreq/hotplug/workqueue/etc related lock issues.
> @@ -377,7 +382,7 @@ static int cpufreq_parse_governor(char *str_governor, unsigned int *policy,
>                         *policy = CPUFREQ_POLICY_POWERSAVE;
>                         err = 0;
>                 }
> -       } else if (cpufreq_driver->target) {
> +       } else if (has_target()) {
>                 struct cpufreq_governor *t;
>
>                 mutex_lock(&cpufreq_governor_mutex);
> @@ -539,7 +544,7 @@ static ssize_t show_scaling_available_governors(struct cpufreq_policy *policy,
>         ssize_t i = 0;
>         struct cpufreq_governor *t;
>
> -       if (!cpufreq_driver->target) {
> +       if (!has_target()) {
>                 i += sprintf(buf, "performance powersave");
>                 goto out;
>         }
> @@ -822,7 +827,7 @@ static int cpufreq_add_dev_interface(struct cpufreq_policy *policy,
>                 if (ret)
>                         goto err_out_kobj_put;
>         }
> -       if (cpufreq_driver->target) {
> +       if (has_target()) {
>                 ret = sysfs_create_file(&policy->kobj, &scaling_cur_freq.attr);
>                 if (ret)
>                         goto err_out_kobj_put;
> @@ -871,10 +876,10 @@ static int cpufreq_add_policy_cpu(struct cpufreq_policy *policy,
>                                   unsigned int cpu, struct device *dev,
>                                   bool frozen)
>  {
> -       int ret = 0, has_target = !!cpufreq_driver->target;
> +       int ret = 0;
>         unsigned long flags;
>
> -       if (has_target) {
> +       if (has_target()) {
>                 ret = __cpufreq_governor(policy, CPUFREQ_GOV_STOP);
>                 if (ret) {
>                         pr_err("%s: Failed to stop governor\n", __func__);
> @@ -893,7 +898,7 @@ static int cpufreq_add_policy_cpu(struct cpufreq_policy *policy,
>
>         unlock_policy_rwsem_write(policy->cpu);
>
> -       if (has_target) {
> +       if (has_target()) {
>                 if ((ret = __cpufreq_governor(policy, CPUFREQ_GOV_START)) ||
>                         (ret = __cpufreq_governor(policy, CPUFREQ_GOV_LIMITS))) {
>                         pr_err("%s: Failed to start governor\n", __func__);
> @@ -1204,7 +1209,7 @@ static int __cpufreq_remove_dev(struct device *dev,
>                 return -EINVAL;
>         }
>
> -       if (cpufreq_driver->target) {
> +       if (has_target()) {
>                 ret = __cpufreq_governor(policy, CPUFREQ_GOV_STOP);
>                 if (ret) {
>                         pr_err("%s: Failed to stop governor\n", __func__);
> @@ -1244,7 +1249,7 @@ static int __cpufreq_remove_dev(struct device *dev,
>
>         /* If cpu is last user of policy, free policy */
>         if (cpus == 1) {
> -               if (cpufreq_driver->target) {
> +               if (has_target()) {
>                         ret = __cpufreq_governor(policy,
>                                         CPUFREQ_GOV_POLICY_EXIT);
>                         if (ret) {
> @@ -1282,7 +1287,7 @@ static int __cpufreq_remove_dev(struct device *dev,
>                 if (!frozen)
>                         cpufreq_policy_free(policy);
>         } else {
> -               if (cpufreq_driver->target) {
> +               if (has_target()) {
>                         if ((ret = __cpufreq_governor(policy, CPUFREQ_GOV_START)) ||
>                                         (ret = __cpufreq_governor(policy, CPUFREQ_GOV_LIMITS))) {
>                                 pr_err("%s: Failed to start governor\n",
> @@ -1646,11 +1651,39 @@ int __cpufreq_driver_target(struct cpufreq_policy *policy,
>         pr_debug("target for CPU %u: %u kHz, relation %u, requested %u kHz\n",
>                         policy->cpu, target_freq, relation, old_target_freq);
>
> +       /*
> +        * This might look like a redundant call as we are checking it again
> +        * after finding index. But it is left intentionally for cases where
> +        * exactly same freq is called again and so we can save on few function
> +        * calls.
> +        */
>         if (target_freq == policy->cur)
>                 return 0;
>
>         if (cpufreq_driver->target)
>                 retval = cpufreq_driver->target(policy, target_freq, relation);
> +       else if (cpufreq_driver->target_index) {
> +               struct cpufreq_frequency_table *freq_table;
> +               int index;
> +
> +               freq_table = cpufreq_frequency_get_table(policy->cpu);
> +               if (unlikely(!freq_table)) {
> +                       pr_err("%s: Unable to find freq_table\n", __func__);
> +                       return retval;
> +               }
> +
> +               retval = cpufreq_frequency_table_target(policy, freq_table,
> +                               target_freq, relation, &index);
> +               if (unlikely(retval)) {
> +                       pr_err("%s: Unable to find matching freq\n", __func__);
> +                       return retval;
> +               }
> +
> +               if (freq_table[index].frequency == policy->cur)
> +                       return 0;
> +
> +               retval = cpufreq_driver->target_index(policy, index);
> +       }
>
>         return retval;
>  }
> @@ -1983,7 +2016,7 @@ int cpufreq_update_policy(unsigned int cpu)
>                         pr_debug("Driver did not initialize current freq");
>                         policy->cur = new_policy.cur;
>                 } else {
> -                       if (policy->cur != new_policy.cur && cpufreq_driver->target)
> +                       if (policy->cur != new_policy.cur && has_target())
>                                 cpufreq_out_of_sync(cpu, policy->cur,
>                                                                 new_policy.cur);
>                 }
> @@ -2058,7 +2091,7 @@ int cpufreq_register_driver(struct cpufreq_driver *driver_data)
>                 return -ENODEV;
>
>         if (!driver_data || !driver_data->verify || !driver_data->init ||
> -           ((!driver_data->setpolicy) && (!driver_data->target)))
> +           (!driver_data->setpolicy && !has_target()))
>                 return -EINVAL;
>
>         pr_debug("trying to register driver %s\n", driver_data->name);
> diff --git a/include/linux/cpufreq.h b/include/linux/cpufreq.h
> index 4907eb2..ff9c8df 100644
> --- a/include/linux/cpufreq.h
> +++ b/include/linux/cpufreq.h
> @@ -195,9 +195,11 @@ struct cpufreq_driver {
>
>         /* define one out of two */
>         int     (*setpolicy)    (struct cpufreq_policy *policy);
> -       int     (*target)       (struct cpufreq_policy *policy,
> +       int     (*target)       (struct cpufreq_policy *policy, /* Deprecated */
>                                  unsigned int target_freq,
>                                  unsigned int relation);
> +       int     (*target_index) (struct cpufreq_policy *policy,
> +                                unsigned int index);
>
>         /* should be defined, if possible */
>         unsigned int    (*get)  (unsigned int cpu);
> --
> 1.7.12.rc2.18.g61b472e
>
> --
> To unsubscribe from this list: send the line "unsubscribe linux-pm" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html

WARNING: multiple messages have this Message-ID (diff)
From: amit daniel kachhap <amit.daniel@samsung.com>
To: Viresh Kumar <viresh.kumar@linaro.org>
Cc: "Rafael J. Wysocki" <rjw@sisk.pl>,
	linaro-kernel@lists.linaro.org,
	"patches@linaro.org" <patches@linaro.org>,
	cpufreq@vger.kernel.org,
	"linux-pm@vger.kernel.org" <linux-pm@vger.kernel.org>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	LAK <linux-arm-kernel@lists.infradead.org>,
	Andrew Lunn <andrew@lunn.ch>,
	"David S. Miller" <davem@davemloft.net>,
	Dmitry Eremin-Solenikov <dbaryshkov@gmail.com>,
	Eric Miao <eric.y.miao@gmail.com>,
	Hans-Christian Egtvedt <egtvedt@samfundet.no>,
	Jesper Nilsson <jesper.nilsson@axis.com>,
	John Crispin <blogic@openwrt.org>,
	Kukjin Kim <kgene.kim@samsung.com>,
	Linus Walleij <linus.walleij@linaro.org>,
	linux-cris-kernel@axis.com, Mikael Starvik <starvik@axis.com>,
	Santosh Shilimkar <santosh.shilimkar@ti.com>,
	Sekhar Nori <nsekhar@ti.com>, Shawn Guo <shawn.guo@linaro.org>,
	sparclinux@vger.kernel.org, Stephen Warren <swarren@n>
Subject: Re: [PATCH V2 01/35] cpufreq: Implement light weight ->target_index() routine
Date: Sun, 18 Aug 2013 16:11:59 +0530	[thread overview]
Message-ID: <CADGdYn4=si46x7b5Qa0EJ1vUDKrP3maXBqWwQ6s7gkep-8MxFg@mail.gmail.com> (raw)
In-Reply-To: <eb988fc9e72b90b7ba99f16405f5dcb072da7840.1376392602.git.viresh.kumar@linaro.org>

Hi Viresh,

On Tue, Aug 13, 2013 at 7:02 PM, Viresh Kumar <viresh.kumar@linaro.org> wrote:
> Currently prototype of cpufreq_drivers target routines is:
>
> int target(struct cpufreq_policy *policy, unsigned int target_freq,
>                 unsigned int relation);
>
> And most of the drivers call cpufreq_frequency_table_target() to get a valid
> index of their frequency table which is closest to the target_freq. And they
> don't use target_freq and relation after it.
>
> So, it makes sense to just do this work in cpufreq core before calling
> cpufreq_frequency_table_target() and simply pass index instead. But this can be
> done only with drivers which expose their frequency table with cpufreq core. For
> others we need to stick with the old prototype of target() until those drivers
> are converted to expose frequency tables.
>
> This patch implements the new light weight prototype for target_index() routine.
> It looks like this:
>
> int target_index(struct cpufreq_policy *policy, unsigned int index);
This new API is fine but I have another idea.
Say During the registration of the frequency table cpufreq_policy can
be registered as SCALE_DIRECT or SCALE_STEPS. With SCALE_DIRECT flag,
valid frequency will be requested. With this flags the governor itself
can  can figure out if frequency scaling is required or not and very
few calls to __cpufreq_driver_target will happen.
But i agree that in this approach cpufreq_frequency_table_target is
still required but again it can be optimized by binary search as
currently the search is linear.

Thanks,
Amit
>
> CPUFreq core will call cpufreq_frequency_table_target() before calling this
> routine and pass index to it. Because CPUFreq core now requires to call routines
> present in freq_table.c CONFIG_CPU_FREQ_TABLE must be enabled all the time.
>
> This also marks target() interface as deprecated. So, that new drivers avoid
> using it. And
>
> Documentation is updated accordingly.
>
> Cc: Andrew Lunn <andrew@lunn.ch>
> Cc: David S. Miller <davem@davemloft.net>
> Cc: Dmitry Eremin-Solenikov <dbaryshkov@gmail.com>
> Cc: Eric Miao <eric.y.miao@gmail.com>
> Cc: Hans-Christian Egtvedt <egtvedt@samfundet.no>
> Cc: Jesper Nilsson <jesper.nilsson@axis.com>
> Cc: John Crispin <blogic@openwrt.org>
> Cc: Kukjin Kim <kgene.kim@samsung.com>
> Cc: Linus Walleij <linus.walleij@linaro.org>
> Cc: linux-cris-kernel@axis.com
> Cc: Mikael Starvik <starvik@axis.com>
> Cc: Santosh Shilimkar <santosh.shilimkar@ti.com>
> Cc: Sekhar Nori <nsekhar@ti.com>
> Cc: Shawn Guo <shawn.guo@linaro.org>
> Cc: sparclinux@vger.kernel.org
> Cc: Stephen Warren <swarren@nvidia.com>
> Cc: Steven Miao <realmz6@gmail.com>
> Cc: Tony Luck <tony.luck@intel.com>
> Signed-off-by: Viresh Kumar <viresh.kumar@linaro.org>
> ---
>  Documentation/cpu-freq/cpu-drivers.txt | 27 +++++++++++------
>  Documentation/cpu-freq/governors.txt   |  4 +--
>  drivers/cpufreq/Kconfig                |  1 +
>  drivers/cpufreq/cpufreq.c              | 55 +++++++++++++++++++++++++++-------
>  include/linux/cpufreq.h                |  4 ++-
>  5 files changed, 68 insertions(+), 23 deletions(-)
>
> diff --git a/Documentation/cpu-freq/cpu-drivers.txt b/Documentation/cpu-freq/cpu-drivers.txt
> index 40282e6..8b1a445 100644
> --- a/Documentation/cpu-freq/cpu-drivers.txt
> +++ b/Documentation/cpu-freq/cpu-drivers.txt
> @@ -23,8 +23,8 @@ Contents:
>  1.1  Initialization
>  1.2  Per-CPU Initialization
>  1.3  verify
> -1.4  target or setpolicy?
> -1.5  target
> +1.4  target/target_index or setpolicy?
> +1.5  target/target_index
>  1.6  setpolicy
>  2.   Frequency Table Helpers
>
> @@ -56,7 +56,8 @@ cpufreq_driver.init -         A pointer to the per-CPU initialization
>  cpufreq_driver.verify -                A pointer to a "verification" function.
>
>  cpufreq_driver.setpolicy _or_
> -cpufreq_driver.target -                See below on the differences.
> +cpufreq_driver.target/
> +target_index           -       See below on the differences.
>
>  And optionally
>
> @@ -66,7 +67,7 @@ cpufreq_driver.resume -               A pointer to a per-CPU resume function
>                                 which is called with interrupts disabled
>                                 and _before_ the pre-suspend frequency
>                                 and/or policy is restored by a call to
> -                               ->target or ->setpolicy.
> +                               ->target/target_index or ->setpolicy.
>
>  cpufreq_driver.attr -          A pointer to a NULL-terminated list of
>                                 "struct freq_attr" which allow to
> @@ -103,8 +104,8 @@ policy->governor            must contain the "default policy" for
>                                 this CPU. A few moments later,
>                                 cpufreq_driver.verify and either
>                                 cpufreq_driver.setpolicy or
> -                               cpufreq_driver.target is called with
> -                               these values.
> +                               cpufreq_driver.target/target_index is called
> +                               with these values.
>
>  For setting some of these values (cpuinfo.min[max]_freq, policy->min[max]), the
>  frequency table helpers might be helpful. See the section 2 for more information
> @@ -133,20 +134,28 @@ range) is within policy->min and policy->max. If necessary, increase
>  policy->max first, and only if this is no solution, decrease policy->min.
>
>
> -1.4 target or setpolicy?
> +1.4 target/target_index or setpolicy?
>  ----------------------------
>
>  Most cpufreq drivers or even most cpu frequency scaling algorithms
>  only allow the CPU to be set to one frequency. For these, you use the
> -->target call.
> +->target/target_index call.
>
>  Some cpufreq-capable processors switch the frequency between certain
>  limits on their own. These shall use the ->setpolicy call
>
>
> -1.4. target
> +1.4. target/target_index
>  -------------
>
> +The target_index call has two arguments: struct cpufreq_policy *policy,
> +and unsigned int index (into the exposed frequency table).
> +
> +The CPUfreq driver must set the new frequency when called here. The
> +actual frequency must be determined by freq_table[index].frequency.
> +
> +Deprecated:
> +----------
>  The target call has three arguments: struct cpufreq_policy *policy,
>  unsigned int target_frequency, unsigned int relation.
>
> diff --git a/Documentation/cpu-freq/governors.txt b/Documentation/cpu-freq/governors.txt
> index 219970b..77ec215 100644
> --- a/Documentation/cpu-freq/governors.txt
> +++ b/Documentation/cpu-freq/governors.txt
> @@ -40,7 +40,7 @@ Most cpufreq drivers (in fact, all except one, longrun) or even most
>  cpu frequency scaling algorithms only offer the CPU to be set to one
>  frequency. In order to offer dynamic frequency scaling, the cpufreq
>  core must be able to tell these drivers of a "target frequency". So
> -these specific drivers will be transformed to offer a "->target"
> +these specific drivers will be transformed to offer a "->target/target_index"
>  call instead of the existing "->setpolicy" call. For "longrun", all
>  stays the same, though.
>
> @@ -71,7 +71,7 @@ CPU can be set to switch independently         |         CPU can only be set
>                     /                          the limits of policy->{min,max}
>                    /                                \
>                   /                                  \
> -       Using the ->setpolicy call,              Using the ->target call,
> +       Using the ->setpolicy call,              Using the ->target/target_index call,
>             the limits and the                    the frequency closest
>              "policy" is set.                     to target_freq is set.
>                                                   It is assured that it
> diff --git a/drivers/cpufreq/Kconfig b/drivers/cpufreq/Kconfig
> index 534fcb8..2d06754 100644
> --- a/drivers/cpufreq/Kconfig
> +++ b/drivers/cpufreq/Kconfig
> @@ -2,6 +2,7 @@ menu "CPU Frequency scaling"
>
>  config CPU_FREQ
>         bool "CPU Frequency scaling"
> +       select CPU_FREQ_TABLE
>         help
>           CPU Frequency scaling allows you to change the clock speed of
>           CPUs on the fly. This is a nice method to save power, because
> diff --git a/drivers/cpufreq/cpufreq.c b/drivers/cpufreq/cpufreq.c
> index 37a6874..f1b0e0f 100644
> --- a/drivers/cpufreq/cpufreq.c
> +++ b/drivers/cpufreq/cpufreq.c
> @@ -47,6 +47,11 @@ static LIST_HEAD(cpufreq_policy_list);
>  static DEFINE_PER_CPU(char[CPUFREQ_NAME_LEN], cpufreq_cpu_governor);
>  #endif
>
> +static inline bool has_target(void)
> +{
> +       return cpufreq_driver->target_index || cpufreq_driver->target;
> +}
> +
>  /*
>   * cpu_policy_rwsem is a per CPU reader-writer semaphore designed to cure
>   * all cpufreq/hotplug/workqueue/etc related lock issues.
> @@ -377,7 +382,7 @@ static int cpufreq_parse_governor(char *str_governor, unsigned int *policy,
>                         *policy = CPUFREQ_POLICY_POWERSAVE;
>                         err = 0;
>                 }
> -       } else if (cpufreq_driver->target) {
> +       } else if (has_target()) {
>                 struct cpufreq_governor *t;
>
>                 mutex_lock(&cpufreq_governor_mutex);
> @@ -539,7 +544,7 @@ static ssize_t show_scaling_available_governors(struct cpufreq_policy *policy,
>         ssize_t i = 0;
>         struct cpufreq_governor *t;
>
> -       if (!cpufreq_driver->target) {
> +       if (!has_target()) {
>                 i += sprintf(buf, "performance powersave");
>                 goto out;
>         }
> @@ -822,7 +827,7 @@ static int cpufreq_add_dev_interface(struct cpufreq_policy *policy,
>                 if (ret)
>                         goto err_out_kobj_put;
>         }
> -       if (cpufreq_driver->target) {
> +       if (has_target()) {
>                 ret = sysfs_create_file(&policy->kobj, &scaling_cur_freq.attr);
>                 if (ret)
>                         goto err_out_kobj_put;
> @@ -871,10 +876,10 @@ static int cpufreq_add_policy_cpu(struct cpufreq_policy *policy,
>                                   unsigned int cpu, struct device *dev,
>                                   bool frozen)
>  {
> -       int ret = 0, has_target = !!cpufreq_driver->target;
> +       int ret = 0;
>         unsigned long flags;
>
> -       if (has_target) {
> +       if (has_target()) {
>                 ret = __cpufreq_governor(policy, CPUFREQ_GOV_STOP);
>                 if (ret) {
>                         pr_err("%s: Failed to stop governor\n", __func__);
> @@ -893,7 +898,7 @@ static int cpufreq_add_policy_cpu(struct cpufreq_policy *policy,
>
>         unlock_policy_rwsem_write(policy->cpu);
>
> -       if (has_target) {
> +       if (has_target()) {
>                 if ((ret = __cpufreq_governor(policy, CPUFREQ_GOV_START)) ||
>                         (ret = __cpufreq_governor(policy, CPUFREQ_GOV_LIMITS))) {
>                         pr_err("%s: Failed to start governor\n", __func__);
> @@ -1204,7 +1209,7 @@ static int __cpufreq_remove_dev(struct device *dev,
>                 return -EINVAL;
>         }
>
> -       if (cpufreq_driver->target) {
> +       if (has_target()) {
>                 ret = __cpufreq_governor(policy, CPUFREQ_GOV_STOP);
>                 if (ret) {
>                         pr_err("%s: Failed to stop governor\n", __func__);
> @@ -1244,7 +1249,7 @@ static int __cpufreq_remove_dev(struct device *dev,
>
>         /* If cpu is last user of policy, free policy */
>         if (cpus == 1) {
> -               if (cpufreq_driver->target) {
> +               if (has_target()) {
>                         ret = __cpufreq_governor(policy,
>                                         CPUFREQ_GOV_POLICY_EXIT);
>                         if (ret) {
> @@ -1282,7 +1287,7 @@ static int __cpufreq_remove_dev(struct device *dev,
>                 if (!frozen)
>                         cpufreq_policy_free(policy);
>         } else {
> -               if (cpufreq_driver->target) {
> +               if (has_target()) {
>                         if ((ret = __cpufreq_governor(policy, CPUFREQ_GOV_START)) ||
>                                         (ret = __cpufreq_governor(policy, CPUFREQ_GOV_LIMITS))) {
>                                 pr_err("%s: Failed to start governor\n",
> @@ -1646,11 +1651,39 @@ int __cpufreq_driver_target(struct cpufreq_policy *policy,
>         pr_debug("target for CPU %u: %u kHz, relation %u, requested %u kHz\n",
>                         policy->cpu, target_freq, relation, old_target_freq);
>
> +       /*
> +        * This might look like a redundant call as we are checking it again
> +        * after finding index. But it is left intentionally for cases where
> +        * exactly same freq is called again and so we can save on few function
> +        * calls.
> +        */
>         if (target_freq == policy->cur)
>                 return 0;
>
>         if (cpufreq_driver->target)
>                 retval = cpufreq_driver->target(policy, target_freq, relation);
> +       else if (cpufreq_driver->target_index) {
> +               struct cpufreq_frequency_table *freq_table;
> +               int index;
> +
> +               freq_table = cpufreq_frequency_get_table(policy->cpu);
> +               if (unlikely(!freq_table)) {
> +                       pr_err("%s: Unable to find freq_table\n", __func__);
> +                       return retval;
> +               }
> +
> +               retval = cpufreq_frequency_table_target(policy, freq_table,
> +                               target_freq, relation, &index);
> +               if (unlikely(retval)) {
> +                       pr_err("%s: Unable to find matching freq\n", __func__);
> +                       return retval;
> +               }
> +
> +               if (freq_table[index].frequency == policy->cur)
> +                       return 0;
> +
> +               retval = cpufreq_driver->target_index(policy, index);
> +       }
>
>         return retval;
>  }
> @@ -1983,7 +2016,7 @@ int cpufreq_update_policy(unsigned int cpu)
>                         pr_debug("Driver did not initialize current freq");
>                         policy->cur = new_policy.cur;
>                 } else {
> -                       if (policy->cur != new_policy.cur && cpufreq_driver->target)
> +                       if (policy->cur != new_policy.cur && has_target())
>                                 cpufreq_out_of_sync(cpu, policy->cur,
>                                                                 new_policy.cur);
>                 }
> @@ -2058,7 +2091,7 @@ int cpufreq_register_driver(struct cpufreq_driver *driver_data)
>                 return -ENODEV;
>
>         if (!driver_data || !driver_data->verify || !driver_data->init ||
> -           ((!driver_data->setpolicy) && (!driver_data->target)))
> +           (!driver_data->setpolicy && !has_target()))
>                 return -EINVAL;
>
>         pr_debug("trying to register driver %s\n", driver_data->name);
> diff --git a/include/linux/cpufreq.h b/include/linux/cpufreq.h
> index 4907eb2..ff9c8df 100644
> --- a/include/linux/cpufreq.h
> +++ b/include/linux/cpufreq.h
> @@ -195,9 +195,11 @@ struct cpufreq_driver {
>
>         /* define one out of two */
>         int     (*setpolicy)    (struct cpufreq_policy *policy);
> -       int     (*target)       (struct cpufreq_policy *policy,
> +       int     (*target)       (struct cpufreq_policy *policy, /* Deprecated */
>                                  unsigned int target_freq,
>                                  unsigned int relation);
> +       int     (*target_index) (struct cpufreq_policy *policy,
> +                                unsigned int index);
>
>         /* should be defined, if possible */
>         unsigned int    (*get)  (unsigned int cpu);
> --
> 1.7.12.rc2.18.g61b472e
>
> --
> To unsubscribe from this list: send the line "unsubscribe linux-pm" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html

WARNING: multiple messages have this Message-ID (diff)
From: amit daniel kachhap <amit.daniel@samsung.com>
To: linux-arm-kernel@lists.infradead.org
Subject: Re: [PATCH V2 01/35] cpufreq: Implement light weight ->target_index() routine
Date: Sun, 18 Aug 2013 10:53:59 +0000	[thread overview]
Message-ID: <CADGdYn4=si46x7b5Qa0EJ1vUDKrP3maXBqWwQ6s7gkep-8MxFg@mail.gmail.com> (raw)
In-Reply-To: <eb988fc9e72b90b7ba99f16405f5dcb072da7840.1376392602.git.viresh.kumar@linaro.org>

Hi Viresh,

On Tue, Aug 13, 2013 at 7:02 PM, Viresh Kumar <viresh.kumar@linaro.org> wrote:
> Currently prototype of cpufreq_drivers target routines is:
>
> int target(struct cpufreq_policy *policy, unsigned int target_freq,
>                 unsigned int relation);
>
> And most of the drivers call cpufreq_frequency_table_target() to get a valid
> index of their frequency table which is closest to the target_freq. And they
> don't use target_freq and relation after it.
>
> So, it makes sense to just do this work in cpufreq core before calling
> cpufreq_frequency_table_target() and simply pass index instead. But this can be
> done only with drivers which expose their frequency table with cpufreq core. For
> others we need to stick with the old prototype of target() until those drivers
> are converted to expose frequency tables.
>
> This patch implements the new light weight prototype for target_index() routine.
> It looks like this:
>
> int target_index(struct cpufreq_policy *policy, unsigned int index);
This new API is fine but I have another idea.
Say During the registration of the frequency table cpufreq_policy can
be registered as SCALE_DIRECT or SCALE_STEPS. With SCALE_DIRECT flag,
valid frequency will be requested. With this flags the governor itself
can  can figure out if frequency scaling is required or not and very
few calls to __cpufreq_driver_target will happen.
But i agree that in this approach cpufreq_frequency_table_target is
still required but again it can be optimized by binary search as
currently the search is linear.

Thanks,
Amit
>
> CPUFreq core will call cpufreq_frequency_table_target() before calling this
> routine and pass index to it. Because CPUFreq core now requires to call routines
> present in freq_table.c CONFIG_CPU_FREQ_TABLE must be enabled all the time.
>
> This also marks target() interface as deprecated. So, that new drivers avoid
> using it. And
>
> Documentation is updated accordingly.
>
> Cc: Andrew Lunn <andrew@lunn.ch>
> Cc: David S. Miller <davem@davemloft.net>
> Cc: Dmitry Eremin-Solenikov <dbaryshkov@gmail.com>
> Cc: Eric Miao <eric.y.miao@gmail.com>
> Cc: Hans-Christian Egtvedt <egtvedt@samfundet.no>
> Cc: Jesper Nilsson <jesper.nilsson@axis.com>
> Cc: John Crispin <blogic@openwrt.org>
> Cc: Kukjin Kim <kgene.kim@samsung.com>
> Cc: Linus Walleij <linus.walleij@linaro.org>
> Cc: linux-cris-kernel@axis.com
> Cc: Mikael Starvik <starvik@axis.com>
> Cc: Santosh Shilimkar <santosh.shilimkar@ti.com>
> Cc: Sekhar Nori <nsekhar@ti.com>
> Cc: Shawn Guo <shawn.guo@linaro.org>
> Cc: sparclinux@vger.kernel.org
> Cc: Stephen Warren <swarren@nvidia.com>
> Cc: Steven Miao <realmz6@gmail.com>
> Cc: Tony Luck <tony.luck@intel.com>
> Signed-off-by: Viresh Kumar <viresh.kumar@linaro.org>
> ---
>  Documentation/cpu-freq/cpu-drivers.txt | 27 +++++++++++------
>  Documentation/cpu-freq/governors.txt   |  4 +--
>  drivers/cpufreq/Kconfig                |  1 +
>  drivers/cpufreq/cpufreq.c              | 55 +++++++++++++++++++++++++++-------
>  include/linux/cpufreq.h                |  4 ++-
>  5 files changed, 68 insertions(+), 23 deletions(-)
>
> diff --git a/Documentation/cpu-freq/cpu-drivers.txt b/Documentation/cpu-freq/cpu-drivers.txt
> index 40282e6..8b1a445 100644
> --- a/Documentation/cpu-freq/cpu-drivers.txt
> +++ b/Documentation/cpu-freq/cpu-drivers.txt
> @@ -23,8 +23,8 @@ Contents:
>  1.1  Initialization
>  1.2  Per-CPU Initialization
>  1.3  verify
> -1.4  target or setpolicy?
> -1.5  target
> +1.4  target/target_index or setpolicy?
> +1.5  target/target_index
>  1.6  setpolicy
>  2.   Frequency Table Helpers
>
> @@ -56,7 +56,8 @@ cpufreq_driver.init -         A pointer to the per-CPU initialization
>  cpufreq_driver.verify -                A pointer to a "verification" function.
>
>  cpufreq_driver.setpolicy _or_
> -cpufreq_driver.target -                See below on the differences.
> +cpufreq_driver.target/
> +target_index           -       See below on the differences.
>
>  And optionally
>
> @@ -66,7 +67,7 @@ cpufreq_driver.resume -               A pointer to a per-CPU resume function
>                                 which is called with interrupts disabled
>                                 and _before_ the pre-suspend frequency
>                                 and/or policy is restored by a call to
> -                               ->target or ->setpolicy.
> +                               ->target/target_index or ->setpolicy.
>
>  cpufreq_driver.attr -          A pointer to a NULL-terminated list of
>                                 "struct freq_attr" which allow to
> @@ -103,8 +104,8 @@ policy->governor            must contain the "default policy" for
>                                 this CPU. A few moments later,
>                                 cpufreq_driver.verify and either
>                                 cpufreq_driver.setpolicy or
> -                               cpufreq_driver.target is called with
> -                               these values.
> +                               cpufreq_driver.target/target_index is called
> +                               with these values.
>
>  For setting some of these values (cpuinfo.min[max]_freq, policy->min[max]), the
>  frequency table helpers might be helpful. See the section 2 for more information
> @@ -133,20 +134,28 @@ range) is within policy->min and policy->max. If necessary, increase
>  policy->max first, and only if this is no solution, decrease policy->min.
>
>
> -1.4 target or setpolicy?
> +1.4 target/target_index or setpolicy?
>  ----------------------------
>
>  Most cpufreq drivers or even most cpu frequency scaling algorithms
>  only allow the CPU to be set to one frequency. For these, you use the
> -->target call.
> +->target/target_index call.
>
>  Some cpufreq-capable processors switch the frequency between certain
>  limits on their own. These shall use the ->setpolicy call
>
>
> -1.4. target
> +1.4. target/target_index
>  -------------
>
> +The target_index call has two arguments: struct cpufreq_policy *policy,
> +and unsigned int index (into the exposed frequency table).
> +
> +The CPUfreq driver must set the new frequency when called here. The
> +actual frequency must be determined by freq_table[index].frequency.
> +
> +Deprecated:
> +----------
>  The target call has three arguments: struct cpufreq_policy *policy,
>  unsigned int target_frequency, unsigned int relation.
>
> diff --git a/Documentation/cpu-freq/governors.txt b/Documentation/cpu-freq/governors.txt
> index 219970b..77ec215 100644
> --- a/Documentation/cpu-freq/governors.txt
> +++ b/Documentation/cpu-freq/governors.txt
> @@ -40,7 +40,7 @@ Most cpufreq drivers (in fact, all except one, longrun) or even most
>  cpu frequency scaling algorithms only offer the CPU to be set to one
>  frequency. In order to offer dynamic frequency scaling, the cpufreq
>  core must be able to tell these drivers of a "target frequency". So
> -these specific drivers will be transformed to offer a "->target"
> +these specific drivers will be transformed to offer a "->target/target_index"
>  call instead of the existing "->setpolicy" call. For "longrun", all
>  stays the same, though.
>
> @@ -71,7 +71,7 @@ CPU can be set to switch independently         |         CPU can only be set
>                     /                          the limits of policy->{min,max}
>                    /                                \
>                   /                                  \
> -       Using the ->setpolicy call,              Using the ->target call,
> +       Using the ->setpolicy call,              Using the ->target/target_index call,
>             the limits and the                    the frequency closest
>              "policy" is set.                     to target_freq is set.
>                                                   It is assured that it
> diff --git a/drivers/cpufreq/Kconfig b/drivers/cpufreq/Kconfig
> index 534fcb8..2d06754 100644
> --- a/drivers/cpufreq/Kconfig
> +++ b/drivers/cpufreq/Kconfig
> @@ -2,6 +2,7 @@ menu "CPU Frequency scaling"
>
>  config CPU_FREQ
>         bool "CPU Frequency scaling"
> +       select CPU_FREQ_TABLE
>         help
>           CPU Frequency scaling allows you to change the clock speed of
>           CPUs on the fly. This is a nice method to save power, because
> diff --git a/drivers/cpufreq/cpufreq.c b/drivers/cpufreq/cpufreq.c
> index 37a6874..f1b0e0f 100644
> --- a/drivers/cpufreq/cpufreq.c
> +++ b/drivers/cpufreq/cpufreq.c
> @@ -47,6 +47,11 @@ static LIST_HEAD(cpufreq_policy_list);
>  static DEFINE_PER_CPU(char[CPUFREQ_NAME_LEN], cpufreq_cpu_governor);
>  #endif
>
> +static inline bool has_target(void)
> +{
> +       return cpufreq_driver->target_index || cpufreq_driver->target;
> +}
> +
>  /*
>   * cpu_policy_rwsem is a per CPU reader-writer semaphore designed to cure
>   * all cpufreq/hotplug/workqueue/etc related lock issues.
> @@ -377,7 +382,7 @@ static int cpufreq_parse_governor(char *str_governor, unsigned int *policy,
>                         *policy = CPUFREQ_POLICY_POWERSAVE;
>                         err = 0;
>                 }
> -       } else if (cpufreq_driver->target) {
> +       } else if (has_target()) {
>                 struct cpufreq_governor *t;
>
>                 mutex_lock(&cpufreq_governor_mutex);
> @@ -539,7 +544,7 @@ static ssize_t show_scaling_available_governors(struct cpufreq_policy *policy,
>         ssize_t i = 0;
>         struct cpufreq_governor *t;
>
> -       if (!cpufreq_driver->target) {
> +       if (!has_target()) {
>                 i += sprintf(buf, "performance powersave");
>                 goto out;
>         }
> @@ -822,7 +827,7 @@ static int cpufreq_add_dev_interface(struct cpufreq_policy *policy,
>                 if (ret)
>                         goto err_out_kobj_put;
>         }
> -       if (cpufreq_driver->target) {
> +       if (has_target()) {
>                 ret = sysfs_create_file(&policy->kobj, &scaling_cur_freq.attr);
>                 if (ret)
>                         goto err_out_kobj_put;
> @@ -871,10 +876,10 @@ static int cpufreq_add_policy_cpu(struct cpufreq_policy *policy,
>                                   unsigned int cpu, struct device *dev,
>                                   bool frozen)
>  {
> -       int ret = 0, has_target = !!cpufreq_driver->target;
> +       int ret = 0;
>         unsigned long flags;
>
> -       if (has_target) {
> +       if (has_target()) {
>                 ret = __cpufreq_governor(policy, CPUFREQ_GOV_STOP);
>                 if (ret) {
>                         pr_err("%s: Failed to stop governor\n", __func__);
> @@ -893,7 +898,7 @@ static int cpufreq_add_policy_cpu(struct cpufreq_policy *policy,
>
>         unlock_policy_rwsem_write(policy->cpu);
>
> -       if (has_target) {
> +       if (has_target()) {
>                 if ((ret = __cpufreq_governor(policy, CPUFREQ_GOV_START)) ||
>                         (ret = __cpufreq_governor(policy, CPUFREQ_GOV_LIMITS))) {
>                         pr_err("%s: Failed to start governor\n", __func__);
> @@ -1204,7 +1209,7 @@ static int __cpufreq_remove_dev(struct device *dev,
>                 return -EINVAL;
>         }
>
> -       if (cpufreq_driver->target) {
> +       if (has_target()) {
>                 ret = __cpufreq_governor(policy, CPUFREQ_GOV_STOP);
>                 if (ret) {
>                         pr_err("%s: Failed to stop governor\n", __func__);
> @@ -1244,7 +1249,7 @@ static int __cpufreq_remove_dev(struct device *dev,
>
>         /* If cpu is last user of policy, free policy */
>         if (cpus = 1) {
> -               if (cpufreq_driver->target) {
> +               if (has_target()) {
>                         ret = __cpufreq_governor(policy,
>                                         CPUFREQ_GOV_POLICY_EXIT);
>                         if (ret) {
> @@ -1282,7 +1287,7 @@ static int __cpufreq_remove_dev(struct device *dev,
>                 if (!frozen)
>                         cpufreq_policy_free(policy);
>         } else {
> -               if (cpufreq_driver->target) {
> +               if (has_target()) {
>                         if ((ret = __cpufreq_governor(policy, CPUFREQ_GOV_START)) ||
>                                         (ret = __cpufreq_governor(policy, CPUFREQ_GOV_LIMITS))) {
>                                 pr_err("%s: Failed to start governor\n",
> @@ -1646,11 +1651,39 @@ int __cpufreq_driver_target(struct cpufreq_policy *policy,
>         pr_debug("target for CPU %u: %u kHz, relation %u, requested %u kHz\n",
>                         policy->cpu, target_freq, relation, old_target_freq);
>
> +       /*
> +        * This might look like a redundant call as we are checking it again
> +        * after finding index. But it is left intentionally for cases where
> +        * exactly same freq is called again and so we can save on few function
> +        * calls.
> +        */
>         if (target_freq = policy->cur)
>                 return 0;
>
>         if (cpufreq_driver->target)
>                 retval = cpufreq_driver->target(policy, target_freq, relation);
> +       else if (cpufreq_driver->target_index) {
> +               struct cpufreq_frequency_table *freq_table;
> +               int index;
> +
> +               freq_table = cpufreq_frequency_get_table(policy->cpu);
> +               if (unlikely(!freq_table)) {
> +                       pr_err("%s: Unable to find freq_table\n", __func__);
> +                       return retval;
> +               }
> +
> +               retval = cpufreq_frequency_table_target(policy, freq_table,
> +                               target_freq, relation, &index);
> +               if (unlikely(retval)) {
> +                       pr_err("%s: Unable to find matching freq\n", __func__);
> +                       return retval;
> +               }
> +
> +               if (freq_table[index].frequency = policy->cur)
> +                       return 0;
> +
> +               retval = cpufreq_driver->target_index(policy, index);
> +       }
>
>         return retval;
>  }
> @@ -1983,7 +2016,7 @@ int cpufreq_update_policy(unsigned int cpu)
>                         pr_debug("Driver did not initialize current freq");
>                         policy->cur = new_policy.cur;
>                 } else {
> -                       if (policy->cur != new_policy.cur && cpufreq_driver->target)
> +                       if (policy->cur != new_policy.cur && has_target())
>                                 cpufreq_out_of_sync(cpu, policy->cur,
>                                                                 new_policy.cur);
>                 }
> @@ -2058,7 +2091,7 @@ int cpufreq_register_driver(struct cpufreq_driver *driver_data)
>                 return -ENODEV;
>
>         if (!driver_data || !driver_data->verify || !driver_data->init ||
> -           ((!driver_data->setpolicy) && (!driver_data->target)))
> +           (!driver_data->setpolicy && !has_target()))
>                 return -EINVAL;
>
>         pr_debug("trying to register driver %s\n", driver_data->name);
> diff --git a/include/linux/cpufreq.h b/include/linux/cpufreq.h
> index 4907eb2..ff9c8df 100644
> --- a/include/linux/cpufreq.h
> +++ b/include/linux/cpufreq.h
> @@ -195,9 +195,11 @@ struct cpufreq_driver {
>
>         /* define one out of two */
>         int     (*setpolicy)    (struct cpufreq_policy *policy);
> -       int     (*target)       (struct cpufreq_policy *policy,
> +       int     (*target)       (struct cpufreq_policy *policy, /* Deprecated */
>                                  unsigned int target_freq,
>                                  unsigned int relation);
> +       int     (*target_index) (struct cpufreq_policy *policy,
> +                                unsigned int index);
>
>         /* should be defined, if possible */
>         unsigned int    (*get)  (unsigned int cpu);
> --
> 1.7.12.rc2.18.g61b472e
>
> --
> To unsubscribe from this list: send the line "unsubscribe linux-pm" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html

WARNING: multiple messages have this Message-ID (diff)
From: amit.daniel@samsung.com (amit daniel kachhap)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH V2 01/35] cpufreq: Implement light weight ->target_index() routine
Date: Sun, 18 Aug 2013 16:11:59 +0530	[thread overview]
Message-ID: <CADGdYn4=si46x7b5Qa0EJ1vUDKrP3maXBqWwQ6s7gkep-8MxFg@mail.gmail.com> (raw)
In-Reply-To: <eb988fc9e72b90b7ba99f16405f5dcb072da7840.1376392602.git.viresh.kumar@linaro.org>

Hi Viresh,

On Tue, Aug 13, 2013 at 7:02 PM, Viresh Kumar <viresh.kumar@linaro.org> wrote:
> Currently prototype of cpufreq_drivers target routines is:
>
> int target(struct cpufreq_policy *policy, unsigned int target_freq,
>                 unsigned int relation);
>
> And most of the drivers call cpufreq_frequency_table_target() to get a valid
> index of their frequency table which is closest to the target_freq. And they
> don't use target_freq and relation after it.
>
> So, it makes sense to just do this work in cpufreq core before calling
> cpufreq_frequency_table_target() and simply pass index instead. But this can be
> done only with drivers which expose their frequency table with cpufreq core. For
> others we need to stick with the old prototype of target() until those drivers
> are converted to expose frequency tables.
>
> This patch implements the new light weight prototype for target_index() routine.
> It looks like this:
>
> int target_index(struct cpufreq_policy *policy, unsigned int index);
This new API is fine but I have another idea.
Say During the registration of the frequency table cpufreq_policy can
be registered as SCALE_DIRECT or SCALE_STEPS. With SCALE_DIRECT flag,
valid frequency will be requested. With this flags the governor itself
can  can figure out if frequency scaling is required or not and very
few calls to __cpufreq_driver_target will happen.
But i agree that in this approach cpufreq_frequency_table_target is
still required but again it can be optimized by binary search as
currently the search is linear.

Thanks,
Amit
>
> CPUFreq core will call cpufreq_frequency_table_target() before calling this
> routine and pass index to it. Because CPUFreq core now requires to call routines
> present in freq_table.c CONFIG_CPU_FREQ_TABLE must be enabled all the time.
>
> This also marks target() interface as deprecated. So, that new drivers avoid
> using it. And
>
> Documentation is updated accordingly.
>
> Cc: Andrew Lunn <andrew@lunn.ch>
> Cc: David S. Miller <davem@davemloft.net>
> Cc: Dmitry Eremin-Solenikov <dbaryshkov@gmail.com>
> Cc: Eric Miao <eric.y.miao@gmail.com>
> Cc: Hans-Christian Egtvedt <egtvedt@samfundet.no>
> Cc: Jesper Nilsson <jesper.nilsson@axis.com>
> Cc: John Crispin <blogic@openwrt.org>
> Cc: Kukjin Kim <kgene.kim@samsung.com>
> Cc: Linus Walleij <linus.walleij@linaro.org>
> Cc: linux-cris-kernel at axis.com
> Cc: Mikael Starvik <starvik@axis.com>
> Cc: Santosh Shilimkar <santosh.shilimkar@ti.com>
> Cc: Sekhar Nori <nsekhar@ti.com>
> Cc: Shawn Guo <shawn.guo@linaro.org>
> Cc: sparclinux at vger.kernel.org
> Cc: Stephen Warren <swarren@nvidia.com>
> Cc: Steven Miao <realmz6@gmail.com>
> Cc: Tony Luck <tony.luck@intel.com>
> Signed-off-by: Viresh Kumar <viresh.kumar@linaro.org>
> ---
>  Documentation/cpu-freq/cpu-drivers.txt | 27 +++++++++++------
>  Documentation/cpu-freq/governors.txt   |  4 +--
>  drivers/cpufreq/Kconfig                |  1 +
>  drivers/cpufreq/cpufreq.c              | 55 +++++++++++++++++++++++++++-------
>  include/linux/cpufreq.h                |  4 ++-
>  5 files changed, 68 insertions(+), 23 deletions(-)
>
> diff --git a/Documentation/cpu-freq/cpu-drivers.txt b/Documentation/cpu-freq/cpu-drivers.txt
> index 40282e6..8b1a445 100644
> --- a/Documentation/cpu-freq/cpu-drivers.txt
> +++ b/Documentation/cpu-freq/cpu-drivers.txt
> @@ -23,8 +23,8 @@ Contents:
>  1.1  Initialization
>  1.2  Per-CPU Initialization
>  1.3  verify
> -1.4  target or setpolicy?
> -1.5  target
> +1.4  target/target_index or setpolicy?
> +1.5  target/target_index
>  1.6  setpolicy
>  2.   Frequency Table Helpers
>
> @@ -56,7 +56,8 @@ cpufreq_driver.init -         A pointer to the per-CPU initialization
>  cpufreq_driver.verify -                A pointer to a "verification" function.
>
>  cpufreq_driver.setpolicy _or_
> -cpufreq_driver.target -                See below on the differences.
> +cpufreq_driver.target/
> +target_index           -       See below on the differences.
>
>  And optionally
>
> @@ -66,7 +67,7 @@ cpufreq_driver.resume -               A pointer to a per-CPU resume function
>                                 which is called with interrupts disabled
>                                 and _before_ the pre-suspend frequency
>                                 and/or policy is restored by a call to
> -                               ->target or ->setpolicy.
> +                               ->target/target_index or ->setpolicy.
>
>  cpufreq_driver.attr -          A pointer to a NULL-terminated list of
>                                 "struct freq_attr" which allow to
> @@ -103,8 +104,8 @@ policy->governor            must contain the "default policy" for
>                                 this CPU. A few moments later,
>                                 cpufreq_driver.verify and either
>                                 cpufreq_driver.setpolicy or
> -                               cpufreq_driver.target is called with
> -                               these values.
> +                               cpufreq_driver.target/target_index is called
> +                               with these values.
>
>  For setting some of these values (cpuinfo.min[max]_freq, policy->min[max]), the
>  frequency table helpers might be helpful. See the section 2 for more information
> @@ -133,20 +134,28 @@ range) is within policy->min and policy->max. If necessary, increase
>  policy->max first, and only if this is no solution, decrease policy->min.
>
>
> -1.4 target or setpolicy?
> +1.4 target/target_index or setpolicy?
>  ----------------------------
>
>  Most cpufreq drivers or even most cpu frequency scaling algorithms
>  only allow the CPU to be set to one frequency. For these, you use the
> -->target call.
> +->target/target_index call.
>
>  Some cpufreq-capable processors switch the frequency between certain
>  limits on their own. These shall use the ->setpolicy call
>
>
> -1.4. target
> +1.4. target/target_index
>  -------------
>
> +The target_index call has two arguments: struct cpufreq_policy *policy,
> +and unsigned int index (into the exposed frequency table).
> +
> +The CPUfreq driver must set the new frequency when called here. The
> +actual frequency must be determined by freq_table[index].frequency.
> +
> +Deprecated:
> +----------
>  The target call has three arguments: struct cpufreq_policy *policy,
>  unsigned int target_frequency, unsigned int relation.
>
> diff --git a/Documentation/cpu-freq/governors.txt b/Documentation/cpu-freq/governors.txt
> index 219970b..77ec215 100644
> --- a/Documentation/cpu-freq/governors.txt
> +++ b/Documentation/cpu-freq/governors.txt
> @@ -40,7 +40,7 @@ Most cpufreq drivers (in fact, all except one, longrun) or even most
>  cpu frequency scaling algorithms only offer the CPU to be set to one
>  frequency. In order to offer dynamic frequency scaling, the cpufreq
>  core must be able to tell these drivers of a "target frequency". So
> -these specific drivers will be transformed to offer a "->target"
> +these specific drivers will be transformed to offer a "->target/target_index"
>  call instead of the existing "->setpolicy" call. For "longrun", all
>  stays the same, though.
>
> @@ -71,7 +71,7 @@ CPU can be set to switch independently         |         CPU can only be set
>                     /                          the limits of policy->{min,max}
>                    /                                \
>                   /                                  \
> -       Using the ->setpolicy call,              Using the ->target call,
> +       Using the ->setpolicy call,              Using the ->target/target_index call,
>             the limits and the                    the frequency closest
>              "policy" is set.                     to target_freq is set.
>                                                   It is assured that it
> diff --git a/drivers/cpufreq/Kconfig b/drivers/cpufreq/Kconfig
> index 534fcb8..2d06754 100644
> --- a/drivers/cpufreq/Kconfig
> +++ b/drivers/cpufreq/Kconfig
> @@ -2,6 +2,7 @@ menu "CPU Frequency scaling"
>
>  config CPU_FREQ
>         bool "CPU Frequency scaling"
> +       select CPU_FREQ_TABLE
>         help
>           CPU Frequency scaling allows you to change the clock speed of
>           CPUs on the fly. This is a nice method to save power, because
> diff --git a/drivers/cpufreq/cpufreq.c b/drivers/cpufreq/cpufreq.c
> index 37a6874..f1b0e0f 100644
> --- a/drivers/cpufreq/cpufreq.c
> +++ b/drivers/cpufreq/cpufreq.c
> @@ -47,6 +47,11 @@ static LIST_HEAD(cpufreq_policy_list);
>  static DEFINE_PER_CPU(char[CPUFREQ_NAME_LEN], cpufreq_cpu_governor);
>  #endif
>
> +static inline bool has_target(void)
> +{
> +       return cpufreq_driver->target_index || cpufreq_driver->target;
> +}
> +
>  /*
>   * cpu_policy_rwsem is a per CPU reader-writer semaphore designed to cure
>   * all cpufreq/hotplug/workqueue/etc related lock issues.
> @@ -377,7 +382,7 @@ static int cpufreq_parse_governor(char *str_governor, unsigned int *policy,
>                         *policy = CPUFREQ_POLICY_POWERSAVE;
>                         err = 0;
>                 }
> -       } else if (cpufreq_driver->target) {
> +       } else if (has_target()) {
>                 struct cpufreq_governor *t;
>
>                 mutex_lock(&cpufreq_governor_mutex);
> @@ -539,7 +544,7 @@ static ssize_t show_scaling_available_governors(struct cpufreq_policy *policy,
>         ssize_t i = 0;
>         struct cpufreq_governor *t;
>
> -       if (!cpufreq_driver->target) {
> +       if (!has_target()) {
>                 i += sprintf(buf, "performance powersave");
>                 goto out;
>         }
> @@ -822,7 +827,7 @@ static int cpufreq_add_dev_interface(struct cpufreq_policy *policy,
>                 if (ret)
>                         goto err_out_kobj_put;
>         }
> -       if (cpufreq_driver->target) {
> +       if (has_target()) {
>                 ret = sysfs_create_file(&policy->kobj, &scaling_cur_freq.attr);
>                 if (ret)
>                         goto err_out_kobj_put;
> @@ -871,10 +876,10 @@ static int cpufreq_add_policy_cpu(struct cpufreq_policy *policy,
>                                   unsigned int cpu, struct device *dev,
>                                   bool frozen)
>  {
> -       int ret = 0, has_target = !!cpufreq_driver->target;
> +       int ret = 0;
>         unsigned long flags;
>
> -       if (has_target) {
> +       if (has_target()) {
>                 ret = __cpufreq_governor(policy, CPUFREQ_GOV_STOP);
>                 if (ret) {
>                         pr_err("%s: Failed to stop governor\n", __func__);
> @@ -893,7 +898,7 @@ static int cpufreq_add_policy_cpu(struct cpufreq_policy *policy,
>
>         unlock_policy_rwsem_write(policy->cpu);
>
> -       if (has_target) {
> +       if (has_target()) {
>                 if ((ret = __cpufreq_governor(policy, CPUFREQ_GOV_START)) ||
>                         (ret = __cpufreq_governor(policy, CPUFREQ_GOV_LIMITS))) {
>                         pr_err("%s: Failed to start governor\n", __func__);
> @@ -1204,7 +1209,7 @@ static int __cpufreq_remove_dev(struct device *dev,
>                 return -EINVAL;
>         }
>
> -       if (cpufreq_driver->target) {
> +       if (has_target()) {
>                 ret = __cpufreq_governor(policy, CPUFREQ_GOV_STOP);
>                 if (ret) {
>                         pr_err("%s: Failed to stop governor\n", __func__);
> @@ -1244,7 +1249,7 @@ static int __cpufreq_remove_dev(struct device *dev,
>
>         /* If cpu is last user of policy, free policy */
>         if (cpus == 1) {
> -               if (cpufreq_driver->target) {
> +               if (has_target()) {
>                         ret = __cpufreq_governor(policy,
>                                         CPUFREQ_GOV_POLICY_EXIT);
>                         if (ret) {
> @@ -1282,7 +1287,7 @@ static int __cpufreq_remove_dev(struct device *dev,
>                 if (!frozen)
>                         cpufreq_policy_free(policy);
>         } else {
> -               if (cpufreq_driver->target) {
> +               if (has_target()) {
>                         if ((ret = __cpufreq_governor(policy, CPUFREQ_GOV_START)) ||
>                                         (ret = __cpufreq_governor(policy, CPUFREQ_GOV_LIMITS))) {
>                                 pr_err("%s: Failed to start governor\n",
> @@ -1646,11 +1651,39 @@ int __cpufreq_driver_target(struct cpufreq_policy *policy,
>         pr_debug("target for CPU %u: %u kHz, relation %u, requested %u kHz\n",
>                         policy->cpu, target_freq, relation, old_target_freq);
>
> +       /*
> +        * This might look like a redundant call as we are checking it again
> +        * after finding index. But it is left intentionally for cases where
> +        * exactly same freq is called again and so we can save on few function
> +        * calls.
> +        */
>         if (target_freq == policy->cur)
>                 return 0;
>
>         if (cpufreq_driver->target)
>                 retval = cpufreq_driver->target(policy, target_freq, relation);
> +       else if (cpufreq_driver->target_index) {
> +               struct cpufreq_frequency_table *freq_table;
> +               int index;
> +
> +               freq_table = cpufreq_frequency_get_table(policy->cpu);
> +               if (unlikely(!freq_table)) {
> +                       pr_err("%s: Unable to find freq_table\n", __func__);
> +                       return retval;
> +               }
> +
> +               retval = cpufreq_frequency_table_target(policy, freq_table,
> +                               target_freq, relation, &index);
> +               if (unlikely(retval)) {
> +                       pr_err("%s: Unable to find matching freq\n", __func__);
> +                       return retval;
> +               }
> +
> +               if (freq_table[index].frequency == policy->cur)
> +                       return 0;
> +
> +               retval = cpufreq_driver->target_index(policy, index);
> +       }
>
>         return retval;
>  }
> @@ -1983,7 +2016,7 @@ int cpufreq_update_policy(unsigned int cpu)
>                         pr_debug("Driver did not initialize current freq");
>                         policy->cur = new_policy.cur;
>                 } else {
> -                       if (policy->cur != new_policy.cur && cpufreq_driver->target)
> +                       if (policy->cur != new_policy.cur && has_target())
>                                 cpufreq_out_of_sync(cpu, policy->cur,
>                                                                 new_policy.cur);
>                 }
> @@ -2058,7 +2091,7 @@ int cpufreq_register_driver(struct cpufreq_driver *driver_data)
>                 return -ENODEV;
>
>         if (!driver_data || !driver_data->verify || !driver_data->init ||
> -           ((!driver_data->setpolicy) && (!driver_data->target)))
> +           (!driver_data->setpolicy && !has_target()))
>                 return -EINVAL;
>
>         pr_debug("trying to register driver %s\n", driver_data->name);
> diff --git a/include/linux/cpufreq.h b/include/linux/cpufreq.h
> index 4907eb2..ff9c8df 100644
> --- a/include/linux/cpufreq.h
> +++ b/include/linux/cpufreq.h
> @@ -195,9 +195,11 @@ struct cpufreq_driver {
>
>         /* define one out of two */
>         int     (*setpolicy)    (struct cpufreq_policy *policy);
> -       int     (*target)       (struct cpufreq_policy *policy,
> +       int     (*target)       (struct cpufreq_policy *policy, /* Deprecated */
>                                  unsigned int target_freq,
>                                  unsigned int relation);
> +       int     (*target_index) (struct cpufreq_policy *policy,
> +                                unsigned int index);
>
>         /* should be defined, if possible */
>         unsigned int    (*get)  (unsigned int cpu);
> --
> 1.7.12.rc2.18.g61b472e
>
> --
> To unsubscribe from this list: send the line "unsubscribe linux-pm" in
> the body of a message to majordomo at vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html

  reply	other threads:[~2013-08-18 10:42 UTC|newest]

Thread overview: 343+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <a>
2011-04-19 11:43 ` [PATCH 0/3 V3] Introduce strtobool (previously usr_strtobool) Jonathan Cameron
2011-04-19 11:43 ` [PATCH 1/3] Add a strtobool function matching semantics of existing in kernel equivalents Jonathan Cameron
2011-04-19 20:28   ` Ryan Mallon
2011-04-19 11:43 ` [PATCH 2/3] debugfs: move to new strtobool Jonathan Cameron
2011-04-19 20:30   ` Ryan Mallon
2011-04-20  9:33     ` Jonathan Cameron
2011-04-25 22:54       ` Greg KH
2011-04-25 23:11         ` Ryan Mallon
2011-04-19 11:43 ` [PATCH 3/3] params.c: Use new strtobool function to process boolean inputs Jonathan Cameron
2011-11-22 15:54 ` [PATCH v7 0/3] ARM: mxs: add recording support for saif Dong Aisheng
2011-11-22 15:54   ` Dong Aisheng
2011-11-24  7:36   ` Shawn Guo
2011-11-24  7:36     ` Shawn Guo
2011-11-24  7:46     ` Shawn Guo
2011-11-24  7:46       ` Shawn Guo
2011-11-24  7:41       ` Uwe Kleine-König
2011-11-24  7:41         ` Uwe Kleine-König
2011-11-24  7:49       ` Wolfram Sang
2011-11-24  7:49         ` Wolfram Sang
2011-11-24  8:23         ` Shawn Guo
2011-11-24  8:23           ` Shawn Guo
2011-11-24 10:46           ` Wolfram Sang
2011-11-24 10:46             ` Wolfram Sang
2011-11-22 15:54 ` [PATCH v7 1/3] ARM: mxs: add saif clkmux functions Dong Aisheng
2011-11-22 15:54   ` Dong Aisheng
2011-11-22 15:54 ` [PATCH v7 2/3] ARM: mx28evk: add platform data for saif Dong Aisheng
2011-11-22 15:54   ` Dong Aisheng
2011-11-22 15:54 ` [PATCH v7 3/3] ARM: mx28evk: set a initial clock rate " Dong Aisheng
2011-11-22 15:54   ` Dong Aisheng
2011-11-30  8:16 ` [meta-efl 00/11] efl upgrade Martin Jansa
2011-11-30  8:16   ` [meta-efl 01/11] elsa: add sessreg xauth to RDEPENDS Martin Jansa
2011-11-30  8:16   ` [meta-efl 02/11] elsa: add elsa.conf to CONFFILES Martin Jansa
2011-11-30  8:16   ` [meta-efl 03/11] elsa: use common-* instead of system-auth in pam config Martin Jansa
2011-11-30  8:16   ` [meta-efl 04/11] e-base: bump EFL_SRCREV for 1.1.0 alpha versions Martin Jansa
2011-11-30  8:16   ` [meta-efl 05/11] efl.bbclass: don't remove STAGING_LIBDIR STAGING_INCDIR from efl pkgconfig files Martin Jansa
2011-11-30  8:16   ` [meta-efl 06/11] epdf: drop upstream applied patch and ewl is gone too Martin Jansa
2011-11-30  8:16   ` [meta-efl 07/11] eeze: pass /bin/true instead of eject which is not available Martin Jansa
2011-11-30  9:27     ` Koen Kooi
2011-12-01  9:00       ` Martin Jansa
2011-11-30  8:16   ` [meta-efl 08/11] edje: fix license metadata Martin Jansa
2011-11-30  8:16   ` [meta-efl 09/11] elementary: " Martin Jansa
2011-11-30  8:16   ` [meta-efl 10/11] elementary: add gettextize patch Martin Jansa
2011-11-30  8:16   ` [meta-efl 11/11] elementary: disable web support Martin Jansa
2011-11-30  9:28     ` Koen Kooi
2011-11-30 10:34       ` Martin Jansa
2012-02-19 14:24 ` [Qemu-devel] [PATCH 2/2] qemu-io: fix segment fault when the image format is qed zwu.kernel
2012-02-19 21:24   ` Christoph Hellwig
2012-02-20  6:22     ` Zhi Yong Wu
2012-03-13 12:33 ` [PATCH 1/5 v4] i2c/gpio: add DT support Jean-Christophe PLAGNIOL-VILLARD
2012-03-13 12:33   ` Jean-Christophe PLAGNIOL-VILLARD
     [not found]   ` <1331642024-19869-1-git-send-email-plagnioj-sclMFOaUSTBWk0Htik3J/w@public.gmane.org>
2012-03-13 14:08     ` Wolfram Sang
2012-03-13 14:08       ` Wolfram Sang
     [not found]       ` <20120313140822.GD2488-bIcnvbaLZ9MEGnE8C9+IrQ@public.gmane.org>
2012-03-13 16:47         ` Jean-Christophe PLAGNIOL-VILLARD
2012-03-13 16:47           ` Jean-Christophe PLAGNIOL-VILLARD
     [not found]           ` <20120313164756.GF18320-RQcB7r2h9QmfDR2tN2SG5Ni2O/JbrIOy@public.gmane.org>
2012-03-13 19:46             ` Wolfram Sang
2012-03-13 19:46               ` Wolfram Sang
2012-03-15 15:56     ` [PATCH 1/5 v5] " Jean-Christophe PLAGNIOL-VILLARD
2012-03-15 15:56       ` Jean-Christophe PLAGNIOL-VILLARD
2012-03-13 12:33 ` [PATCH 2/5 v4] ARM: at91: sam9g20 add i2c " Jean-Christophe PLAGNIOL-VILLARD
2012-03-13 12:33   ` Jean-Christophe PLAGNIOL-VILLARD
2012-03-13 12:33 ` [PATCH 3/5 v4] ARM: at91: usb_a9g20 add DT i2c support Jean-Christophe PLAGNIOL-VILLARD
2012-03-13 12:33   ` Jean-Christophe PLAGNIOL-VILLARD
2012-03-13 12:33 ` [PATCH 4/5 v4] ARM: at91: sam9g45 add i2c DT support Jean-Christophe PLAGNIOL-VILLARD
2012-03-13 12:33   ` Jean-Christophe PLAGNIOL-VILLARD
2012-03-13 12:33 ` [PATCH 5/5 v4] ARM: at91: sam9x5 " Jean-Christophe PLAGNIOL-VILLARD
2012-03-13 12:33   ` Jean-Christophe PLAGNIOL-VILLARD
2012-07-05  6:28 ` [PATCH] mm/memcg: replace inexistence move_lock_page_cgroup() by move_lock_mem_cgroup() in comment Wanpeng Li
2012-07-05  6:28   ` Wanpeng Li
2012-07-09  4:37   ` Kamezawa Hiroyuki
2012-07-09  4:37     ` Kamezawa Hiroyuki
2012-07-11 13:24 ` [PATCH RFC] mm/memcg: calculate max hierarchy limit number instead of min Wanpeng Li
2012-07-11 13:24   ` Wanpeng Li
2012-07-11 13:47   ` Michal Hocko
2012-07-11 13:47     ` Michal Hocko
2012-07-12  9:32     ` Wanpeng Li
2012-07-12  9:32       ` Wanpeng Li
2012-07-12  9:32       ` Wanpeng Li
2012-07-12 10:18       ` Michal Hocko
2012-07-12 10:18         ` Michal Hocko
2012-07-12 10:18         ` Michal Hocko
2012-07-19  6:07   ` Kamezawa Hiroyuki
2012-07-19  6:07     ` Kamezawa Hiroyuki
2012-07-19  6:30     ` Wanpeng Li
2012-07-19  6:30       ` Wanpeng Li
2012-07-19  6:30       ` Wanpeng Li
2012-07-17 16:00 ` [PATCH V2 0/3] Update connman to v1.3, fix dependencies and runtime Andrei Gherzan
2012-07-17 16:03   ` [PATCH V2 1/3] connman: Update to version 1.3 Andrei Gherzan
2012-07-17 16:03   ` [PATCH V2 2/3] connman.inc: Add missing dependencies needed by some tests Andrei Gherzan
2012-07-17 16:03   ` [PATCH V2 3/3] connman: Add patches to fix connman on fs with no d_type support Andrei Gherzan
2012-07-18  3:05 ` [PATCH] mm/memcg: wrap mem_cgroup_from_css function Wanpeng Li
2012-07-18  3:05   ` Wanpeng Li
2012-07-18 21:36   ` Andrew Morton
2012-07-18 21:36     ` Andrew Morton
2012-07-19  1:31     ` Wanpeng Li
2012-07-19  1:31       ` Wanpeng Li
2012-07-19  9:14   ` Kirill A. Shutemov
2012-07-19  9:14     ` Kirill A. Shutemov
2012-07-19  9:23     ` Wanpeng Li
2012-07-19  9:23       ` Wanpeng Li
2012-07-19  9:29       ` Kirill A. Shutemov
2012-07-19  9:29         ` Kirill A. Shutemov
2012-07-19  9:38       ` Gavin Shan
2012-07-19  9:45         ` Kirill A. Shutemov
2012-07-19  9:45           ` Kirill A. Shutemov
2012-07-19 10:19         ` Wanpeng Li
2012-07-19 10:19           ` Wanpeng Li
2012-07-19  9:38       ` Gavin Shan
2012-09-05 12:04 ` [PATCH] drm: use %*ph to dump small buffers Andy Shevchenko
2012-09-23 19:24 ` [PATCH 1/6] xfstest: add fio git submodule Dmitry Monakhov
2012-09-23 19:24   ` Dmitry Monakhov
2012-09-23 19:24   ` [PATCH 2/6] xfstest: add configurable load factors Dmitry Monakhov
2012-09-23 19:24     ` Dmitry Monakhov
2012-09-23 19:24   ` [PATCH 3/6] xfstest: allow fsstress to use load factor where appropriate Dmitry Monakhov
2012-09-23 19:24     ` Dmitry Monakhov
2012-09-23 19:24   ` [PATCH 4/6] xfstest add fallocate/truncate vs AIO/DIO stress test Dmitry Monakhov
2012-09-23 19:24     ` Dmitry Monakhov
2012-09-23 19:24   ` [PATCH 5/6] xfstest: add fallocate/punch_hole " Dmitry Monakhov
2012-09-23 19:24     ` Dmitry Monakhov
2012-09-23 19:24   ` [PATCH 6/6] xfstest: add defragmentation stress test for ext4 Dmitry Monakhov
2012-09-23 19:24     ` Dmitry Monakhov
2012-09-24  3:16   ` [PATCH 1/6] xfstest: add fio git submodule Eric Sandeen
2012-09-24  3:16     ` Eric Sandeen
2012-09-24 10:03     ` Dmitry Monakhov
2012-09-24 10:03       ` Dmitry Monakhov
2012-09-24 11:37       ` Dave Chinner
2012-09-24 11:37         ` Dave Chinner
2012-09-24 12:38         ` Dmitry Monakhov
2012-09-24 12:38           ` Dmitry Monakhov
2012-09-24 13:53           ` Dave Chinner
2012-09-24 13:53             ` Dave Chinner
2012-09-24 12:23     ` Greg Freemyer
2012-09-24 12:23       ` Greg Freemyer
2012-09-24 12:41       ` Dmitry Monakhov
2012-09-24 12:41         ` Dmitry Monakhov
2012-11-05 19:53 ` [PATCH] can: ti_hecc: WIP: fix out-of-order problem - CANMIN Version Marc Kleine-Budde
2012-11-07 12:10   ` AnilKumar, Chimata
2012-11-07 12:27     ` Marc Kleine-Budde
2012-11-07 13:56       ` AnilKumar, Chimata
2012-11-07 14:16         ` Marc Kleine-Budde
2013-02-14  8:36 ` [PATCH 1/4] powerpc: Make VSID_BITS* dependency explicit Aneesh Kumar K.V
2013-02-14  8:36   ` [PATCH 2/4] powerpc: Update kernel VSID range Aneesh Kumar K.V
2013-02-14 17:21     ` Aneesh Kumar K.V
2013-02-15  4:42     ` Paul Mackerras
2013-02-14  8:36   ` [PATCH 3/4] powerpc: Don't update r10 early in the call Aneesh Kumar K.V
2013-02-14  8:36   ` [PATCH 4/4] powerpc: Add vm debug code to catch errors Aneesh Kumar K.V
2013-02-15  4:46     ` Paul Mackerras
2013-08-13 13:31 ` [PATCH V2 00/35] CPUFreq: Implement light weight ->target(): for 3.13 Viresh Kumar
2013-08-13 13:43   ` Viresh Kumar
2013-08-13 13:31   ` Viresh Kumar
2013-08-13 13:32   ` [PATCH V2 01/35] cpufreq: Implement light weight ->target_index() routine Viresh Kumar
2013-08-13 13:44     ` Viresh Kumar
2013-08-13 13:32     ` Viresh Kumar
2013-08-18 10:41     ` amit daniel kachhap [this message]
2013-08-18 10:53       ` amit daniel kachhap
2013-08-18 10:41       ` amit daniel kachhap
2013-08-18 10:41       ` amit daniel kachhap
2013-08-19  4:37       ` Viresh Kumar
2013-08-19  4:37         ` Viresh Kumar
2013-08-19  6:16         ` amit daniel kachhap
2013-08-19  6:16           ` amit daniel kachhap
2013-08-19  6:19           ` Viresh Kumar
2013-08-19  6:19             ` Viresh Kumar
2013-08-19  6:46             ` amit daniel kachhap
2013-08-19  6:46               ` amit daniel kachhap
2013-08-19  6:49               ` Viresh Kumar
2013-08-19  6:49                 ` Viresh Kumar
2013-08-13 13:32   ` [PATCH V2 02/35] cpufreq: remove CONFIG_CPU_FREQ_TABLE Viresh Kumar
2013-08-13 13:32     ` Viresh Kumar
2013-08-13 13:32   ` [PATCH V2 03/35] cpufreq: acpi: Covert to light weight ->target_index() routine Viresh Kumar
2013-08-13 13:32     ` Viresh Kumar
2013-08-13 13:32   ` [PATCH V2 04/35] cpufreq: arm_big_little: " Viresh Kumar
2013-08-13 13:32     ` Viresh Kumar
2013-08-13 13:32     ` Viresh Kumar
2013-08-13 13:32   ` [PATCH V2 05/35] cpufreq: at32ap: " Viresh Kumar
2013-08-13 13:32     ` Viresh Kumar
2013-08-14  8:00     ` Hans-Christian Egtvedt
2013-08-14  8:00       ` Hans-Christian Egtvedt
2013-08-13 13:32   ` [PATCH V2 06/35] cpufreq: blackfin: " Viresh Kumar
2013-08-13 13:32     ` Viresh Kumar
2013-08-13 13:32   ` [PATCH V2 07/35] cpufreq: cpu0: " Viresh Kumar
2013-08-13 13:32     ` Viresh Kumar
2013-08-13 13:32   ` [PATCH V2 08/35] cpufreq: cris: " Viresh Kumar
2013-08-13 13:32     ` Viresh Kumar
2013-08-13 13:32   ` [PATCH V2 09/35] cpufreq: davinci: " Viresh Kumar
2013-08-13 13:32     ` Viresh Kumar
2013-08-13 13:32   ` [PATCH V2 10/35] cpufreq: dbx500: " Viresh Kumar
2013-08-13 13:32     ` Viresh Kumar
2013-08-13 13:32   ` [PATCH V2 11/35] cpufreq: e_powersaver: " Viresh Kumar
2013-08-13 13:32     ` Viresh Kumar
2013-08-13 13:32   ` [PATCH V2 12/35] cpufreq: elanfreq: " Viresh Kumar
2013-08-13 13:32     ` Viresh Kumar
2013-08-13 13:32   ` [PATCH V2 13/35] cpufreq: exynos: " Viresh Kumar
2013-08-13 13:32     ` Viresh Kumar
2013-08-13 13:32   ` [PATCH V2 14/35] cpufreq: ia64: " Viresh Kumar
2013-08-13 13:32     ` Viresh Kumar
2013-08-13 13:32   ` [PATCH V2 15/35] cpufreq: imx6q: " Viresh Kumar
2013-08-13 13:32     ` Viresh Kumar
2013-08-13 13:32   ` [PATCH V2 16/35] cpufreq: kirkwood: " Viresh Kumar
2013-08-13 13:32     ` Viresh Kumar
2013-08-13 13:32   ` [PATCH V2 17/35] cpufreq: longhaul: " Viresh Kumar
2013-08-13 13:32     ` Viresh Kumar
2013-08-13 13:32   ` [PATCH V2 18/35] cpufreq: loongson2: " Viresh Kumar
2013-08-13 13:32     ` Viresh Kumar
2013-08-13 13:32   ` [PATCH V2 19/35] cpufreq: maple: " Viresh Kumar
2013-08-13 13:32     ` Viresh Kumar
2013-08-13 13:32   ` [PATCH V2 20/35] cpufreq: omap: " Viresh Kumar
2013-08-13 13:32     ` Viresh Kumar
2013-08-13 13:32   ` [PATCH V2 21/35] cpufreq: p4: " Viresh Kumar
2013-08-13 13:32     ` Viresh Kumar
2013-08-13 13:32   ` [PATCH V2 22/35] cpufreq: pasemi: " Viresh Kumar
2013-08-13 13:32     ` Viresh Kumar
2013-08-13 13:32   ` [PATCH V2 23/35] cpufreq: pmac32: " Viresh Kumar
2013-08-13 13:32     ` Viresh Kumar
2013-08-13 13:32   ` [PATCH V2 24/35] cpufreq: powernow: " Viresh Kumar
2013-08-13 13:32     ` Viresh Kumar
2013-08-13 13:32   ` [PATCH V2 25/35] cpufreq: ppc: " Viresh Kumar
2013-08-13 13:32     ` Viresh Kumar
2013-08-13 13:32   ` [PATCH V2 26/35] cpufreq: pxa: " Viresh Kumar
2013-08-13 13:32     ` Viresh Kumar
2013-08-13 13:32   ` [PATCH V2 27/35] cpufreq: s3c2416: " Viresh Kumar
2013-08-13 13:32     ` Viresh Kumar
2013-08-13 13:32   ` [PATCH V2 28/35] cpufreq: s3c64xx: " Viresh Kumar
2013-08-13 13:32     ` Viresh Kumar
2013-08-13 13:32   ` [PATCH V2 29/35] cpufreq: s5pv210: " Viresh Kumar
2013-08-13 13:32     ` Viresh Kumar
2013-08-13 13:32   ` [PATCH V2 30/35] cpufreq: sa11x0: " Viresh Kumar
2013-08-13 13:32     ` Viresh Kumar
2013-08-13 13:32   ` [PATCH V2 31/35] cpufreq: sc520: " Viresh Kumar
2013-08-13 13:32     ` Viresh Kumar
2013-08-13 13:32   ` [PATCH V2 32/35] cpufreq: sparc: " Viresh Kumar
2013-08-13 13:44     ` Viresh Kumar
2013-08-13 13:32     ` Viresh Kumar
2013-08-13 13:32   ` [PATCH V2 33/35] cpufreq: SPEAr: " Viresh Kumar
2013-08-13 13:32     ` Viresh Kumar
2013-08-13 13:32   ` [PATCH V2 34/35] cpufreq: speedstep: " Viresh Kumar
2013-08-13 13:32     ` Viresh Kumar
2013-08-13 13:32   ` [PATCH V2 35/35] cpufreq: tegra: " Viresh Kumar
2013-08-13 13:32     ` Viresh Kumar
2013-08-13 13:46   ` [PATCH V2 00/35] CPUFreq: Implement light weight ->target(): for 3.13 Viresh Kumar
2013-08-13 13:58     ` Viresh Kumar
2013-08-13 13:46     ` Viresh Kumar
2013-08-14  5:29   ` Viresh Kumar
2013-08-14  5:29     ` Viresh Kumar
2013-11-06  0:11 ` [PATCH v4 1/5] iio: hid-sensors: accelerometer: Add sensitivity Srinivas Pandruvada
2013-11-06  0:11   ` [PATCH v4 2/5] iio: hid-sensors: gyro : " Srinivas Pandruvada
2013-11-06  0:11   ` [PATCH v4 3/5] iio: hid-sensors: light/als " Srinivas Pandruvada
2013-11-06  0:11   ` [PATCH v4 4/5] iio: hid-sensors: magnetometer " Srinivas Pandruvada
2013-11-09 11:56     ` Jonathan Cameron
2013-11-06  0:11   ` [PATCH v4 5/5] iio: hid-sensors: Added Inclinometer 3D Srinivas Pandruvada
2013-11-09 12:11     ` Jonathan Cameron
2013-12-03 20:37       ` Jonathan Cameron
2014-01-03  3:01 ` [PATCH 0/3] mtd: gpmi: add subpage read support Huang Shijie
2014-01-03  3:01   ` Huang Shijie
2014-02-21  6:51   ` Huang Shijie
2014-02-21  6:51     ` Huang Shijie
2014-03-07  7:27   ` Brian Norris
2014-03-07  7:27     ` Brian Norris
2014-03-07  7:32     ` Huang Shijie
2014-03-07  7:32       ` Huang Shijie
2014-03-07  7:34       ` Brian Norris
2014-03-07  7:34         ` Brian Norris
2014-01-03  3:01 ` [PATCH 1/3] mtd: nand: add "page" argument for read_subpage hook Huang Shijie
2014-01-03  3:01   ` Huang Shijie
2014-01-03  3:01 ` [PATCH 2/3] mtd: gpmi: do not use the mtd->writesize Huang Shijie
2014-01-03  3:01   ` Huang Shijie
2014-01-03  3:01 ` [PATCH 3/3] mtd: gpmi: add subpage read support Huang Shijie
2014-01-03  3:01   ` Huang Shijie
2014-04-23 10:16 ` [PATCH v1 0/7] mtd: spi-nor: Add the DDR quad " Huang Shijie
2014-04-23 10:16   ` Huang Shijie
2014-04-23 10:16   ` Huang Shijie
2014-04-23 10:16   ` Huang Shijie
2014-04-23 10:16 ` [PATCH v1 1/7] mtd: spi-nor: fix the wrong dummy value Huang Shijie
2014-04-23 10:16   ` Huang Shijie
2014-04-23 10:16   ` Huang Shijie
2014-04-23 10:16   ` Huang Shijie
2014-04-23 19:41   ` Marek Vasut
2014-04-23 19:41     ` Marek Vasut
2014-04-23 19:41     ` Marek Vasut
     [not found]     ` <201404232141.27005.marex-ynQEQJNshbs@public.gmane.org>
2014-04-24  4:50       ` Huang Shijie
2014-04-24  4:50         ` Huang Shijie
2014-04-24  4:50         ` Huang Shijie
2014-04-24  4:50         ` Huang Shijie
2014-04-24 13:45         ` Marek Vasut
2014-04-24 13:45           ` Marek Vasut
2014-04-24 13:45           ` Marek Vasut
2014-04-23 10:16 ` [PATCH v1 2/7] mtd: spi-nor: add DDR quad read support Huang Shijie
2014-04-23 10:16   ` Huang Shijie
2014-04-23 10:16   ` Huang Shijie
2014-04-23 10:16   ` Huang Shijie
     [not found]   ` <1398248215-26768-3-git-send-email-b32955-KZfg59tc24xl57MIdRCFDg@public.gmane.org>
2014-04-23 19:45     ` Marek Vasut
2014-04-23 19:45       ` Marek Vasut
2014-04-23 19:45       ` Marek Vasut
2014-04-24  4:53       ` Huang Shijie
2014-04-24  4:53         ` Huang Shijie
2014-04-24  4:53         ` Huang Shijie
2014-04-24  4:53         ` Huang Shijie
2014-04-24 13:43         ` Marek Vasut
2014-04-24 13:43           ` Marek Vasut
2014-04-24 13:43           ` Marek Vasut
     [not found]           ` <201404241543.51752.marex-ynQEQJNshbs@public.gmane.org>
2014-04-24 14:26             ` Huang Shijie
2014-04-24 14:26               ` Huang Shijie
2014-04-24 14:26               ` Huang Shijie
2014-04-23 10:16 ` [PATCH v1 3/7] Documentation: mtd: add a new document for SPI NOR flash Huang Shijie
2014-04-23 10:16   ` Huang Shijie
2014-04-23 10:16   ` Huang Shijie
2014-04-23 10:16 ` [PATCH v1 4/7] Documentation: fsl-quadspi: update the document Huang Shijie
2014-04-23 10:16   ` Huang Shijie
2014-04-23 10:16   ` Huang Shijie
2014-04-23 10:16   ` Huang Shijie
2014-04-23 10:16 ` [PATCH v1 5/7] mtd: fsl-quadspi: get the dummy cycles for DDR Quad read from the DT property Huang Shijie
2014-04-23 10:16   ` Huang Shijie
2014-04-23 10:16   ` Huang Shijie
2014-04-23 10:16   ` Huang Shijie
2014-04-23 19:48   ` Marek Vasut
2014-04-23 19:48     ` Marek Vasut
2014-04-23 19:48     ` Marek Vasut
     [not found]     ` <201404232148.51034.marex-ynQEQJNshbs@public.gmane.org>
2014-04-24  4:58       ` Huang Shijie
2014-04-24  4:58         ` Huang Shijie
2014-04-24  4:58         ` Huang Shijie
2014-04-24  4:58         ` Huang Shijie
2014-04-24 13:41         ` Marek Vasut
2014-04-24 13:41           ` Marek Vasut
2014-04-24 13:41           ` Marek Vasut
2014-04-24 14:27           ` Huang Shijie
2014-04-24 14:27             ` Huang Shijie
2014-04-24 14:27             ` Huang Shijie
2014-04-23 10:16 ` [PATCH v1 6/7] mtd: fsl-quadspi: use the information stored in spi-nor{} Huang Shijie
2014-04-23 10:16   ` Huang Shijie
2014-04-23 10:16   ` Huang Shijie
2014-04-23 10:16   ` Huang Shijie
2014-04-23 10:16 ` [PATCH v1 7/7] mtd: fsl-quadspi: add the DDR quad read support Huang Shijie
2014-04-23 10:16   ` Huang Shijie
2014-04-23 10:16   ` Huang Shijie
2014-04-23 10:16   ` Huang Shijie
2014-09-12 11:21 ` [Qemu-devel] [PATCHv2 0/4] introduce max_transfer_length Peter Lieven
2014-09-12 11:21   ` [Qemu-devel] [PATCHv2 1/4] BlockLimits: " Peter Lieven
2014-09-12 11:21   ` [Qemu-devel] [PATCHv2 2/4] block: immediately cancel oversized read/write requests Peter Lieven
2014-09-12 11:21   ` [Qemu-devel] [PATCHv2 3/4] block/iscsi: set max_transfer_length Peter Lieven
2014-09-12 11:21   ` [Qemu-devel] [PATCHv2 4/4] block: avoid creating oversized writes in multiwrite_merge Peter Lieven
2015-12-17 13:35 ` [PATCH net 0/2] Mellanox mlx4 driver fixes Or Gerlitz
2015-12-17 13:35   ` [PATCH net 1/2] net/mlx4_en: Remove dependency between timestamping capability and service_task Or Gerlitz
2015-12-17 13:35   ` [PATCH net 2/2] net/mlx4_en: Fix HW timestamp init issue upon system startup Or Gerlitz
2015-12-18 19:48   ` [PATCH net 0/2] Mellanox mlx4 driver fixes David Miller

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='CADGdYn4=si46x7b5Qa0EJ1vUDKrP3maXBqWwQ6s7gkep-8MxFg@mail.gmail.com' \
    --to=amit.daniel@samsung.com \
    --cc=andrew@lunn.ch \
    --cc=blogic@openwrt.org \
    --cc=cpufreq@vger.kernel.org \
    --cc=davem@davemloft.net \
    --cc=dbaryshkov@gmail.com \
    --cc=egtvedt@samfundet.no \
    --cc=eric.y.miao@gmail.com \
    --cc=jesper.nilsson@axis.com \
    --cc=kgene.kim@samsung.com \
    --cc=linaro-kernel@lists.linaro.org \
    --cc=linus.walleij@linaro.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-cris-kernel@axis.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-pm@vger.kernel.org \
    --cc=nsekhar@ti.com \
    --cc=patches@linaro.org \
    --cc=realmz6@gmail.com \
    --cc=rjw@sisk.pl \
    --cc=santosh.shilimkar@ti.com \
    --cc=shawn.guo@linaro.org \
    --cc=sparclinux@vger.kernel.org \
    --cc=starvik@axis.com \
    --cc=swarren@nvidia.com \
    --cc=tony.luck@intel.com \
    --cc=viresh.kumar@linaro.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.