From: john stultz <johnstul@us.ibm.com>
To: Magnus Damm <magnus.damm@gmail.com>
Cc: linux-kernel@vger.kernel.org, mingo@elte.hu, lethal@linux-sh.org,
tglx@linutronix.de, akpm@linux-foundation.org
Subject: Re: [PATCH] clocksource: save mult_orig in clocksource_disable()
Date: Thu, 18 Jun 2009 12:17:12 -0700 [thread overview]
Message-ID: <1245352632.7508.1.camel@localhost.localdomain> (raw)
In-Reply-To: <20090618152432.10136.9932.sendpatchset@rx1.opensource.se>
On Fri, 2009-06-19 at 00:24 +0900, Magnus Damm wrote:
> From: Magnus Damm <damm@igel.co.jp>
>
> Save clocksource mult_orig in clocksource_disable().
>
> To fix the common case where ->enable() does not setup
> mult, make sure mult_orig is saved in mult on disable.
>
> Also add comments to explain why we do this.
>
> Signed-off-by: Magnus Damm <damm@igel.co.jp>
Acked-by: John Stultz <johnstul@us.ibm.com>
Thomas, Andrew, please push this for 2.6.31.
thanks
-john
> ---
>
> include/linux/clocksource.h | 12 +++++++++++-
> 1 file changed, 11 insertions(+), 1 deletion(-)
>
> --- 0001/include/linux/clocksource.h
> +++ work/include/linux/clocksource.h 2009-06-19 00:12:16.000000000 +0900
> @@ -293,7 +293,11 @@ static inline int clocksource_enable(str
> if (cs->enable)
> ret = cs->enable(cs);
>
> - /* save mult_orig on enable */
> + /* The frequency may have changed while the clocksource
> + * was disabled. If so the code in ->enable() must update
> + * the mult value to reflect the new frequency. Make sure
> + * mult_orig follows this change.
> + */
> cs->mult_orig = cs->mult;
>
> return ret;
> @@ -309,6 +313,12 @@ static inline int clocksource_enable(str
> */
> static inline void clocksource_disable(struct clocksource *cs)
> {
> + /* Save mult_orig in mult so clocksource_enable() can
> + * restore the value regardless if ->enable() updates
> + * the value of mult or not.
> + */
> + cs->mult = cs->mult_orig;
> +
> if (cs->disable)
> cs->disable(cs);
> }
next prev parent reply other threads:[~2009-06-18 19:17 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-06-18 15:24 [PATCH] clocksource: save mult_orig in clocksource_disable() Magnus Damm
2009-06-18 19:17 ` john stultz [this message]
2009-06-26 5:30 ` Magnus Damm
2009-07-31 12:18 ` Ingo Molnar
2009-07-31 14:23 ` Magnus Damm
2009-07-31 17:33 ` john stultz
2009-07-31 17:28 ` john stultz
2009-07-30 19:57 ` [tip:timers/urgent] " tip-bot for Magnus Damm
2009-07-31 12:16 ` [tip:timers/urgent] clocksource: Save " tip-bot for Magnus Damm
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=1245352632.7508.1.camel@localhost.localdomain \
--to=johnstul@us.ibm.com \
--cc=akpm@linux-foundation.org \
--cc=lethal@linux-sh.org \
--cc=linux-kernel@vger.kernel.org \
--cc=magnus.damm@gmail.com \
--cc=mingo@elte.hu \
--cc=tglx@linutronix.de \
/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