From: Stephen Boyd <sboyd@codeaurora.org>
To: Peter De Schrijver <pdeschrijver@nvidia.com>
Cc: linux-tegra@vger.kernel.org, linux-clk@vger.kernel.org
Subject: Re: [PATCH 2/4] clk: tegra: add fence_delay for clock registers
Date: Tue, 14 Nov 2017 16:41:32 -0800 [thread overview]
Message-ID: <20171115004132.GM11955@codeaurora.org> (raw)
In-Reply-To: <1510313868-24810-3-git-send-email-pdeschrijver@nvidia.com>
On 11/10, Peter De Schrijver wrote:
> Signed-off-by: Peter De Schrijver <pdeschrijver@nvidia.com>
Some commit text perhaps explaining why we add this?
> ---
> drivers/clk/tegra/clk.h | 7 +++++++
> 1 file changed, 7 insertions(+)
>
> diff --git a/drivers/clk/tegra/clk.h b/drivers/clk/tegra/clk.h
> index 872f118..3b8947e 100644
> --- a/drivers/clk/tegra/clk.h
> +++ b/drivers/clk/tegra/clk.h
> @@ -809,4 +809,11 @@ static inline struct clk *tegra_clk_register_emc(void __iomem *base,
> u16 tegra_pll_get_fixed_mdiv(struct clk_hw *hw, unsigned long input_rate);
> int tegra_pll_p_div_to_hw(struct tegra_clk_pll *pll, u8 p_div);
>
> +/* Combined read fence with delay */
> +#define fence_udelay(delay, reg) \
> + do { \
> + readl_relaxed(reg); \
> + udelay(delay); \
Does the udelay() need to be after the readl()? As far as I
recall, the delay can start spinning before the read returns
because there isn't any sort of barrier between the two. One
approach would be to have an mb() between the read and the delay
so that the read is ordered with respect to the delay. If not, we
need a better comment than "combined read fence with delay".
--
Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum,
a Linux Foundation Collaborative Project
next prev parent reply other threads:[~2017-11-15 0:41 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-11-10 11:37 [PATCH 0/4] MBIST WAR for Tegra210 Peter De Schrijver
2017-11-10 11:37 ` [PATCH 1/4] clk: tegra: Add la clock " Peter De Schrijver
2017-11-15 0:42 ` Stephen Boyd
2017-11-10 11:37 ` [PATCH 2/4] clk: tegra: add fence_delay for clock registers Peter De Schrijver
2017-11-15 0:41 ` Stephen Boyd [this message]
2017-11-16 11:27 ` Peter De Schrijver
2017-11-10 11:37 ` [PATCH 3/4] clk: tegra: MBIST WAR for Tegra210 Peter De Schrijver
2017-11-10 11:37 ` [PATCH 4/4] soc/tegra: pmc: apply " Peter De Schrijver
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=20171115004132.GM11955@codeaurora.org \
--to=sboyd@codeaurora.org \
--cc=linux-clk@vger.kernel.org \
--cc=linux-tegra@vger.kernel.org \
--cc=pdeschrijver@nvidia.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).