lkml.org 
[lkml]   [2014]   [Aug]   [12]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
SubjectRe: [PATCH v4 3/5] cpufreq: Don't destroy/realloc policy/sysfs on hotplug/suspend
From
On 12 August 2014 03:43, Saravana Kannan <skannan@codeaurora.org> wrote:
> On 08/07/2014 03:48 AM, Viresh Kumar wrote:

>>> @@ -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.

>>> + 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 :)

>>> 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..


\
 
 \ /
  Last update: 2014-08-12 11:01    [W:0.087 / U:0.024 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site