Re: cpufreq_stats NULL deref on second system suspend

2013-09-12 Thread Viresh Kumar
On 12 September 2013 22:56, Srivatsa S. Bhat wrote: > On 09/12/2013 09:25 PM, Stephen Warren wrote: > Anyway, nevermind, as of now, subsystems do work around this suitably, so > there is no known bug as such at the present. Just that we could have probably > done it a better way, that's all. Yeah

Re: cpufreq_stats NULL deref on second system suspend

2013-09-12 Thread Srivatsa S. Bhat
On 09/12/2013 09:25 PM, Stephen Warren wrote: > On 09/12/2013 12:26 AM, Srivatsa S. Bhat wrote: >> On 09/12/2013 11:22 AM, Viresh Kumar wrote: > ... >>> Now coming back to the ideas I have... >>> Same code will work if hotplug sequence is fixed a bit. Why aren't we doing >>> exact opposite of suspe

Re: cpufreq_stats NULL deref on second system suspend

2013-09-12 Thread Stephen Warren
On 09/12/2013 12:26 AM, Srivatsa S. Bhat wrote: > On 09/12/2013 11:22 AM, Viresh Kumar wrote: ... >> Now coming back to the ideas I have... >> Same code will work if hotplug sequence is fixed a bit. Why aren't we doing >> exact opposite of suspend in resume? >> >> We are removing CPUs (leaving the

Re: cpufreq_stats NULL deref on second system suspend

2013-09-12 Thread Srivatsa S. Bhat
On 09/12/2013 12:22 PM, Viresh Kumar wrote: > On 12 September 2013 12:16, Srivatsa S. Bhat > wrote: >> Of course, if we change the suspend/resume sequence and that fixes this, that >> would be like getting it for free, nobody would say no to it ;-) > > Not really :) > > Policy with 4 CPUs, 0,1,2

Re: cpufreq_stats NULL deref on second system suspend

2013-09-11 Thread Viresh Kumar
On 12 September 2013 12:16, Srivatsa S. Bhat wrote: > Of course, if we change the suspend/resume sequence and that fixes this, that > would be like getting it for free, nobody would say no to it ;-) Not really :) Policy with 4 CPUs, 0,1,2,3, policy->cpu currently set to 1, 2 or 3... We will rem

Re: cpufreq_stats NULL deref on second system suspend

2013-09-11 Thread Srivatsa S. Bhat
On 09/12/2013 12:11 PM, Viresh Kumar wrote: > On 12 September 2013 11:56, Srivatsa S. Bhat > wrote: >> I had the same thought when solving this bug.. We have had similar issues >> with >> CPU hotplug notifiers too: why are they invoked in the same order during both >> CPU down and up, instead of

Re: cpufreq_stats NULL deref on second system suspend

2013-09-11 Thread Viresh Kumar
On 12 September 2013 11:56, Srivatsa S. Bhat wrote: > I had the same thought when solving this bug.. We have had similar issues with > CPU hotplug notifiers too: why are they invoked in the same order during both > CPU down and up, instead of reversing the order? I even had a patchset to > perfor

Re: cpufreq_stats NULL deref on second system suspend

2013-09-11 Thread Srivatsa S. Bhat
On 09/12/2013 11:22 AM, Viresh Kumar wrote: > Let me fix my mail first.. I was running out of time yesterday and so couldn't > frame things correctly :) > > On 11 September 2013 17:29, Viresh Kumar wrote: >> Okay.. There are two different ways in which cpufreq_add_dev() work >> currently.. >> >>

Re: cpufreq_stats NULL deref on second system suspend

2013-09-11 Thread Viresh Kumar
On 12 September 2013 01:16, Srivatsa S. Bhat wrote: > From: Srivatsa S. Bhat > Subject: [PATCH] cpufreq: Restructure if/else block to avoid unintended > behavior > > In __cpufreq_remove_dev_prepare(), the code which decides whether to remove > the sysfs link or nominate a new policy cpu, is gove

Re: cpufreq_stats NULL deref on second system suspend

2013-09-11 Thread Viresh Kumar
On 12 September 2013 00:12, Srivatsa S. Bhat wrote: > OK, I took a second look at the code, and I suspect that applying the > second patch might help. So can you try by applying both the patches > please[1][2]? > > Basically here is my hunch: say CPUs 2 and 3 are part of a policy and > 3 is the po

Re: cpufreq_stats NULL deref on second system suspend

2013-09-11 Thread Viresh Kumar
On 12 September 2013 00:33, Stephen Warren wrote: > For the record, I'm testing on a 2-CPU system, so I'm not sure whether > your explanation applies; it talks about CPUs 2 and 3 whereas I only > have CPUs 0 and 1, but perhaps your explanation applies equally to any > pair of CPUs? It does apply

