* [PATCH 1/2] PM / OPP: Use list_for_each_entry_reverse instead of list_for_each_entry
@ 2014-04-29 5:24 Jonghwan Choi
2014-04-29 5:32 ` Viresh Kumar
0 siblings, 1 reply; 4+ messages in thread
From: Jonghwan Choi @ 2014-04-29 5:24 UTC (permalink / raw)
To: open list; +Cc: 'Rafael J. Wysocki', 'Len Brown'
Most of the cpufreq table is sorted in descending order.
But when cpufreq table is made from dev_pm_opp_init_cpufreq_table,
it is sorted in ascending order. So in some case to make cpufreq table
with descending order it needs an extra work.
Signed-off-by: Jonghwan Choi <jhbird.choi@samsung.com>
---
drivers/base/power/opp.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/base/power/opp.c b/drivers/base/power/opp.c
index 2553867..8d81a46 100644
--- a/drivers/base/power/opp.c
+++ b/drivers/base/power/opp.c
@@ -649,7 +649,7 @@ int dev_pm_opp_init_cpufreq_table(struct device *dev,
return -ENOMEM;
}
- list_for_each_entry(opp, &dev_opp->opp_list, node) {
+ list_for_each_entry_reverse(opp, &dev_opp->opp_list, node) {
if (opp->available) {
freq_table[i].driver_data = i;
freq_table[i].frequency = opp->rate / 1000;
--
1.7.10.4
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [PATCH 1/2] PM / OPP: Use list_for_each_entry_reverse instead of list_for_each_entry
2014-04-29 5:24 [PATCH 1/2] PM / OPP: Use list_for_each_entry_reverse instead of list_for_each_entry Jonghwan Choi
@ 2014-04-29 5:32 ` Viresh Kumar
2014-04-29 5:50 ` Jonghwan Choi
0 siblings, 1 reply; 4+ messages in thread
From: Viresh Kumar @ 2014-04-29 5:32 UTC (permalink / raw)
To: Jonghwan Choi; +Cc: open list, Rafael J. Wysocki, Len Brown
On Tue, Apr 29, 2014 at 10:54 AM, Jonghwan Choi <jhbird.choi@samsung.com> wrote:
> Most of the cpufreq table is sorted in descending order.
Which part of kernel says that?
> But when cpufreq table is made from dev_pm_opp_init_cpufreq_table,
> it is sorted in ascending order. So in some case to make cpufreq table
> with descending order it needs an extra work.
Order of this table shouldn't matter at all in cpufreq layer..
^ permalink raw reply [flat|nested] 4+ messages in thread
* RE: [PATCH 1/2] PM / OPP: Use list_for_each_entry_reverse instead of list_for_each_entry
2014-04-29 5:32 ` Viresh Kumar
@ 2014-04-29 5:50 ` Jonghwan Choi
2014-04-29 6:10 ` Viresh Kumar
0 siblings, 1 reply; 4+ messages in thread
From: Jonghwan Choi @ 2014-04-29 5:50 UTC (permalink / raw)
To: 'Viresh Kumar'
Cc: 'open list', 'Rafael J. Wysocki',
'Len Brown'
Hi~
> > Most of the cpufreq table is sorted in descending order.
>
> Which part of kernel says that?
>
-> I couldn't check all. Sorry.
> > But when cpufreq table is made from dev_pm_opp_init_cpufreq_table, it
> > is sorted in ascending order. So in some case to make cpufreq table
> > with descending order it needs an extra work.
>
> Order of this table shouldn't matter at all in cpufreq layer..
-> You are right. But 5440 cpufreq driver write an index number instead of
clk divider value
for change DVFS. And our another(will submit) also write an index number for
changing DVFS.
As you said, order of table shouldn't matter at all in cpufreq layer. Then,
could this can be applied?
In our case, We want to use index 0 for P0 and index 1 for P1.....
Thanks
Best Ragrds.
> -----Original Message-----
> From: viresh.linux@gmail.com [mailto:viresh.linux@gmail.com] On Behalf Of
> Viresh Kumar
> Sent: Tuesday, April 29, 2014 2:33 PM
> To: Jonghwan Choi
> Cc: open list; Rafael J. Wysocki; Len Brown
> Subject: Re: [PATCH 1/2] PM / OPP: Use list_for_each_entry_reverse instead
> of list_for_each_entry
>
> On Tue, Apr 29, 2014 at 10:54 AM, Jonghwan Choi <jhbird.choi@samsung.com>
> wrote:
> > Most of the cpufreq table is sorted in descending order.
>
> Which part of kernel says that?
>
> > But when cpufreq table is made from dev_pm_opp_init_cpufreq_table, it
> > is sorted in ascending order. So in some case to make cpufreq table
> > with descending order it needs an extra work.
>
> Order of this table shouldn't matter at all in cpufreq layer..
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH 1/2] PM / OPP: Use list_for_each_entry_reverse instead of list_for_each_entry
2014-04-29 5:50 ` Jonghwan Choi
@ 2014-04-29 6:10 ` Viresh Kumar
0 siblings, 0 replies; 4+ messages in thread
From: Viresh Kumar @ 2014-04-29 6:10 UTC (permalink / raw)
To: Jonghwan Choi; +Cc: open list, Rafael J. Wysocki, Len Brown
On 29 April 2014 11:20, Jonghwan Choi <jhbird.choi@samsung.com> wrote:
> -> You are right. But 5440 cpufreq driver write an index number instead of
> clk divider value
> for change DVFS. And our another(will submit) also write an index number for
> changing DVFS.
> As you said, order of table shouldn't matter at all in cpufreq layer. Then,
> could this can be applied?
These two patches aren't going to fly I believe. Depending on the order
of table for setting hardware is inviting trouble.
> In our case, We want to use index 0 for P0 and index 1 for P1.....
What I would recommend is, use .driver_data field to hold what has to
be written to hardware for any frequency. And then simply use
driver_data instead of index.
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2014-04-29 6:10 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-04-29 5:24 [PATCH 1/2] PM / OPP: Use list_for_each_entry_reverse instead of list_for_each_entry Jonghwan Choi
2014-04-29 5:32 ` Viresh Kumar
2014-04-29 5:50 ` Jonghwan Choi
2014-04-29 6:10 ` Viresh Kumar
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.