Re: [PATCH V2] cpufreq: Fix double addition of sysfs links

2015-07-23 Thread Rafael J. Wysocki
On Thu, Jul 23, 2015 at 7:22 PM, Rafael J. Wysocki wrote: > Hi Viresh, > > On Thu, Jul 23, 2015 at 8:09 AM, Viresh Kumar wrote: >> On 22-07-15, 18:42, Rafael J. Wysocki wrote: >>> > 3. what happens when 'policy' is NULL at the point when the first (few) >>> > CPUs >>> >are added - how do

Re: [PATCH V2] cpufreq: Fix double addition of sysfs links

2015-07-23 Thread Rafael J. Wysocki
Hi Viresh, On Thu, Jul 23, 2015 at 8:09 AM, Viresh Kumar wrote: > On 22-07-15, 18:42, Rafael J. Wysocki wrote: >> > 3. what happens when 'policy' is NULL at the point when the first (few) >> > CPUs >> >are added - how do the symlinks get created later if/when policy becomes >> >non-NULL

Re: [PATCH V2] cpufreq: Fix double addition of sysfs links

2015-07-23 Thread Viresh Kumar
On 22-07-15, 18:42, Rafael J. Wysocki wrote: > > 3. what happens when 'policy' is NULL at the point when the first (few) CPUs > >are added - how do the symlinks get created later if/when policy becomes > >non-NULL (can it?) > > Yes, it can, and we have a design issue here that bothers me

Re: [PATCH V2] cpufreq: Fix double addition of sysfs links

2015-07-23 Thread Viresh Kumar
On 22-07-15, 18:42, Rafael J. Wysocki wrote: 3. what happens when 'policy' is NULL at the point when the first (few) CPUs are added - how do the symlinks get created later if/when policy becomes non-NULL (can it?) Yes, it can, and we have a design issue here that bothers me a bit.

Re: [PATCH V2] cpufreq: Fix double addition of sysfs links

2015-07-23 Thread Rafael J. Wysocki
Hi Viresh, On Thu, Jul 23, 2015 at 8:09 AM, Viresh Kumar viresh.ku...@linaro.org wrote: On 22-07-15, 18:42, Rafael J. Wysocki wrote: 3. what happens when 'policy' is NULL at the point when the first (few) CPUs are added - how do the symlinks get created later if/when policy becomes

Re: [PATCH V2] cpufreq: Fix double addition of sysfs links

2015-07-23 Thread Rafael J. Wysocki
On Thu, Jul 23, 2015 at 7:22 PM, Rafael J. Wysocki raf...@kernel.org wrote: Hi Viresh, On Thu, Jul 23, 2015 at 8:09 AM, Viresh Kumar viresh.ku...@linaro.org wrote: On 22-07-15, 18:42, Rafael J. Wysocki wrote: 3. what happens when 'policy' is NULL at the point when the first (few) CPUs

Re: [PATCH V2] cpufreq: Fix double addition of sysfs links

2015-07-22 Thread Viresh Kumar
On 22-07-15, 14:15, Russell King - ARM Linux wrote: > > + /* sysfs links are only created on subsys callback */ > > + if (sif && policy) { > > + pr_debug("%s: Adding symlink for CPU: %u\n", __func__, cpu); > > dev_dbg() ? Hmm, right. > > + ret = sysfs_create_link(>kobj,

Re: [PATCH V2] cpufreq: Fix double addition of sysfs links

2015-07-22 Thread Rafael J. Wysocki
Hi Russell, On Wed, Jul 22, 2015 at 3:15 PM, Russell King - ARM Linux wrote: > On Wed, Jul 22, 2015 at 05:37:18PM +0530, Viresh Kumar wrote: [cut] >> @@ -1252,26 +1196,37 @@ static int cpufreq_add_dev(struct device *dev, >> struct subsys_interface *sif) >> { >> unsigned int j, cpu =

Re: [PATCH V2] cpufreq: Fix double addition of sysfs links

2015-07-22 Thread Russell King - ARM Linux
On Wed, Jul 22, 2015 at 05:37:18PM +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 we

Re: [PATCH V2] cpufreq: Fix double addition of sysfs links

2015-07-22 Thread Rafael J. Wysocki
Hi Viresh, On Wed, Jul 22, 2015 at 2:07 PM, 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

[PATCH V2] cpufreq: Fix double addition of sysfs links

2015-07-22 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 group of CPUs and create links for all

Re: [PATCH V2] cpufreq: Fix double addition of sysfs links

2015-07-22 Thread Rafael J. Wysocki
Hi Russell, On Wed, Jul 22, 2015 at 3:15 PM, Russell King - ARM Linux li...@arm.linux.org.uk wrote: On Wed, Jul 22, 2015 at 05:37:18PM +0530, Viresh Kumar wrote: [cut] @@ -1252,26 +1196,37 @@ static int cpufreq_add_dev(struct device *dev, struct subsys_interface *sif) { unsigned

Re: [PATCH V2] cpufreq: Fix double addition of sysfs links

2015-07-22 Thread Rafael J. Wysocki
Hi Viresh, On Wed, Jul 22, 2015 at 2:07 PM, Viresh Kumar viresh.ku...@linaro.org 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

Re: [PATCH V2] cpufreq: Fix double addition of sysfs links

2015-07-22 Thread Russell King - ARM Linux
On Wed, Jul 22, 2015 at 05:37:18PM +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 we

Re: [PATCH V2] cpufreq: Fix double addition of sysfs links

2015-07-22 Thread Viresh Kumar
On 22-07-15, 14:15, Russell King - ARM Linux wrote: + /* sysfs links are only created on subsys callback */ + if (sif policy) { + pr_debug(%s: Adding symlink for CPU: %u\n, __func__, cpu); dev_dbg() ? Hmm, right. + ret = sysfs_create_link(dev-kobj,

[PATCH V2] cpufreq: Fix double addition of sysfs links

2015-07-22 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 group of CPUs and create links for all