linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
From: tglx@linutronix.de (Thomas Gleixner)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH v2 2/2] clocksource: don't suspend/resume when unused
Date: Tue, 20 Jan 2015 12:13:08 +0100 (CET)	[thread overview]
Message-ID: <alpine.DEB.2.11.1501201153140.5526@nanos> (raw)
In-Reply-To: <1421427439-11699-3-git-send-email-alexandre.belloni@free-electrons.com>

On Fri, 16 Jan 2015, Alexandre Belloni wrote:

> There is no point in calling suspend/resume for unused
> clocksources.

That's true, but ....
 
> Signed-off-by: Alexandre Belloni <alexandre.belloni@free-electrons.com>
> ---
>  kernel/time/clocksource.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/kernel/time/clocksource.c b/kernel/time/clocksource.c
> index 03cfc5a08e3b..da65b3b73a86 100644
> --- a/kernel/time/clocksource.c
> +++ b/kernel/time/clocksource.c
> @@ -493,7 +493,7 @@ void clocksource_suspend(void)
>  	struct clocksource *cs;
>  
>  	list_for_each_entry_reverse(cs, &clocksource_list, list)
> -		if (cs->suspend)
> +		if (cs->suspend && (cs->flags & CLOCK_SOURCE_USED))
>  			cs->suspend(cs);
>  }
>  
> @@ -505,7 +505,7 @@ void clocksource_resume(void)
>  	struct clocksource *cs;
>  
>  	list_for_each_entry(cs, &clocksource_list, list)
> -		if (cs->resume)
> +		if (cs->resume && (cs->flags & CLOCK_SOURCE_USED))
>  			cs->resume(cs);

I had a deeper look at the clocksources which have a resume
callback. We have implementations, which rely on the resume callback
being called unconditionally. e.g.: arch/x86/kernel/hpet.c. And there
are a few others which have extra PM code in the suspend/resume path
independent of the fact whether the clocksource is enabled or not.

So we really need to make this opt-in with a per clocksource flag.

Thanks,

	tglx

  reply	other threads:[~2015-01-20 11:13 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-01-16 16:57 [PATCH v2 0/2] clocksource: don't suspend/resume when unused Alexandre Belloni
2015-01-16 16:57 ` [PATCH v2 1/2] clocksource: track usage Alexandre Belloni
2015-01-16 19:05   ` John Stultz
2015-01-17  1:26     ` Alexandre Belloni
2015-01-20 10:51   ` Thomas Gleixner
2015-01-16 16:57 ` [PATCH v2 2/2] clocksource: don't suspend/resume when unused Alexandre Belloni
2015-01-20 11:13   ` Thomas Gleixner [this message]
2015-01-16 17:45 ` [PATCH v2 0/2] " Boris Brezillon

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=alpine.DEB.2.11.1501201153140.5526@nanos \
    --to=tglx@linutronix.de \
    --cc=linux-arm-kernel@lists.infradead.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;
as well as URLs for NNTP newsgroup(s).