mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: "Rafael J. Wysocki" <rjw@rjwysocki.net>
To: Geert Uytterhoeven <geert+renesas@glider.be>
Cc: Kevin Hilman <khilman@kernel.org>,
	Ulf Hansson <ulf.hansson@linaro.org>,
	linux-pm@vger.kernel.org, linux-sh@vger.kernel.org,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH] PM / Domains: Skip latency measurements if timekeeping is suspended
Date: Wed, 18 Mar 2015 23:30:08 +0100	[thread overview]
Message-ID: <19573969.Pdd3px1nTO@vostro.rjw.lan> (raw)
In-Reply-To: <1426695946-21705-1-git-send-email-geert+renesas@glider.be>

On Wednesday, March 18, 2015 05:25:46 PM Geert Uytterhoeven wrote:
> The PM Domain code uses ktime_get() to perform various latency
> measurements.  However, if ktime_get() is called while timekeeping is
> suspended, the following warning is printed:
> 
>     WARNING: CPU: 0 PID: 1340 at kernel/time/timekeeping.c:576 ktime_get+0x30/0xf4()
> 
> This happens when resuming the PM Domain that contains the clock events
> source. Chain of operations is:
> 
>     timekeeping_resume()
>     {
>         clockevents_resume()
>             sh_cmt_clock_event_resume()
>                 pm_genpd_syscore_poweron()
>                     pm_genpd_sync_poweron()
>                         genpd_power_on()
>                             ktime_get(), but timekeeping_suspended == 1
>         ...
>         timekeeping_suspended = 0;
>     }
> 
> Skip all latency measurements if timekeeping is suspended to fix this.

I don't think that this is where we should fix it.  At least using
timekeeping_suspended outside of the timekeeping core would not be
welcome by its maintainers.

> Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
> ---
> I'm not sure if this is needed for all latency measurements.
> So far I only encountered it while powering-on a clock domain during
> resume from s2ram.

The problem seems to be that the clock domain is powered on in a
syscore resume routine which happens to be called before timekeeping_resume().
It looks like we either need to force the right ordering somehow or have a
special variant of GENPD_DEV_TIMED_CALLBACK() for syscore suspend/resume that
won't do the latency measurement at all (which doesn't make much sense at
this point, because time is effectively "frozen" then).

Rafael


  reply	other threads:[~2015-03-18 22:06 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-03-18 16:25 Geert Uytterhoeven
2015-03-18 22:30 ` Rafael J. Wysocki [this message]
2015-03-19  8:54   ` Geert Uytterhoeven

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=19573969.Pdd3px1nTO@vostro.rjw.lan \
    --to=rjw@rjwysocki.net \
    --cc=geert+renesas@glider.be \
    --cc=khilman@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-pm@vger.kernel.org \
    --cc=linux-sh@vger.kernel.org \
    --cc=ulf.hansson@linaro.org \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®