From: Srinivas KANDAGATLA <srinivas.kandagatla@st.com>
To: Stephen Boyd <sboyd@codeaurora.org>
Cc: linux-doc@vger.kernel.org, devicetree-discuss@lists.ozlabs.org,
Will Deacon <will.deacon@arm.com>,
linux-kernel@vger.kernel.org,
Rob Herring <rob.herring@calxeda.com>,
Stuart Menefy <stuart.menefy@st.com>,
John Stultz <john.stultz@linaro.org>,
Grant Likely <grant.likely@linaro.org>,
Thomas Gleixner <tglx@linutronix.de>
Subject: Re: [PATCH v5] clocksource:arm_global_timer: Add ARM global timer support.
Date: Tue, 25 Jun 2013 09:38:15 +0100 [thread overview]
Message-ID: <51C956F7.2040502@st.com> (raw)
In-Reply-To: <51C8C35C.70307@codeaurora.org>
Thankyou for the comments.
On 24/06/13 23:08, Stephen Boyd wrote:
> On 06/24/13 08:53, Srinivas KANDAGATLA wrote:
>> +#include <linux/clkdev.h>
>
> Why do you need this include?
>
>> +#include <asm/mach/irq.h>
>
> And this one?
Removed them.
>
>> +static u64 gt_counter_read(void)
>> +{
>> + u64 counter;
>> + u32 lower;
>> + u32 upper, old_upper;
>> +
>> + upper = readl_relaxed(gt_base + GT_COUNTER1);
>> + do {
>> + old_upper = upper;
>> + lower = readl_relaxed(gt_base + GT_COUNTER0);
>> + upper = readl_relaxed(gt_base + GT_COUNTER1);
> [snip]
>> +static void gt_compare_set(unsigned long delta, int periodic)
>> +{
>> + u64 counter = gt_counter_read();
>> + unsigned long ctrl = readl(gt_base + GT_CONTROL);
>> +
>> + counter += delta;
>> + ctrl &= ~(GT_CONTROL_COMP_ENABLE | GT_CONTROL_IRQ_ENABLE);
>> +
>> + writel(ctrl, gt_base + GT_CONTROL);
>> + writel(lower_32_bits(counter), gt_base + GT_COMP0);
>> + writel(upper_32_bits(counter), gt_base + GT_COMP1);
>> +
>> + if (periodic) {
>> + writel(delta, gt_base + GT_AUTO_INC);
>> + ctrl |= GT_CONTROL_AUTO_INC;
>> + }
>> +
>> + ctrl |= GT_CONTROL_COMP_ENABLE | GT_CONTROL_IRQ_ENABLE;
>> + writel(ctrl, gt_base + GT_CONTROL);
>> +}
>
> Why is there a mix of the relaxed and non-relaxed io accessors?
gt_counter_read will be used very frequently, so using relaxed can
reduce latencies involved in memory barriers.
>
>> +#ifdef CONFIG_CLKSRC_ARM_GLOBAL_TIMER_SCHED_CLOCK
>> +static u32 gt_sched_clock_read(void)
>
> notrace
>
Ok, fixed it.
>> +{
>> + if (!gt_base)
>> + return 0;
>
> Seems impossible? Remove this check?
Yep, I agree this case is impossible in the code flow.
>
Thanks,
srini
prev parent reply other threads:[~2013-06-25 8:38 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-06-24 15:53 [PATCH v5] clocksource:arm_global_timer: Add ARM global timer support Srinivas KANDAGATLA
[not found] ` <1372089195-29219-1-git-send-email-srinivas.kandagatla-qxv4g6HH51o@public.gmane.org>
2013-06-24 20:01 ` Thomas Gleixner
2013-06-24 21:10 ` Srinivas KANDAGATLA
2013-06-24 20:06 ` Stephen Boyd
2013-06-24 21:08 ` Srinivas KANDAGATLA
2013-06-24 22:00 ` Stephen Boyd
[not found] ` <51C8C172.8020207-sgV2jX0FEOL9JmXXK+q4OQ@public.gmane.org>
2013-06-25 8:40 ` Srinivas KANDAGATLA
2013-06-24 22:08 ` Stephen Boyd
2013-06-25 8:38 ` Srinivas KANDAGATLA [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=51C956F7.2040502@st.com \
--to=srinivas.kandagatla@st.com \
--cc=devicetree-discuss@lists.ozlabs.org \
--cc=grant.likely@linaro.org \
--cc=john.stultz@linaro.org \
--cc=linux-doc@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=rob.herring@calxeda.com \
--cc=sboyd@codeaurora.org \
--cc=stuart.menefy@st.com \
--cc=tglx@linutronix.de \
--cc=will.deacon@arm.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;
as well as URLs for NNTP newsgroup(s).