From: skannan@codeaurora.org (Saravana Kannan)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH V2] [ARM] Add ARCH_PROVIDES_UDELAY config option
Date: Fri, 30 Apr 2010 17:04:59 -0700 [thread overview]
Message-ID: <4BDB702B.8000008@codeaurora.org> (raw)
In-Reply-To: <87d3xgd20n.fsf@deeprootsystems.com>
On some machines/boards, the timer used for the sched clock does not
have usec accuracy. So, we should not assume that a sched clock is
sufficient.
It won't be wrong, but if we can't ever give usec level accuracy, we
shouldn't act as if we can.
Cross,
My comment about CPU freq switching while we are delay looping is
present even for non-SMP kernels. Yes, it's bad, but we don't have a
scalable solution yet. So, you might want to reword it yet again :-)
Thanks,
Saravana
Kevin Hilman wrote:
> Colin Cross <ccross@android.com> writes:
>
>> An alternative to this patch would be to add a config option to use
>> sched_clock() to provide the counter instead of the cycle loop. The
>> same loops_per_jiffy calibration could be done to determine the
>> sched_clock frequency. Any machine with an available constant tick
>> rate counter, which is likely to be used for sched_clock() already,
>> can enable CONFIG_UDELAY_USES_SCHED_CLOCK.
>
> Or even better, why not have an option to use the clocksource which is
> most likely using the constant tick timer as well.
>
> Kevin
>
>> On Fri, Apr 30, 2010 at 12:12 PM, Colin Cross <ccross@android.com> wrote:
>>> On SMP kernels, the loops_per_jiffy value is not scaled due to the
>>> possibility of one CPU affecting the speed of another CPU while the
>>> second CPU is in a udelay loop. Since loops_per_jiffy is calculated
>>> once on boot for SMP kernels, udelays are too long if the CPU
>>> frequency is scaled down from the boot frequency, or too short if the
>>> frequency is scaled up. Some SOCs have a timer with a constant tick
>>> rate that can be used to time udelays, similar to the TSC on x86.
>>> Provide a config flag to allow these SOCs to override the default
>>> ARM udelay implementation.
>>>
>>> Signed-off-by: Colin Cross <ccross@android.com>
next prev parent reply other threads:[~2010-05-01 0:04 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-04-30 19:12 [PATCH V2] [ARM] Add ARCH_PROVIDES_UDELAY config option Colin Cross
2010-04-30 19:37 ` Colin Cross
2010-04-30 22:11 ` Kevin Hilman
2010-05-01 0:04 ` Saravana Kannan [this message]
2010-05-01 10:01 ` Russell King - ARM Linux
2010-05-21 22:01 ` Saravana Kannan
2010-05-21 22:06 ` Russell King - ARM Linux
2010-05-21 22:10 ` Saravana Kannan
2010-05-28 0:41 ` Saravana Kannan
2010-06-22 1:14 ` Saravana Kannan
2010-06-28 2:30 ` Colin Cross
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=4BDB702B.8000008@codeaurora.org \
--to=skannan@codeaurora.org \
--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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.