cpufreq: tegra186: Share policy per cluster
Subsystems (2)
PATCH 1/1 cpufreq: tegra186: Share policy per cluster
This functionally brings tegra186 in line with tegra210 and tegra194, sharing a cpufreq policy between all cores in a cluster.
--- drivers/cpufreq/tegra186-cpufreq.c | 7 +++++++ 1 file changed, 7 insertions(+)
drivers/cpufreq/tegra186-cpufreq.c +7 -0
@@ -73,11 +73,18 @@ static int tegra186_cpufreq_init(struct cpufreq_policy *policy) {struct tegra186_cpufreq_data *data =cpufreq_get_driver_data ();unsigned int cluster = data->cpus[policy->cpu].bpmp_cluster_id; +u32 cpu; policy->freq_table = data->clusters[cluster].table; policy->cpuinfo.transition_latency =300 *1000 ; policy->driver_data =NULL ; +/* set same policy for all cpus in a cluster */ +for (cpu =0 ; cpu < (sizeof (tegra186_cpus)/sizeof (struct tegra186_cpufreq_cpu )); cpu++) { +if (data->cpus[cpu].bpmp_cluster_id == cluster) +cpumask_set_cpu (cpu, policy->cpus); + } +return 0 ; }
Signature · 1 line
2.48.1
Viresh Kumar
maintainerQuoted 20 lines · Aaron Kling
This functionally brings tegra186 in line with tegra210 and tegra194, sharing a cpufreq policy between all cores in a cluster.
Signed-off-by Aaron Kling <[email protected]>--- drivers/cpufreq/tegra186-cpufreq.c | 7 +++++++ 1 file changed, 7 insertions(+)drivers/cpufreq/tegra186-cpufreq.c +1
-0@@ -73,11 +73,18 @@ static int tegra186_cpufreq_init(struct cpufreq_policy *policy) {struct tegra186_cpufreq_data *data =cpufreq_get_driver_data ();unsigned int cluster = data->cpus[policy->cpu].bpmp_cluster_id; +u32 cpu; policy->freq_table = data->clusters[cluster].table; policy->cpuinfo.transition_latency =300 *1000 ;
drivers/cpufreq/tegra186-cpufreq.c static int tegra186_cpufreq_init(struct cpufreq_policy *policy) · line 89
Quoted 10 lines
drivers/cpufreq/tegra186-cpufreq.c +6
-0policy->driver_data =NULL ; +/* set same policy for all cpus in a cluster */ +for (cpu =0 ; cpu < (sizeof (tegra186_cpus)/sizeof (struct tegra186_cpufreq_cpu )); cpu++) { +if (data->cpus[cpu].bpmp_cluster_id == cluster) +cpumask_set_cpu (cpu, policy->cpus); + } +return 0 ; }
Thierry / Jonathan,
Any inputs on this ?
Signature · 1 line
viresh
Quoted 34 lines · Viresh Kumar
Quoted 20 lines · Aaron Kling
This functionally brings tegra186 in line with tegra210 and tegra194, sharing a cpufreq policy between all cores in a cluster.
Signed-off-by Aaron Kling <[email protected]>--- drivers/cpufreq/tegra186-cpufreq.c | 7 +++++++ 1 file changed, 7 insertions(+)drivers/cpufreq/tegra186-cpufreq.c +1
-0@@ -73,11 +73,18 @@ static int tegra186_cpufreq_init(struct cpufreq_policy *policy) {struct tegra186_cpufreq_data *data =cpufreq_get_driver_data ();unsigned int cluster = data->cpus[policy->cpu].bpmp_cluster_id; +u32 cpu; policy->freq_table = data->clusters[cluster].table; policy->cpuinfo.transition_latency =300 *1000 ;drivers/cpufreq/tegra186-cpufreq.c static int tegra186_cpufreq_init(struct cpufreq_policy *policy) · line 89
Quoted 10 lines
drivers/cpufreq/tegra186-cpufreq.c +6
-0policy->driver_data =NULL ; +/* set same policy for all cpus in a cluster */ +for (cpu =0 ; cpu < (sizeof (tegra186_cpus)/sizeof (struct tegra186_cpufreq_cpu )); cpu++) { +if (data->cpus[cpu].bpmp_cluster_id == cluster) +cpumask_set_cpu (cpu, policy->cpus); + } +return 0 ; }Thierry / Jonathan,
Quoted 1 line
Any inputs on this ?
Sumit,
does this look reasonable?
Thanks,
Thierry
Sumit Gupta
Reviewed-byQuoted 35 lines · Thierry Reding
Quoted 34 lines · Viresh Kumar
Quoted 20 lines · Aaron Kling
This functionally brings tegra186 in line with tegra210 and tegra194, sharing a cpufreq policy between all cores in a cluster.
Signed-off-by Aaron Kling <[email protected]>--- drivers/cpufreq/tegra186-cpufreq.c | 7 +++++++ 1 file changed, 7 insertions(+)drivers/cpufreq/tegra186-cpufreq.c +1
-0@@ -73,11 +73,18 @@ static int tegra186_cpufreq_init(struct cpufreq_policy *policy) {struct tegra186_cpufreq_data *data =cpufreq_get_driver_data ();unsigned int cluster = data->cpus[policy->cpu].bpmp_cluster_id; +u32 cpu; policy->freq_table = data->clusters[cluster].table; policy->cpuinfo.transition_latency =300 *1000 ;drivers/cpufreq/tegra186-cpufreq.c static int tegra186_cpufreq_init(struct cpufreq_policy *policy) · line 89
Quoted 10 lines
drivers/cpufreq/tegra186-cpufreq.c +6
-0policy->driver_data =NULL ; +/* set same policy for all cpus in a cluster */ +for (cpu =0 ; cpu < (sizeof (tegra186_cpus)/sizeof (struct tegra186_cpufreq_cpu )); cpu++) { +if (data->cpus[cpu].bpmp_cluster_id == cluster) +cpumask_set_cpu (cpu, policy->cpus); + } +return 0 ; }Thierry / Jonathan,
Quoted 8 lines
Quoted 1 line
Any inputs on this ?
Sumit,
does this look reasonable?
Thanks,
Thierry
Looks good to me.
Best Regards,
Sumit Gupta
Thierry Reding
Acked-byQuoted 40 lines · Sumit Gupta
Quoted 37 lines · Thierry Reding
Quoted 32 lines · Viresh Kumar
Quoted 18 lines · Aaron Kling
This functionally brings tegra186 in line with tegra210 and tegra194, sharing a cpufreq policy between all cores in a cluster.
Signed-off-by Aaron Kling <[email protected]>--- drivers/cpufreq/tegra186-cpufreq.c | 7 +++++++ 1 file changed, 7 insertions(+)drivers/cpufreq/tegra186-cpufreq.c +1
-0@@ -73,11 +73,18 @@ static int tegra186_cpufreq_init(struct cpufreq_policy *policy) {struct tegra186_cpufreq_data *data =cpufreq_get_driver_data ();unsigned int cluster = data->cpus[policy->cpu].bpmp_cluster_id; +u32 cpu; policy->freq_table = data->clusters[cluster].table;drivers/cpufreq/tegra186-cpufreq.c static int tegra186_cpufreq_init(struct cpufreq_policy *policy) · line 87
Quoted 10 lines
drivers/cpufreq/tegra186-cpufreq.c +6
-0policy->cpuinfo.transition_latency =300 *1000 ; policy->driver_data =NULL ; +/* set same policy for all cpus in a cluster */ +for (cpu =0 ; cpu < (sizeof (tegra186_cpus)/sizeof (struct tegra186_cpufreq_cpu )); cpu++) { +if (data->cpus[cpu].bpmp_cluster_id == cluster) +cpumask_set_cpu (cpu, policy->cpus); + } +return 0 ; }Thierry / Jonathan,
Quoted 1 line
Any inputs on this ?
Sumit,
Quoted 8 lines
Quoted 4 lines
does this look reasonable?
Thanks,
ThierryLooks good to me.
Reviewed-by Sumit Gupta <[email protected]>
Thanks, in that case:
Viresh Kumar
maintainerQuoted 14 lines · Aaron Kling
This functionally brings tegra186 in line with tegra210 and tegra194, sharing a cpufreq policy between all cores in a cluster.
Signed-off-by Aaron Kling <[email protected]>--- drivers/cpufreq/tegra186-cpufreq.c | 7 +++++++ 1 file changed, 7 insertions(+)drivers/cpufreq/tegra186-cpufreq.c +0
-0@@ -73,11 +73,18 @@ static int tegra186_cpufreq_init(struct cpufreq_policy *policy) {
drivers/cpufreq/tegra186-cpufreq.c static int tegra186_cpufreq_init(struct cpufreq_policy *policy) · line 83
Quoted 10 lines
drivers/cpufreq/tegra186-cpufreq.c +3
-0struct tegra186_cpufreq_data *data =cpufreq_get_driver_data ();unsigned int cluster = data->cpus[policy->cpu].bpmp_cluster_id; +u32 cpu; policy->freq_table = data->clusters[cluster].table; policy->cpuinfo.transition_latency =300 *1000 ; policy->driver_data =NULL ; +/* set same policy for all cpus in a cluster */ +for (cpu =0 ; cpu < (sizeof (tegra186_cpus)/sizeof (struct tegra186_cpufreq_cpu )); cpu++) {
Can't you use ARRAY_SIZE here ?
Quoted 5 lines
drivers/cpufreq/tegra186-cpufreq.c +4
-0+if (data->cpus[cpu].bpmp_cluster_id == cluster) +cpumask_set_cpu (cpu, policy->cpus); + } +return 0 ;
Signature · 1 line
viresh
Quoted 20 lines · Viresh Kumar
Quoted 18 lines · Aaron Kling
This functionally brings tegra186 in line with tegra210 and tegra194, sharing a cpufreq policy between all cores in a cluster.
Signed-off-by Aaron Kling <[email protected]>--- drivers/cpufreq/tegra186-cpufreq.c | 7 +++++++ 1 file changed, 7 insertions(+)drivers/cpufreq/tegra186-cpufreq.c +1
-0@@ -73,11 +73,18 @@ static int tegra186_cpufreq_init(struct cpufreq_policy *policy) {struct tegra186_cpufreq_data *data =cpufreq_get_driver_data ();unsigned int cluster = data->cpus[policy->cpu].bpmp_cluster_id; +u32 cpu;
Quoted 8 lines
drivers/cpufreq/tegra186-cpufreq.c static int tegra186_cpufreq_init(struct cpufreq_policy *policy) · line 83
Quoted 6 lines
drivers/cpufreq/tegra186-cpufreq.c +2
-0policy->freq_table = data->clusters[cluster].table; policy->cpuinfo.transition_latency =300 *1000 ; policy->driver_data =NULL ; +/* set same policy for all cpus in a cluster */ +for (cpu =0 ; cpu < (sizeof (tegra186_cpus)/sizeof (struct tegra186_cpufreq_cpu )); cpu++) {Can't you use
ARRAY_SIZEhere ?
I could, just wasn't aware of that macro. Is that enough to send a v2 over?
Quoted 9 lines
drivers/cpufreq/tegra186-cpufreq.c static int tegra186_cpufreq_init(struct cpufreq_policy *policy) · line 88
Quoted 6 lines
drivers/cpufreq/tegra186-cpufreq.c +4
-0+if (data->cpus[cpu].bpmp_cluster_id == cluster) +cpumask_set_cpu (cpu, policy->cpus); + } +return 0 ;--
viresh
Sincerely,
Aaron
Viresh Kumar
maintainerQuoted 25 lines · Aaron Kling
Quoted 24 lines · Viresh Kumar
Quoted 22 lines · Aaron Kling
This functionally brings tegra186 in line with tegra210 and tegra194, sharing a cpufreq policy between all cores in a cluster.
Signed-off-by Aaron Kling <[email protected]>--- drivers/cpufreq/tegra186-cpufreq.c | 7 +++++++ 1 file changed, 7 insertions(+)drivers/cpufreq/tegra186-cpufreq.c +1
-0@@ -73,11 +73,18 @@ static int tegra186_cpufreq_init(struct cpufreq_policy *policy) {struct tegra186_cpufreq_data *data =cpufreq_get_driver_data ();unsigned int cluster = data->cpus[policy->cpu].bpmp_cluster_id; +u32 cpu; policy->freq_table = data->clusters[cluster].table; policy->cpuinfo.transition_latency =300 *1000 ; policy->driver_data =NULL ;
Quoted 6 lines
Quoted 4 lines
drivers/cpufreq/tegra186-cpufreq.c static int tegra186_cpufreq_init(struct cpufreq_policy *policy) · line 83
Quoted 2 lines
drivers/cpufreq/tegra186-cpufreq.c +2
-0+/* set same policy for all cpus in a cluster */ +for (cpu =0 ; cpu < (sizeof (tegra186_cpus)/sizeof (struct tegra186_cpufreq_cpu )); cpu++) {Can't you use
ARRAY_SIZEhere ?I could, just wasn't aware of that macro. Is that enough to send a v2 over?
Yes, please send that and include the tags you received.
Signature · 1 line
viresh