Re: cpufreq_stats NULL deref on second system suspend

2013-09-11 Thread Viresh Kumar
Let me fix my mail first.. I was running out of time yesterday and so couldn't frame things correctly :) On 11 September 2013 17:29, Viresh Kumar wrote: > Okay.. There are two different ways in which cpufreq_add_dev() work > currently.. > > Boot cluster (i.e. policy with boot CPU) > -

Re: cpufreq_stats NULL deref on second system suspend

2013-09-11 Thread Stephen Warren
On 09/11/2013 01:46 PM, Srivatsa S. Bhat wrote: > On 09/12/2013 12:33 AM, Stephen Warren wrote: >> On 09/11/2013 12:42 PM, Srivatsa S. Bhat wrote: >> ... >>> OK, I took a second look at the code, and I suspect that applying the >>> second patch might help. So can you try by applying both the patche

Re: cpufreq_stats NULL deref on second system suspend

2013-09-11 Thread Srivatsa S. Bhat
On 09/12/2013 12:33 AM, Stephen Warren wrote: > On 09/11/2013 12:42 PM, Srivatsa S. Bhat wrote: > ... >> OK, I took a second look at the code, and I suspect that applying the >> second patch might help. So can you try by applying both the patches >> please[1][2]? >> > ... >> [1]. http://marc.info/?

Re: cpufreq_stats NULL deref on second system suspend

2013-09-11 Thread Srivatsa S. Bhat
On 09/12/2013 01:37 AM, Stephen Warren wrote: > On 09/11/2013 01:46 PM, Srivatsa S. Bhat wrote: >> On 09/12/2013 12:33 AM, Stephen Warren wrote: >>> On 09/11/2013 12:42 PM, Srivatsa S. Bhat wrote: >>> ... OK, I took a second look at the code, and I suspect that applying the second patch m

Re: cpufreq_stats NULL deref on second system suspend

2013-09-11 Thread Stephen Warren
On 09/11/2013 12:42 PM, Srivatsa S. Bhat wrote: ... > OK, I took a second look at the code, and I suspect that applying the > second patch might help. So can you try by applying both the patches > please[1][2]? > ... > [1]. http://marc.info/?l=linux-kernel&m=137889516210816&w=2 > [2]. http://marc.

Re: cpufreq_stats NULL deref on second system suspend

2013-09-11 Thread Srivatsa S. Bhat
On 09/11/2013 11:33 PM, Srivatsa S. Bhat wrote: > On 09/11/2013 09:35 PM, Stephen Warren wrote: >> On 09/11/2013 04:21 AM, Srivatsa S. Bhat wrote: >>> On 09/11/2013 04:04 AM, Rafael J. Wysocki wrote: On Tuesday, September 10, 2013 02:53:01 PM Stephen Warren wrote: > On 09/09/2013 05:14 PM,

Re: cpufreq_stats NULL deref on second system suspend

2013-09-11 Thread Srivatsa S. Bhat
On 09/11/2013 09:35 PM, Stephen Warren wrote: > On 09/11/2013 04:21 AM, Srivatsa S. Bhat wrote: >> On 09/11/2013 04:04 AM, Rafael J. Wysocki wrote: >>> On Tuesday, September 10, 2013 02:53:01 PM Stephen Warren wrote: On 09/09/2013 05:14 PM, Rafael J. Wysocki wrote: > On Monday, September 0

Re: cpufreq_stats NULL deref on second system suspend

2013-09-11 Thread Stephen Warren
On 09/11/2013 04:21 AM, Srivatsa S. Bhat wrote: > On 09/11/2013 04:04 AM, Rafael J. Wysocki wrote: >> On Tuesday, September 10, 2013 02:53:01 PM Stephen Warren wrote: >>> On 09/09/2013 05:14 PM, Rafael J. Wysocki wrote: On Monday, September 09, 2013 03:29:06 PM Stephen Warren wrote: > On 0

Re: cpufreq_stats NULL deref on second system suspend

2013-09-11 Thread Srivatsa S. Bhat
On 09/11/2013 05:29 PM, Viresh Kumar wrote: > On 11 September 2013 16:44, Srivatsa S. Bhat > wrote: >> Hmm? The problem is not about merely updating the policy->cpu field; the >> main issue is that the existing code was not letting the cpufreq-stats >> code know that we updated the policy->cpu und

Re: cpufreq_stats NULL deref on second system suspend

