linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
From: johnstul@us.ibm.com (john stultz)
To: linux-arm-kernel@lists.infradead.org
Subject: Different definition in div_sc and clocksource_cyc2ns
Date: Fri, 5 Mar 2010 13:29:42 -0800	[thread overview]
Message-ID: <1f1b08da1003051329ta5b905dq69eef81aedd4f463@mail.gmail.com> (raw)
In-Reply-To: <10d816431003051314i3e87a2d2yab344826d14a310a@mail.gmail.com>

On Fri, Mar 5, 2010 at 1:14 PM, Lin Mac <mkl0301@gmail.com> wrote:
> While working with the clocksource, I found that the relation of cycle
> and nanosecond of div_sc and clocksource_cyc2ns is different.
>
> linux-2.6.33
> div_sc in include/linux/clockchips.h suggests that clock_ticks =
> (nanoseconds * factor) >> shift.

> However, clocksource_cyc2ns in include/linux/clocksource.h suggest
> nanoseconds=(cycles*mult)>>shift.

You're comparing similar helper conversion functions from two
different subsystems.

Both use similar shifted math, but the div_sc() is for clockchips.h,
which is used by the clockevents code to trigger interrupts at a
specified time, while clocksource_cyc2ns() is for the clocksource
code, which converts  clockosurce cycles into nanoseconds for
timekeeping.


thanks
-john

      reply	other threads:[~2010-03-05 21:29 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-03-05 21:14 Different definition in div_sc and clocksource_cyc2ns Lin Mac
2010-03-05 21:29 ` 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=1f1b08da1003051329ta5b905dq69eef81aedd4f463@mail.gmail.com \
    --to=johnstul@us.ibm.com \
    --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).