public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: John Stultz <john.stultz@linaro.org>
To: Xie XiuQi <xiexiuqi@huawei.com>, Thomas Gleixner <tglx@linutronix.de>
Cc: Ingo Molnar <mingo@elte.hu>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH v2] clocksource: fix misleading comment for __clocksource_updatefreq_scale()
Date: Wed, 09 Oct 2013 16:35:35 -0700	[thread overview]
Message-ID: <5255E847.9030502@linaro.org> (raw)
In-Reply-To: <5239167D.7090404@huawei.com>

On 09/17/2013 07:57 PM, Xie XiuQi wrote:
> Functions clocksource_updatefreq_hz() and clocksource_updatefreq_khz()
> mentioned in the comment of __clocksource_updatefreq_scale() do not exist.
>
> As Thomas Gleixner's suggestion, I renamed the functions and the few call
> sites because the underscores are completely meaningless.

First of all, sorry for taking so long to reply here.

So I think the __ tries to imply that those are semi-internal functions
that aren't to be causally used w/o understanding the internal details.

> Signed-off-by: Xie XiuQi <xiexiuqi@huawei.com>
> Cc: Thomas Gleixner <tglx@linutronix.de>
> ---
>  drivers/clocksource/cadence_ttc_timer.c | 2 +-
>  drivers/clocksource/em_sti.c            | 2 +-
>  drivers/clocksource/sh_cmt.c            | 2 +-
>  drivers/clocksource/sh_tmu.c            | 2 +-
>  include/linux/clocksource.h             | 4 ++--
>  5 files changed, 6 insertions(+), 6 deletions(-)
>
> diff --git a/drivers/clocksource/cadence_ttc_timer.c b/drivers/clocksource/cadence_ttc_timer.c
> index 4cbe28c..05f00e7 100644
> --- a/drivers/clocksource/cadence_ttc_timer.c
> +++ b/drivers/clocksource/cadence_ttc_timer.c
> @@ -226,7 +226,7 @@ static int ttc_rate_change_clocksource_cb(struct notifier_block *nb,
>  		 * Do whatever is necessary to maintain a proper time base
>  		 *
>  		 * I cannot find a way to adjust the currently used clocksource
> -		 * to the new frequency. __clocksource_updatefreq_hz() sounds
> +		 * to the new frequency. clocksource_updatefreq_hz() sounds
>  		 * good, but does not work. Not sure what's that missing.
>  		 *

So I know you didn't write the comment, but my issue with this comment
is that there isn't a way to adjust the currently used clocksource
frequency, because that is totally unsupported. The
__clocksource_updatefreq_hz() method is really only there for
clocksources that are currently not in-use and are disabled.
Specifically for clocksources that may come out of resume at a different
frequency, like the sh_ ones. Hacks like what the cadence_ttc driver is
trying to do result in very poor timekeeping.

So I'm sort of on the fence about this patch.

Thomas: Any other thoughts?

thanks
-john

      reply	other threads:[~2013-10-09 23:35 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-09-18  2:57 [PATCH v2] clocksource: fix misleading comment for __clocksource_updatefreq_scale() Xie XiuQi
2013-10-09 23:35 ` John Stultz [this message]

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=5255E847.9030502@linaro.org \
    --to=john.stultz@linaro.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@elte.hu \
    --cc=tglx@linutronix.de \
    --cc=xiexiuqi@huawei.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox