Thread (76 messages) 76 messages, 5 authors, 2014-10-23

[PATCH v4 3/5] cpufreq: Don't destroy/realloc policy/sysfs on hotplug/suspend

From: viresh.kumar@linaro.org (Viresh Kumar)
Date: 2014-08-12 08:51:56
Also in: linux-arm-msm, linux-pm, lkml

On 12 August 2014 03:43, Saravana Kannan [off-list ref] wrote:
On 08/07/2014 03:48 AM, Viresh Kumar wrote:
quoted
quoted
@@ -1369,24 +1354,15 @@ static int __cpufreq_remove_dev_prepare(struct
device *dev,
                 }
         }

-       if (!cpufreq_driver->setpolicy)
-               strncpy(per_cpu(cpufreq_cpu_governor, cpu),
-                       policy->governor->name, CPUFREQ_NAME_LEN);
-

Why? Probably I did mention this earlier as well?

This code is saving the governor name here to restore it when the policy is
created again after suspend/resume or hotplug of all CPUs. Since we no
longer throw away the policy struct, there's no point in doing this.

I should remove this per cpu variable though. Will do it in v5.
Hmm, makes sense. So probably keep this code in this patch and get rid
of all uses of 'cpufreq_cpu_governor' in a separate patch.
quoted
quoted
+       if (cpus > 1) {
+               if (cpu == policy->cpu) {
+                       new_cpu = cpumask_any_but(policy->cpus, cpu);
+                       if (new_cpu >= 0)

Can this ever be false?

If this is the last CPU going down.
Can that be true? Its present in (cpus > 1) block :)
quoted
quoted
  static int cpufreq_remove_dev(struct device *dev, struct
subsys_interface *sif)
  {
         unsigned int cpu = dev->id;
-       int ret;
-
-       if (cpu_is_offline(cpu))
-               return 0;
+       int ret = 0;

-       ret = __cpufreq_remove_dev_prepare(dev, sif);
+       if (cpu_online(cpu))
+               ret = __cpufreq_remove_dev_prepare(dev, sif);

Why do you need a change here?

Since we no longer do remove_dev_finish during hotplug, we can't just short
circuit the entire function. We have to finish the remove when the CPU is
hot-removed or when the cpufreq driver is unregistered.
I think this is tricky and we must have a clear comment here..
I missed this on my initial reviews..
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help