Re: [PATCH v3 1/2] cpufreq: Don't destroy/realloc policy/sysfs on hotplug/suspend

2014-07-17 Thread Viresh Kumar
On 17 July 2014 01:55, Saravana Kannan skan...@codeaurora.org wrote: On 07/16/2014 01:24 AM, Viresh Kumar wrote: Also, its not the duty of this routine to find which one is the policy cpu as that is done by __cpufreq_add_dev(). And so in case we need to make first cpu of a mask as policy-cpu,

Re: [PATCH v3 1/2] cpufreq: Don't destroy/realloc policy/sysfs on hotplug/suspend

2014-07-17 Thread Saravana Kannan
On 07/16/2014 10:35 PM, Viresh Kumar wrote: On 17 July 2014 01:26, Saravana Kannan skan...@codeaurora.org wrote: On 07/16/2014 04:16 AM, Srivatsa S. Bhat wrote: That is, we wanted to do the kobject cleanup after releasing the hotplug lock, and POST_DEAD stage was well-suited for that. I

Re: [PATCH v3 1/2] cpufreq: Don't destroy/realloc policy/sysfs on hotplug/suspend

2014-07-17 Thread Viresh Kumar
On 18 July 2014 08:55, Saravana Kannan skan...@codeaurora.org wrote: Not really. We much never do it during hotplug. We only do it when the cpufreq driver unregisters. Oh yes. -- To unsubscribe from this list: send the line unsubscribe linux-arm-msm in the body of a message to

Re: [PATCH v3 1/2] cpufreq: Don't destroy/realloc policy/sysfs on hotplug/suspend

