Re: [RFC PATCH] cpufreq: cpufreq-cpu0: do not allow transitions withregulators suspended

From: Nishanth Menon
Date: Fri Nov 15 2013 - 08:33:47 EST


On 11/15/2013 04:27 AM, Viresh Kumar wrote:
> On 14 November 2013 22:34, Nishanth Menon <nm@xxxxxx> wrote:
>> I think it is still too early to do so :(
>
> :)
:D

>
>> equivalent patch: http://pastebin.mozilla.org/3603467 (with minor
>> changes for build)
>>
>> Basic tests: http://pastebin.mozilla.org/3603456 (governor is
>> functional, but governor kicks in early before i2c is resumed)
>>
>> With call stack: http://pastebin.mozilla.org/3603455 to highlight call
>> sequences
>>
>> Seems like we might want to pause governor as early in the suspend
>> sequence as possible to allow SoC and regulator stuff to suspend
>> themselves without cpufreq interfering.. just my 2 cents..
>
> You made me spend a day on this :)
> It wasn't a day's job really but I got into a really hard to crack bug with my
> patch, I was calling __cpufreq_governor() from under write_lock_irqsave
> for cpufreq_driver_lock. And __cpufreq_governor() had:
>
> read_lock_irqsave(&cpufreq_driver_lock, flags);
>
> I wasn't able to suspend my system: ARM, X86.. It simply stopped
> printing anything and I didn't had a clue of what's going on.. Hacked
> everything possible, even kernel/power/suspend.c to return early
> (yeah I used freezer > pm_test as well, but I wanted to return before
> freezing userspace)...
>
> Then somehow I got to know that this is the wrong piece of code :)

Thanks a ton for your efforts in helping come with a generic solution.

>
> But probably I have a solution now to which you can't say:

https://patchwork.kernel.org/patch/3187511/ as a link for the records :)

>
> "I think it is still too early to do so :("
>
> :)
>
> Give it a try and give a Tested-by please :)
>
Definitely - on it.. will feedback further on the patch in proposal.

--
Regards,
Nishanth Menon
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/