Re: [PATCH] cpufreq: Avoid double addition/removal of sysfs links

2015-07-22 Thread Viresh Kumar
On 22-07-15, 01:15, Rafael J. Wysocki wrote: > So the problem is that the cpu_is_offline(cpu) check in > cpufreq_add_dev() matches two distinct cases: (1) the CPU was not > present before and it is just being hot-added and (2) the CPU is > initially offline, but present, and this is the first time

Re: [PATCH] cpufreq: Avoid double addition/removal of sysfs links

2015-07-22 Thread Viresh Kumar
On 21-07-15, 03:14, Rafael J. Wysocki wrote: > That said, cpu_present_mask may only be updated after calling > arch_unregister_cpu(), so checking it in cpufreq_remove_dev() doesn't > really help. No, it is indeed useful. This is a snippet from the latest code we have: cpumask_copy

Re: [PATCH] cpufreq: Avoid double addition/removal of sysfs links

2015-07-21 Thread Viresh Kumar
Back now, sorry for the delay .. On 20-07-15, 11:36, Russell King - ARM Linux wrote: > Why do we try to create the symlink for CPU devices which we haven't > "detected" yet (iow, we haven't had cpufreq_add_dev() called for)? > Surely we are guaranteed to have cpufreq_add_dev() called for every > C

Re: [PATCH] cpufreq: Avoid double addition/removal of sysfs links

2015-07-21 Thread Rafael J. Wysocki
On Wednesday, July 22, 2015 03:56:21 AM Rafael J. Wysocki wrote: > On Wednesday, July 22, 2015 01:15:01 AM Rafael J. Wysocki wrote: > > Hi VIresh, > > > > On Mon, Jul 20, 2015 at 11:47 AM, Viresh Kumar > > wrote: > > > Consider a dual core (0/1) system with two CPUs: > > > - sharing clock/voltag

Re: [PATCH] cpufreq: Avoid double addition/removal of sysfs links

2015-07-21 Thread Rafael J. Wysocki
On Wednesday, July 22, 2015 01:15:01 AM Rafael J. Wysocki wrote: > Hi VIresh, > > On Mon, Jul 20, 2015 at 11:47 AM, Viresh Kumar > wrote: > > Consider a dual core (0/1) system with two CPUs: > > - sharing clock/voltage rails and hence cpufreq-policy > > - CPU1 is offline while the cpufreq driver

Re: [PATCH] cpufreq: Avoid double addition/removal of sysfs links

2015-07-21 Thread Rafael J. Wysocki
Hi VIresh, On Mon, Jul 20, 2015 at 11:47 AM, Viresh Kumar wrote: > Consider a dual core (0/1) system with two CPUs: > - sharing clock/voltage rails and hence cpufreq-policy > - CPU1 is offline while the cpufreq driver is registered > > - cpufreq_add_dev() is called from subsys callback for CPU0 a

Re: [PATCH] cpufreq: Avoid double addition/removal of sysfs links

2015-07-21 Thread Viresh Kumar
On 20 July 2015 at 16:06, Russell King - ARM Linux wrote: > Why do we try to create the symlink for CPU devices which we haven't > "detected" yet (iow, we haven't had cpufreq_add_dev() called for)? > Surely we are guaranteed to have cpufreq_add_dev() called for every > CPU which exists in sysfs?

Re: [PATCH] cpufreq: Avoid double addition/removal of sysfs links

2015-07-20 Thread Rafael J. Wysocki
On Tue, Jul 21, 2015 at 2:47 AM, Rafael J. Wysocki wrote: > Hi Russell, > > On Mon, Jul 20, 2015 at 12:36 PM, Russell King - ARM Linux > wrote: >> On Mon, Jul 20, 2015 at 03:17:10PM +0530, Viresh Kumar wrote: >>> Consider a dual core (0/1) system with two CPUs: >>> - sharing clock/voltage rails a

Re: [PATCH] cpufreq: Avoid double addition/removal of sysfs links

2015-07-20 Thread Rafael J. Wysocki
Hi Russell, On Mon, Jul 20, 2015 at 12:36 PM, Russell King - ARM Linux wrote: > On Mon, Jul 20, 2015 at 03:17:10PM +0530, Viresh Kumar wrote: >> Consider a dual core (0/1) system with two CPUs: >> - sharing clock/voltage rails and hence cpufreq-policy >> - CPU1 is offline while the cpufreq driver

Re: [PATCH] cpufreq: Avoid double addition/removal of sysfs links

2015-07-20 Thread Russell King - ARM Linux
On Mon, Jul 20, 2015 at 03:17:10PM +0530, Viresh Kumar wrote: > Consider a dual core (0/1) system with two CPUs: > - sharing clock/voltage rails and hence cpufreq-policy > - CPU1 is offline while the cpufreq driver is registered > > - cpufreq_add_dev() is called from subsys callback for CPU0 and w

[PATCH] cpufreq: Avoid double addition/removal of sysfs links

2015-07-20 Thread Viresh Kumar
Consider a dual core (0/1) system with two CPUs: - sharing clock/voltage rails and hence cpufreq-policy - CPU1 is offline while the cpufreq driver is registered - cpufreq_add_dev() is called from subsys callback for CPU0 and we create the policy for the CPUs and create link for CPU1. - cpufreq_a