2014-07-16 Thread Viresh Kumar
On 16 July 2014 04:17, Saravana Kannan skan...@codeaurora.org wrote: diff --git a/drivers/cpufreq/cpufreq.c b/drivers/cpufreq/cpufreq.c +/* symlink related CPUs */ +static int cpufreq_dev_symlink(struct cpufreq_policy *policy, bool add) { - unsigned int j; + unsigned int j,

Re: [PATCH v3 1/2] cpufreq: Don't destroy/realloc policy/sysfs on hotplug/suspend

2014-07-16 Thread Viresh Kumar
On 16 July 2014 05:58, Saravana Kannan skan...@codeaurora.org wrote: + if (!cpus cpufreq_driver-stop_cpu cpufreq_driver-setpolicy) { + cpufreq_driver-stop_cpu(policy); + } Viresh, I tried your suggestion (and my initial thought too) to combine this as an if/else

Re: [PATCH v3 1/2] cpufreq: Don't destroy/realloc policy/sysfs on hotplug/suspend

2014-07-16 Thread Srivatsa S. Bhat
On 07/16/2014 01:54 PM, Viresh Kumar wrote: On 16 July 2014 04:17, Saravana Kannan skan...@codeaurora.org wrote: diff --git a/drivers/cpufreq/cpufreq.c b/drivers/cpufreq/cpufreq.c +/* symlink related CPUs */ +static int cpufreq_dev_symlink(struct cpufreq_policy *policy, bool add) { -

Re: [PATCH v3 1/2] cpufreq: Don't destroy/realloc policy/sysfs on hotplug/suspend

2014-07-16 Thread Viresh Kumar
On 16 July 2014 16:46, Srivatsa S. Bhat sriva...@mit.edu wrote: Short answer: If the sysfs directory has already been created by cpufreq, then yes, it will remain as it is. However, if the online operation failed before that, then cpufreq won't know about that CPU at all, and no file will be

Re: [PATCH v3 1/2] cpufreq: Don't destroy/realloc policy/sysfs on hotplug/suspend

2014-07-16 Thread Dirk Brandewie
On 07/15/2014 03:47 PM, Saravana Kannan wrote: The CPUfreq core moves the cpufreq policy ownership between CPUs when CPUs within a cluster (CPUs sharing same policy) go ONLINE/OFFLINE. When moving policy ownership between CPUs, it also moves the cpufreq sysfs directory between CPUs and also

Re: [PATCH v3 1/2] cpufreq: Don't destroy/realloc policy/sysfs on hotplug/suspend

2014-07-16 Thread Viresh Kumar
On 16 July 2014 19:59, Dirk Brandewie dirk.brande...@gmail.com wrote: stop_cpu() only needs to be called during __cpufreq_remove_dev_prepare() no where else. Oh, thanks for reminding us.. Look at this Saravana: 367dc4a cpufreq: Add stop CPU callback to cpufreq_driver interface -- To

Re: [PATCH v3 1/2] cpufreq: Don't destroy/realloc policy/sysfs on hotplug/suspend

2014-07-16 Thread Srivatsa S. Bhat
On 07/16/2014 06:43 PM, Viresh Kumar wrote: On 16 July 2014 16:46, Srivatsa S. Bhat sriva...@mit.edu wrote: Short answer: If the sysfs directory has already been created by cpufreq, then yes, it will remain as it is. However, if the online operation failed before that, then cpufreq won't know

Re: [PATCH v3 1/2] cpufreq: Don't destroy/realloc policy/sysfs on hotplug/suspend

2014-07-16 Thread Saravana Kannan
On 07/16/2014 01:30 AM, Viresh Kumar wrote: On 16 July 2014 05:58, Saravana Kannan skan...@codeaurora.org wrote: + if (!cpus cpufreq_driver-stop_cpu cpufreq_driver-setpolicy) { + cpufreq_driver-stop_cpu(policy); + } Viresh, I tried your suggestion (and my initial

Re: [PATCH v3 1/2] cpufreq: Don't destroy/realloc policy/sysfs on hotplug/suspend

2014-07-16 Thread Saravana Kannan
On 07/16/2014 08:28 AM, Viresh Kumar wrote: On 16 July 2014 19:59, Dirk Brandewie dirk.brande...@gmail.com wrote: stop_cpu() only needs to be called during __cpufreq_remove_dev_prepare() no where else. Oh, thanks for reminding us.. Look at this Saravana: 367dc4a cpufreq: Add stop CPU

Re: [PATCH v3 1/2] cpufreq: Don't destroy/realloc policy/sysfs on hotplug/suspend

2014-07-16 Thread Saravana Kannan
On 07/16/2014 04:16 AM, Srivatsa S. Bhat wrote: On 07/16/2014 01:54 PM, Viresh Kumar wrote: On 16 July 2014 04:17, Saravana Kannan skan...@codeaurora.org wrote: diff --git a/drivers/cpufreq/cpufreq.c b/drivers/cpufreq/cpufreq.c SNIP -static int cpufreq_add_policy_cpu(struct

Re: [PATCH v3 1/2] cpufreq: Don't destroy/realloc policy/sysfs on hotplug/suspend

2014-07-16 Thread Saravana Kannan
On 07/16/2014 06:13 AM, Viresh Kumar wrote: On 16 July 2014 16:46, Srivatsa S. Bhat sriva...@mit.edu wrote: Short answer: If the sysfs directory has already been created by cpufreq, then yes, it will remain as it is. However, if the online operation failed before that, then cpufreq won't know

Re: [PATCH v3 1/2] cpufreq: Don't destroy/realloc policy/sysfs on hotplug/suspend

2014-07-16 Thread Saravana Kannan
On 07/16/2014 01:24 AM, Viresh Kumar wrote: On 16 July 2014 04:17, Saravana Kannan skan...@codeaurora.org wrote: diff --git a/drivers/cpufreq/cpufreq.c b/drivers/cpufreq/cpufreq.c +/* symlink related CPUs */ +static int cpufreq_dev_symlink(struct cpufreq_policy *policy, bool add) { -

Re: [PATCH v3 1/2] cpufreq: Don't destroy/realloc policy/sysfs on hotplug/suspend

2014-07-16 Thread Saravana Kannan
On 07/16/2014 01:25 PM, Saravana Kannan wrote: On 07/16/2014 01:24 AM, Viresh Kumar wrote: On 16 July 2014 04:17, Saravana Kannan skan...@codeaurora.org wrote: diff --git a/drivers/cpufreq/cpufreq.c b/drivers/cpufreq/cpufreq.c @@ -1110,9 +1092,10 @@ static int __cpufreq_add_dev(struct

Re: [PATCH v3 1/2] cpufreq: Don't destroy/realloc policy/sysfs on hotplug/suspend

2014-07-16 Thread Viresh Kumar
On 17 July 2014 01:26, Saravana Kannan skan...@codeaurora.org wrote: On 07/16/2014 04:16 AM, Srivatsa S. Bhat wrote: That is, we wanted to do the kobject cleanup after releasing the hotplug lock, and POST_DEAD stage was well-suited for that. I think, this has changed in Saravana's patch, we

Re: [PATCH v3 1/2] cpufreq: Don't destroy/realloc policy/sysfs on hotplug/suspend

2014-07-16 Thread Viresh Kumar
On 17 July 2014 01:26, Saravana Kannan skan...@codeaurora.org wrote: No it's not. All the cpu*/ directories for all possible CPUs will be there whether a CPU is online/offline. Which is why I also weed out impossible CPUs, but you said the driver shouldn't be passing impossible CPUs anyway.