From: Stephen Boyd <sboyd@codeaurora.org>
To: Robert Jarzmik <robert.jarzmik@free.fr>
Cc: Michael Turquette <mturquette@baylibre.com>,
linux-clk@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH v2 5/5] clk: pxa: transfer CPU clock setting from pxa2xx-cpufreq
Date: Wed, 2 Nov 2016 15:26:58 -0700 [thread overview]
Message-ID: <20161102222658.GU16026@codeaurora.org> (raw)
In-Reply-To: <87y411zxua.fsf@belgarion.home>
On 11/02, Robert Jarzmik wrote:
> Stephen Boyd <sboyd@codeaurora.org> writes:
>
> > On 10/23, Robert Jarzmik wrote:
> >> diff --git a/drivers/clk/pxa/clk-pxa.c b/drivers/clk/pxa/clk-pxa.c
> >> index 29cee9e8d4d9..7184819b7415 100644
> >> --- a/drivers/clk/pxa/clk-pxa.c
> >> +++ b/drivers/clk/pxa/clk-pxa.c
> >> +void pxa2xx_core_turbo_switch(bool on)
> >> +{
> >> + unsigned long flags;
> >> + unsigned int unused, clkcfg;
> >> +
> >> + local_irq_save(flags);
> >> +
> >> + asm("mrc\tp14, 0, %0, c6, c0, 0" : "=r" (clkcfg));
> >
> > \t is odd style, but I guess this is copied from somewhere?
> Yeah ... and yes, that \t is indeed ugly now I look at it. A space could be more
> welcome ...
>
> > Should it be volatile? Or is it ok for the clkcfg value to be
> > cached here?
>
> I don't see how it could be cached ... The asm statement produces a result used
> afterwards, I don't think the compiler can optimize that out. I would have
> understood if this was in a loop, but here I don't see.
>
> Note that I'm not reluctant to add it, I just want to check which optimization
> case we're talking about to see if I'm missing something.
>
I'm a bit rusty on asm volatile semantics but I seem to recall
that a non-volatile asm statement can be combined/merged,
reordered, etc. by the compiler. I suppose if this was in the
cpufreq driver already then changing it in this patch is not a
good idea. If anything, a follow up patch if we determine it's
actually a bug.
--
Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum,
a Linux Foundation Collaborative Project
prev parent reply other threads:[~2016-11-02 22:26 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-10-23 12:19 [PATCH v2 0/5] Make pxa core clocks settable Robert Jarzmik
2016-10-23 12:19 ` [PATCH v2 1/5] clk: pxa: remove unused variables Robert Jarzmik
2016-11-02 0:56 ` Stephen Boyd
2016-10-23 12:19 ` [PATCH v2 2/5] clk: pxa: core pll is not affected by t bit Robert Jarzmik
2016-11-02 0:56 ` Stephen Boyd
2016-10-23 12:19 ` [PATCH v2 3/5] clk: pxa: b bit of clkcfg means fast bus Robert Jarzmik
2016-11-02 0:56 ` Stephen Boyd
2016-10-23 12:19 ` [PATCH v2 4/5] clk: pxa: export core clocks Robert Jarzmik
2016-11-02 0:56 ` Stephen Boyd
2016-10-23 12:19 ` [PATCH v2 5/5] clk: pxa: transfer CPU clock setting from pxa2xx-cpufreq Robert Jarzmik
2016-11-02 0:56 ` Stephen Boyd
2016-11-02 15:49 ` Robert Jarzmik
2016-11-02 22:26 ` Stephen Boyd [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=20161102222658.GU16026@codeaurora.org \
--to=sboyd@codeaurora.org \
--cc=linux-clk@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=mturquette@baylibre.com \
--cc=robert.jarzmik@free.fr \
/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.