Re: [PATCH v2 5/5] cpufreq: Catch double invocations of cpufreq_freq_transition_begin/end

2014-04-29 Thread Srivatsa S. Bhat
On 04/29/2014 01:34 PM, Viresh Kumar wrote: > On 29 April 2014 13:05, Srivatsa S. Bhat > wrote: >> On 04/29/2014 12:19 PM, Viresh Kumar wrote: >>> + WARN_ON(!(cpufreq_driver->flags & CPUFREQ_ASYNC_NOTIFICATION) >>> && (current == policy->transition_task)); >>>

Re: [PATCH v2 5/5] cpufreq: Catch double invocations of cpufreq_freq_transition_begin/end

2014-04-29 Thread Viresh Kumar
On 29 April 2014 13:05, Srivatsa S. Bhat wrote: > On 04/29/2014 12:19 PM, Viresh Kumar wrote: >> + WARN_ON(!(cpufreq_driver->flags & CPUFREQ_ASYNC_NOTIFICATION) >> && (current == policy->transition_task)); >> >> which you already mentioned. > > Yeah, I think we

Re: [PATCH v2 5/5] cpufreq: Catch double invocations of cpufreq_freq_transition_begin/end

2014-04-29 Thread Srivatsa S. Bhat
On 04/29/2014 12:19 PM, Viresh Kumar wrote: > On 29 April 2014 11:46, Srivatsa S. Bhat > wrote: >> Yes, I'm aware that this corner case doesn't work well with my debug > > Don't know if its a corner case, it may be the most obvious case for > some :) > Yeah, it could be. >> patch. I tried to

Re: [PATCH v2 5/5] cpufreq: Catch double invocations of cpufreq_freq_transition_begin/end

2014-04-29 Thread Viresh Kumar
On 29 April 2014 11:46, Srivatsa S. Bhat wrote: > Yes, I'm aware that this corner case doesn't work well with my debug Don't know if its a corner case, it may be the most obvious case for some :) > patch. I tried to avoid this but couldn't think of any solution. The problem is not that it

Re: [PATCH v2 5/5] cpufreq: Catch double invocations of cpufreq_freq_transition_begin/end