2013-09-11 Thread Viresh Kumar
On 11 September 2013 16:44, Srivatsa S. Bhat wrote: > Hmm? The problem is not about merely updating the policy->cpu field; the > main issue is that the existing code was not letting the cpufreq-stats > code know that we updated the policy->cpu under the hood. It is important > for cpufreq-stats to

Re: cpufreq_stats NULL deref on second system suspend

2013-09-11 Thread Viresh Kumar
On 11 September 2013 16:47, Srivatsa S. Bhat wrote: > See my next reply :-) I was composing it :-) > > Man, you are *fast*! ;-) haha... -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majord...@vger.kernel.org More majordomo info at http://v

Re: cpufreq_stats NULL deref on second system suspend

2013-09-11 Thread Srivatsa S. Bhat
On 09/11/2013 04:45 PM, Viresh Kumar wrote: > On 11 September 2013 16:40, Srivatsa S. Bhat > wrote: >> On 09/11/2013 04:14 PM, Viresh Kumar wrote: >>> On 11 September 2013 15:51, Srivatsa S. Bhat >>> wrote: On 09/11/2013 04:04 AM, Rafael J. Wysocki wrote: > On Tuesday, September 10, 2013

Re: cpufreq_stats NULL deref on second system suspend

2013-09-11 Thread Srivatsa S. Bhat
On 09/11/2013 04:15 PM, Viresh Kumar wrote: > On 11 September 2013 16:14, Viresh Kumar wrote: >> But I would have solved it differently :) >> >> We don't really need to call update_policy_cpu() again and again >> as we don't really need to update policy->cpu... >> >> Rather it would be better to j

Re: cpufreq_stats NULL deref on second system suspend

2013-09-11 Thread Viresh Kumar
On 11 September 2013 16:40, Srivatsa S. Bhat wrote: > On 09/11/2013 04:14 PM, Viresh Kumar wrote: >> On 11 September 2013 15:51, Srivatsa S. Bhat >> wrote: >>> On 09/11/2013 04:04 AM, Rafael J. Wysocki wrote: On Tuesday, September 10, 2013 02:53:01 PM Stephen Warren wrote: >> > Sure, it'

Re: cpufreq_stats NULL deref on second system suspend

2013-09-11 Thread Srivatsa S. Bhat
On 09/11/2013 04:14 PM, Viresh Kumar wrote: > On 11 September 2013 15:51, Srivatsa S. Bhat > wrote: >> On 09/11/2013 04:04 AM, Rafael J. Wysocki wrote: >>> On Tuesday, September 10, 2013 02:53:01 PM Stephen Warren wrote: > Sure, it's due to 5302c3f "cpufreq: Perform light-weight init/teardow

Re: cpufreq_stats NULL deref on second system suspend

2013-09-11 Thread Srivatsa S. Bhat
On 09/11/2013 03:51 PM, Srivatsa S. Bhat wrote: > On 09/11/2013 04:04 AM, Rafael J. Wysocki wrote: >> On Tuesday, September 10, 2013 02:53:01 PM Stephen Warren wrote: >>> On 09/09/2013 05:14 PM, Rafael J. Wysocki wrote: On Monday, September 09, 2013 03:29:06 PM Stephen Warren wrote: > On 0

Re: cpufreq_stats NULL deref on second system suspend

2013-09-11 Thread Viresh Kumar
On 11 September 2013 16:14, Viresh Kumar wrote: > But I would have solved it differently :) > > We don't really need to call update_policy_cpu() again and again > as we don't really need to update policy->cpu... > > Rather it would be better to just move following inside > cpufreq_policy_alloc():

Re: cpufreq_stats NULL deref on second system suspend

2013-09-11 Thread Viresh Kumar
On 11 September 2013 15:51, Srivatsa S. Bhat wrote: > On 09/11/2013 04:04 AM, Rafael J. Wysocki wrote: >> On Tuesday, September 10, 2013 02:53:01 PM Stephen Warren wrote: >>> Sure, it's due to 5302c3f "cpufreq: Perform light-weight init/teardown >>> during suspend/resume". Sorry Stephen, I was a

Re: cpufreq_stats NULL deref on second system suspend

2013-09-11 Thread Srivatsa S. Bhat
On 09/11/2013 04:04 AM, Rafael J. Wysocki wrote: > On Tuesday, September 10, 2013 02:53:01 PM Stephen Warren wrote: >> On 09/09/2013 05:14 PM, Rafael J. Wysocki wrote: >>> On Monday, September 09, 2013 03:29:06 PM Stephen Warren wrote: On 09/09/2013 02:24 PM, Rafael J. Wysocki wrote: > On