From: Jonghwan Choi <jhbird.choi@samsung.com>
To: 'Nishanth Menon' <nm@ti.com>
Cc: 'Viresh Kumar' <viresh.kumar@linaro.org>,
'Linux PM list' <linux-pm@vger.kernel.org>,
'open list' <linux-kernel@vger.kernel.org>,
"'Rafael J. Wysocki'" <rjw@rjwysocki.net>,
'Len Brown' <len.brown@intel.com>,
'Amit Daniel Kachhap' <amit.daniel@samsung.com>
Subject: RE: [PATCH 1/3] PM / OPP: Add support for descending order for cpufreq table
Date: Thu, 08 May 2014 11:07:24 +0900 [thread overview]
Message-ID: <000301cf6a62$413c16b0$c3b44410$@samsung.com> (raw)
In-Reply-To: <CAGo_u6rAY1Cqh6_1RPsjGMwqNSVr=yW+VgyXfEjA6V+LT-SMcQ@mail.gmail.com>
I believe that 3 item is required for DVFS. Those are frequency, voltage, divider value.
Currently OPP only supports voltage and frequency.
So some cpufreq and devfreq driver get a divider value from struct divider table.
How about adding that divider value into struct dev_pm_opp like this;
struct dev_pm_opp {
struct list_head node;
bool available;
unsigned long rate;
unsigned long u_volt;
unsigned int ctl[2]; // Added
struct device_opp *dev_opp;
struct rcu_head head;
};
In my test, it works very wel..
I got a this idea from _PCT in acpi spec.
Then we can remove a lot of code related to divide table. And we also can solve this problem.
Thanks
Best Regarfs.
> -----Original Message-----
> From: menon.nishanth@gmail.com [mailto:menon.nishanth@gmail.com] On Behalf
> Of Nishanth Menon
> Sent: Thursday, May 08, 2014 10:56 AM
> To: Jonghwan Choi
> Cc: Viresh Kumar; Linux PM list; open list; Rafael J. Wysocki; Len Brown;
> Amit Daniel Kachhap
> Subject: Re: [PATCH 1/3] PM / OPP: Add support for descending order for
> cpufreq table
>
> On Wed, May 7, 2014 at 8:22 PM, Jonghwan Choi <jhbird.choi@samsung.com>
> wrote:
> >> @Jonghwan: Please consider doing this:
> >> - Don't play with the order of frequencies in table.
> >> - Instead initialize .driver_data filed with values that you need to
> >> write in the registers for all frequencies. i.e. 0 for highest
> >> frequency and
> >> FREQ_COUNT-1 for lowest one.
> >
> > -> For that, I changed like this.
> > For initializing .driver_data, I changed dev_pm_opp_init_cpufreq_table
> function().
> >
> >
> > --- a/drivers/base/power/opp.c
> > +++ b/drivers/base/power/opp.c
> > @@ -622,12 +622,12 @@ EXPORT_SYMBOL_GPL(dev_pm_opp_disable);
> > * or in contexts where mutex locking cannot be used.
> > */
> > int dev_pm_opp_init_cpufreq_table(struct device *dev,
> > - struct cpufreq_frequency_table **table)
> > + struct cpufreq_frequency_table **table, int order)
> > {
> > struct device_opp *dev_opp;
> > struct dev_pm_opp *opp;
> > struct cpufreq_frequency_table *freq_table;
> > - int i = 0;
> > + int i = 0, index = 0;
> >
> > /* Pretend as if I am an updater */
> > mutex_lock(&dev_opp_list_lock); @@ -649,16 +649,22 @@ int
> > dev_pm_opp_init_cpufreq_table(struct device *dev,
> > return -ENOMEM;
> > }
> >
> > + if (OPP_TABLE_ORDER_DESCENDING == order)
> > + index = dev_pm_opp_get_opp_count(dev) - 1;
> > +
> > list_for_each_entry(opp, &dev_opp->opp_list, node) {
> > if (opp->available) {
> > - freq_table[i].driver_data = i;
> > + if (OPP_TABLE_ORDER_DESCENDING == order)
> > + freq_table[i].driver_data = index--;
> > + else
> > + freq_table[i].driver_data = index++;
> > freq_table[i].frequency = opp->rate / 1000;
> > i++;
> > }
> > }
> > mutex_unlock(&dev_opp_list_lock);
> >
> > - freq_table[i].driver_data = i;
> > + freq_table[i].driver_data = index;
> > freq_table[i].frequency = CPUFREQ_TABLE_END;
> >
> > *table = &freq_table[0];
> >
> >
> > Is it acceptiable?
>
> Personally, I feel that filling up driver_data should be left to the
> driver(caller of dev_pm_opp_init_cpufreq_table). for example providing a
> function pointer which decides what that value should be (be it index or
> some magical register value).. Viresh might have better opinions.
>
> Regards,
> Nishanth Menon
next prev parent reply other threads:[~2014-05-08 2:07 UTC|newest]
Thread overview: 23+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <000001cf643d$69e5e350$3db1a9f0$@samsung.com>
2014-04-30 8:25 ` [PATCH 1/3] PM / OPP: Add support for descending order for cpufreq table Viresh Kumar
2014-05-03 0:16 ` Jonghwan Choi
2014-05-05 5:54 ` Viresh Kumar
2014-05-05 13:38 ` Nishanth Menon
2014-05-05 14:14 ` Viresh Kumar
2014-05-05 14:23 ` Nishanth Menon
2014-05-05 14:38 ` Viresh Kumar
2014-05-05 14:46 ` Nishanth Menon
2014-05-06 23:43 ` Jonghwan Choi
2014-05-07 1:00 ` Nishanth Menon
2014-05-07 6:04 ` Viresh Kumar
2014-05-08 1:22 ` Jonghwan Choi
2014-05-08 1:55 ` Nishanth Menon
2014-05-08 2:07 ` Jonghwan Choi [this message]
2014-05-08 5:55 ` Viresh Kumar
2014-05-09 1:09 ` Jonghwan Choi
2014-05-09 6:00 ` Viresh Kumar
2014-05-09 11:59 ` jonghwan Choi
2014-05-09 13:23 ` Nishanth Menon
2014-05-11 11:38 ` jonghwan Choi
2014-05-12 6:18 ` Viresh Kumar
2014-05-08 5:50 ` Viresh Kumar
2014-05-06 17:25 ` Sudeep Holla
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='000301cf6a62$413c16b0$c3b44410$@samsung.com' \
--to=jhbird.choi@samsung.com \
--cc=amit.daniel@samsung.com \
--cc=len.brown@intel.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-pm@vger.kernel.org \
--cc=nm@ti.com \
--cc=rjw@rjwysocki.net \
--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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).