2014-04-29 Thread Srivatsa S. Bhat
On 04/29/2014 10:25 AM, Viresh Kumar wrote: > On 29 April 2014 10:21, Viresh Kumar wrote: >> Nice effort. >> >> On 29 April 2014 00:25, Srivatsa S. Bhat >> wrote: >>> Now all such drivers have been fixed, but debugging this issue was not >>> very straight-forward (even lockdep didn't catch

Re: [PATCH v2 5/5] cpufreq: Catch double invocations of cpufreq_freq_transition_begin/end

2014-04-29 Thread Srivatsa S. Bhat
On 04/29/2014 10:21 AM, Viresh Kumar wrote: > Nice effort. > Thanks! :-) > On 29 April 2014 00:25, Srivatsa S. Bhat > wrote: >> Now all such drivers have been fixed, but debugging this issue was not >> very straight-forward (even lockdep didn't catch this). So let us add a >> debug

Re: [PATCH v2 5/5] cpufreq: Catch double invocations of cpufreq_freq_transition_begin/end

2014-04-29 Thread Srivatsa S. Bhat
On 04/29/2014 10:21 AM, Viresh Kumar wrote: Nice effort. Thanks! :-) On 29 April 2014 00:25, Srivatsa S. Bhat srivatsa.b...@linux.vnet.ibm.com wrote: Now all such drivers have been fixed, but debugging this issue was not very straight-forward (even lockdep didn't catch this). So let us

Re: [PATCH v2 5/5] cpufreq: Catch double invocations of cpufreq_freq_transition_begin/end

2014-04-29 Thread Srivatsa S. Bhat
On 04/29/2014 10:25 AM, Viresh Kumar wrote: On 29 April 2014 10:21, Viresh Kumar viresh.ku...@linaro.org wrote: Nice effort. On 29 April 2014 00:25, Srivatsa S. Bhat srivatsa.b...@linux.vnet.ibm.com wrote: Now all such drivers have been fixed, but debugging this issue was not very

Re: [PATCH v2 5/5] cpufreq: Catch double invocations of cpufreq_freq_transition_begin/end

2014-04-29 Thread Viresh Kumar
On 29 April 2014 11:46, Srivatsa S. Bhat srivatsa.b...@linux.vnet.ibm.com wrote: Yes, I'm aware that this corner case doesn't work well with my debug Don't know if its a corner case, it may be the most obvious case for some :) patch. I tried to avoid this but couldn't think of any solution.

Re: [PATCH v2 5/5] cpufreq: Catch double invocations of cpufreq_freq_transition_begin/end

2014-04-29 Thread Srivatsa S. Bhat
On 04/29/2014 12:19 PM, Viresh Kumar wrote: On 29 April 2014 11:46, Srivatsa S. Bhat srivatsa.b...@linux.vnet.ibm.com wrote: Yes, I'm aware that this corner case doesn't work well with my debug Don't know if its a corner case, it may be the most obvious case for some :) Yeah, it could be.

Re: [PATCH v2 5/5] cpufreq: Catch double invocations of cpufreq_freq_transition_begin/end

2014-04-29 Thread Viresh Kumar
On 29 April 2014 13:05, Srivatsa S. Bhat srivatsa.b...@linux.vnet.ibm.com wrote: On 04/29/2014 12:19 PM, Viresh Kumar wrote: + WARN_ON(!(cpufreq_driver-flags CPUFREQ_ASYNC_NOTIFICATION) (current == policy-transition_task)); which you already mentioned.

Re: [PATCH v2 5/5] cpufreq: Catch double invocations of cpufreq_freq_transition_begin/end

2014-04-29 Thread Srivatsa S. Bhat
On 04/29/2014 01:34 PM, Viresh Kumar wrote: On 29 April 2014 13:05, Srivatsa S. Bhat srivatsa.b...@linux.vnet.ibm.com wrote: On 04/29/2014 12:19 PM, Viresh Kumar wrote: + WARN_ON(!(cpufreq_driver-flags CPUFREQ_ASYNC_NOTIFICATION) (current ==

Re: [PATCH v2 5/5] cpufreq: Catch double invocations of cpufreq_freq_transition_begin/end

2014-04-28 Thread Viresh Kumar
On 29 April 2014 10:21, Viresh Kumar wrote: > Nice effort. > > On 29 April 2014 00:25, Srivatsa S. Bhat > wrote: >> Now all such drivers have been fixed, but debugging this issue was not >> very straight-forward (even lockdep didn't catch this). So let us add a >> debug infrastructure to the

Re: [PATCH v2 5/5] cpufreq: Catch double invocations of cpufreq_freq_transition_begin/end

2014-04-28 Thread Viresh Kumar
Nice effort. On 29 April 2014 00:25, Srivatsa S. Bhat wrote: > Now all such drivers have been fixed, but debugging this issue was not > very straight-forward (even lockdep didn't catch this). So let us add a > debug infrastructure to the cpufreq core to catch such issues more easily > in the

[PATCH v2 5/5] cpufreq: Catch double invocations of cpufreq_freq_transition_begin/end

2014-04-28 Thread Srivatsa S. Bhat
Some cpufreq drivers were redundantly invoking the _begin() and _end() APIs around frequency transitions, and this double invocation (one from the cpufreq core and the other from the cpufreq driver) used to result in a self-deadlock, leading to system hangs during boot. (The _begin() API makes

[PATCH v2 5/5] cpufreq: Catch double invocations of cpufreq_freq_transition_begin/end

2014-04-28 Thread Srivatsa S. Bhat
Some cpufreq drivers were redundantly invoking the _begin() and _end() APIs around frequency transitions, and this double invocation (one from the cpufreq core and the other from the cpufreq driver) used to result in a self-deadlock, leading to system hangs during boot. (The _begin() API makes

Re: [PATCH v2 5/5] cpufreq: Catch double invocations of cpufreq_freq_transition_begin/end

2014-04-28 Thread Viresh Kumar
Nice effort. On 29 April 2014 00:25, Srivatsa S. Bhat srivatsa.b...@linux.vnet.ibm.com wrote: Now all such drivers have been fixed, but debugging this issue was not very straight-forward (even lockdep didn't catch this). So let us add a debug infrastructure to the cpufreq core to catch such

Re: [PATCH v2 5/5] cpufreq: Catch double invocations of cpufreq_freq_transition_begin/end

2014-04-28 Thread Viresh Kumar
On 29 April 2014 10:21, Viresh Kumar viresh.ku...@linaro.org wrote: Nice effort. On 29 April 2014 00:25, Srivatsa S. Bhat srivatsa.b...@linux.vnet.ibm.com wrote: Now all such drivers have been fixed, but debugging this issue was not very straight-forward (even lockdep didn't catch this). So