From: Srinivas KANDAGATLA <srinivas.kandagatla@st.com>
To: Arnd Bergmann <arnd@arndb.de>
Cc: linux-arm-kernel@lists.infradead.org,
Rob Landley <rob@landley.net>,
Grant Likely <grant.likely@linaro.org>,
Rob Herring <rob.herring@calxeda.com>,
Russell King <linux@arm.linux.org.uk>,
Stuart Menefy <stuart.menefy@st.com>,
John Stultz <john.stultz@linaro.org>,
Thomas Gleixner <tglx@linutronix.de>,
Linus Walleij <linus.walleij@linaro.org>,
Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
Jiri Slaby <jslaby@suse.cz>,
linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org,
devicetree-discuss@lists.ozlabs.org, kernel@stlinux.com,
linux-serial@vger.kernel.org, Mark Brown <broonie@kernel.org>,
Stephen Gallimore <stephen.gallimore@st.com>,
Rob Herring <robherring2@gmail.com>,
Will Deacon <will.deacon@arm.com>
Subject: Re: [PATCH v3 02/10] clocksource:arm_global_timer: Add ARM global timer support.
Date: Fri, 21 Jun 2013 08:15:28 +0100 [thread overview]
Message-ID: <51C3FD90.8010505@st.com> (raw)
In-Reply-To: <201306202102.30478.arnd@arndb.de>
On 20/06/13 20:02, Arnd Bergmann wrote:
> On Thursday 20 June 2013, Srinivas KANDAGATLA wrote:
>> +static u64 gt_counter_read(void)
>> +{
>> + u64 counter;
>> + u32 lower;
>> + u32 upper, old_upper;
>> +
>> + upper = __raw_readl(gt_base + GT_COUNTER1);
>> + do {
>> + old_upper = upper;
>> + lower = __raw_readl(gt_base + GT_COUNTER0);
>> + upper = __raw_readl(gt_base + GT_COUNTER1);
>> + } while (upper != old_upper);
>> +
>> + counter = upper;
>> + counter <<= 32;
>> + counter |= lower;
>> + return counter;
>> +}
>
> Please replace __raw_readl etc with the non-__raw variants
> throughout the code.
>
> The __raw accessors are not endian safe and are not meant
> for device drivers. If you are worried about latency from
> extra barriers, use readl_relaxed().
Endian safe is good point. I will move to using readl/writel which does
both ordering and byteswapping.
And use relaxed versions in gt_counter_read to reduce the latency.
looks like smp_twd.c too needs this type of change.
Thanks,
srini
>
> Arnd
>
next prev parent reply other threads:[~2013-06-21 7:15 UTC|newest]
Thread overview: 27+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-06-20 14:03 [PATCH v3 00/10] ARM:STixxxx: Add STixxxx platform and board support Srinivas KANDAGATLA
2013-06-20 14:05 ` [PATCH v3 02/10] clocksource:arm_global_timer: Add ARM global timer support Srinivas KANDAGATLA
2013-06-20 19:02 ` Arnd Bergmann
2013-06-21 7:15 ` Srinivas KANDAGATLA [this message]
[not found] ` <1371736996-8770-1-git-send-email-srinivas.kandagatla-qxv4g6HH51o@public.gmane.org>
2013-06-20 14:05 ` [PATCH v3 01/10] serial:st-asc: Add ST ASC driver Srinivas KANDAGATLA
2013-06-20 19:01 ` Arnd Bergmann
2013-06-21 9:17 ` Srinivas KANDAGATLA
2013-06-21 13:50 ` Srinivas KANDAGATLA
2013-06-21 14:02 ` Greg Kroah-Hartman
2013-06-20 14:05 ` [PATCH v3 03/10] pinctrl:st: Add pinctrl and pinconf support Srinivas KANDAGATLA
2013-06-21 13:41 ` Srinivas KANDAGATLA
2013-06-24 11:57 ` Linus Walleij
2013-06-24 12:24 ` Srinivas KANDAGATLA
2013-06-24 14:12 ` Mark Brown
2013-06-25 9:39 ` [STLinux Kernel] " Srinivas KANDAGATLA
2013-06-25 10:58 ` Linus Walleij
2013-06-25 11:08 ` [STLinux Kernel] " Srinivas KANDAGATLA
2013-06-25 15:35 ` Mark Brown
2013-06-20 14:05 ` [PATCH v3 04/10] ARM:stixxxx: Add STiH415 SOC support Srinivas KANDAGATLA
2013-06-20 14:06 ` [PATCH v3 05/10] ARM:stixxxx: Add STiH416 " Srinivas KANDAGATLA
2013-06-20 14:06 ` [PATCH v3 06/10] ARM:stixxxx: Add DEBUG_LL console support Srinivas KANDAGATLA
2013-06-20 18:55 ` Arnd Bergmann
2013-06-21 6:50 ` Srinivas KANDAGATLA
2013-06-20 14:06 ` [PATCH v3 07/10] ARM:multi_v7_defconfig: rerun savedefconfig Srinivas KANDAGATLA
2013-06-20 14:06 ` [PATCH v3 08/10] ARM:stixxxx: Add stixxxx options to multi_v7_defconfig Srinivas KANDAGATLA
2013-06-20 14:06 ` [PATCH v3 09/10] ARM:stih41x: Add B2000 board support Srinivas KANDAGATLA
2013-06-20 14:07 ` [PATCH v3 10/10] ARM:stih41x: Add B2020 " Srinivas KANDAGATLA
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=51C3FD90.8010505@st.com \
--to=srinivas.kandagatla@st.com \
--cc=arnd@arndb.de \
--cc=broonie@kernel.org \
--cc=devicetree-discuss@lists.ozlabs.org \
--cc=grant.likely@linaro.org \
--cc=gregkh@linuxfoundation.org \
--cc=john.stultz@linaro.org \
--cc=jslaby@suse.cz \
--cc=kernel@stlinux.com \
--cc=linus.walleij@linaro.org \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-doc@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-serial@vger.kernel.org \
--cc=linux@arm.linux.org.uk \
--cc=rob.herring@calxeda.com \
--cc=rob@landley.net \
--cc=robherring2@gmail.com \
--cc=stephen.gallimore@st.com \
--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).