All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Bjørn Mork" <bjorn@mork.no>
To: Viresh Kumar <viresh.kumar@linaro.org>
Cc: Zdenek Kabelac <zkabelac@redhat.com>,
	LKML <linux-kernel@vger.kernel.org>,
	Lan Tianyu <tianyu.lan@intel.com>,
	jinchoi@broadcom.com, Paul Bolle <pebolle@tiscali.nl>,
	ziegler@email.mathematik.uni-freiburg.de,
	"Srivatsa S. Bhat" <srivatsa.bhat@linux.vnet.ibm.com>,
	jbarnes@virtuousgeek.org, "Rafael J. Wysocki" <rjw@rjwysocki.net>
Subject: Re: Regression with suspend resume 5a87182aa21d6d5d306840feab9321818dd3e2a3
Date: Mon, 16 Dec 2013 13:19:17 +0100	[thread overview]
Message-ID: <87eh5drnsq.fsf@nemi.mork.no> (raw)
In-Reply-To: <CAKohpok+EqA+ujCwzQvL2C7YAyfueGAd4XUXGqvdz2tm5_A0QQ@mail.gmail.com> (Viresh Kumar's message of "Mon, 16 Dec 2013 16:58:03 +0530")

Viresh Kumar <viresh.kumar@linaro.org> writes:

> Adding Rafael, I though he was there on this mail :)
>
> On 16 December 2013 16:32, Bjørn Mork <bjorn@mork.no> wrote:
>> It's both patches in combination.  Interesting case, really :-)
>
> Completed my testing now and yes this happened after your patch
> came in. I read your chats somewhere else as well (there are so
> many mails, bug reports on this topic, can't give link now.. :))..
>
> I think I know why we are facing issues with these two patches in
> at the same time.
>
> - My patch is actually disabling governors at suspend/resume or
> hibernation..
> - Which makes __cpufreq_governor() a nops routine, which simply
> returns zero
> - Now with your patch you are disabling the frozen feature which
> actually makes cpufreq core to free/allocate policies again on suspend
> resume. And so the calls like:
>
> __cpufreq_governor(policy, CPUFREQ_GOV_POLICY_INIT)
>
> end up doing nothing at resume when CPUs start coming up. And so
> cpufreq_resume()'s calls to __cpufreq_governor(policy,
> CPUFREQ_GOV_START) would start behaving badly.. Which is quite
> obvious..
>
> As a summary, after my patch to suspend/resume governors we can't
> allow policies to be freed and allocated back.

How do you deal with errors on suspend/resume then?  Are you always able
to keep the policies, for all error cases?

In any case: Splitting the suspend code between a cpu hotplug hook with
special "frozen" logic and a cpufreq_suspend() called from
dpm_suspend_noirq() confuses me, and I believe many others.  This is the
reason such a bug could be caused by two "obviously fine" patches.  So
please, at least keep the suspend logic in *one* place.

Or add a BIG comment both places, explaining the dependencies. This is
never going to become obvious, and it's not going to be easier when you
have more than 2 simple patches to look at.

> Its not really a war between my patch versus yours :), but I believe the
> right thing to do at this point is to get two patches in for 3.13 as well:
>
> 5a87182 cpufreq: suspend governors on system suspend/hibernate
> and patch discussed here:
> http://www.spinics.net/lists/cpufreq/msg08720.html

Yes, that would probably work fine, at least as long as nothing goes
wrong.  I must admit that I'm in no way able to play out all the
different error scenarios in my head, but won't there still be cases
where you end up freeing policies on suspend/resume?

> To finish this problem as early as possible I tested above two
> patches and didn't saw any regressions with suspend/resume or
> Hibernation.. And obviously this fixes your issues as well :)
>
> @Rafael: I understand that it would be difficult for you to take these
> now for 3.13 but they fix some serious problems reported earlier.
> Specially the first patch which everybody thought is the culprit :)
>
> Please see if we can manage to get them in :)

I think it needs serious testing with simulated errors first.  All error
labels should be executed at least once for all combinations of inputs.

Simply trying it out and verifying that it works in the no-error case is
not enough.  Which should be quite obvious now.



Bjørn

  reply	other threads:[~2013-12-16 12:19 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-12-08 10:24 Regression with suspend resume 5a87182aa21d6d5d306840feab9321818dd3e2a3 Zdenek Kabelac
2013-12-08 11:13 ` Paul Bolle
2013-12-08 19:21   ` Zdenek Kabelac
2013-12-08 19:33     ` Paul Bolle
2013-12-16 10:40 ` Viresh Kumar
2013-12-16 11:02   ` Bjørn Mork
2013-12-16 11:28     ` Viresh Kumar
2013-12-16 12:19       ` Bjørn Mork [this message]
2013-12-16 13:51         ` Viresh Kumar
2013-12-16 11:36     ` Srivatsa S. Bhat
2013-12-16 11:36       ` Srivatsa S. Bhat

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87eh5drnsq.fsf@nemi.mork.no \
    --to=bjorn@mork.no \
    --cc=jbarnes@virtuousgeek.org \
    --cc=jinchoi@broadcom.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=pebolle@tiscali.nl \
    --cc=rjw@rjwysocki.net \
    --cc=srivatsa.bhat@linux.vnet.ibm.com \
    --cc=tianyu.lan@intel.com \
    --cc=viresh.kumar@linaro.org \
    --cc=ziegler@email.mathematik.uni-freiburg.de \
    --cc=zkabelac@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.