From: Stephen Boyd <sboyd@codeaurora.org>
To: Gabriel Fernandez <gabriel.fernandez@linaro.org>
Cc: Rob Herring <robh+dt@kernel.org>, Pawel Moll <pawel.moll@arm.com>,
Mark Rutland <mark.rutland@arm.com>,
Ian Campbell <ijc+devicetree@hellion.org.uk>,
Kumar Gala <galak@codeaurora.org>,
Srinivas Kandagatla <srinivas.kandagatla@gmail.com>,
Maxime Coquelin <maxime.coquelin@st.com>,
Patrice Chotard <patrice.chotard@st.com>,
Russell King <linux@arm.linux.org.uk>,
Michael Turquette <mturquette@baylibre.com>,
Peter Griffin <peter.griffin@linaro.org>,
Pankaj Dev <pankaj.dev@st.com>,
Olivier Bideau <olivier.bideau@st.com>,
Geert Uytterhoeven <geert+renesas@glider.be>,
Fabian Frederick <fabf@skynet.be>,
devicetree@vger.kernel.org, linux-kernel@vger.kernel.org,
linux-arm-kernel@lists.infradead.org, kernel@stlinux.com,
linux-clk@vger.kernel.org
Subject: Re: [PATCH 1/3] drivers: clk: st: Support for enable/disable in Clockgen PLLs
Date: Wed, 15 Jul 2015 16:48:23 -0700 [thread overview]
Message-ID: <20150715234823.GT30412@codeaurora.org> (raw)
In-Reply-To: <1436443060-12866-2-git-send-email-gabriel.fernandez@linaro.org>
On 07/09, Gabriel Fernandez wrote:
> @@ -270,6 +285,73 @@ static int clkgen_pll_is_enabled(struct clk_hw *hw)
> return !poweroff;
> }
>
> +static int __clkgen_pll_enable(struct clk_hw *hw)
> +{
> + struct clkgen_pll *pll = to_clkgen_pll(hw);
> + unsigned long timeout;
> + int ret = 0;
> +
> + if (clkgen_pll_is_enabled(hw))
> + return 0;
> +
> + CLKGEN_WRITE(pll, pdn_ctrl, 0);
> +
> + timeout = jiffies + msecs_to_jiffies(10);
Jiffies isn't guaranteed to increment here because
.enable/.disable is called with irqs disabled and if this is the
only CPU running it won't be getting interrupts to update
jiffies.
> +
> + while (!clkgen_pll_is_locked(hw)) {
> + if (time_after(jiffies, timeout))
> + return -ETIMEDOUT;
> + cpu_relax();
> + }
> +
> + pr_debug("%s:%s enabled\n", __clk_get_name(hw->clk), __func__);
> +
> + return ret;
> +}
--
Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum,
a Linux Foundation Collaborative Project
next prev parent reply other threads:[~2015-07-15 23:48 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-07-09 11:57 [PATCH 0/3] ST PLL improvement Gabriel Fernandez
2015-07-09 11:57 ` [PATCH 1/3] drivers: clk: st: Support for enable/disable in Clockgen PLLs Gabriel Fernandez
2015-07-15 23:48 ` Stephen Boyd [this message]
2015-07-09 11:57 ` [PATCH 2/3] drivers: clk: st: PLL rate change implementation for DVFS Gabriel Fernandez
2015-07-09 11:57 ` [PATCH 3/3] drivers: clk: st: Correct the pll-type for A9 for stih418 Gabriel Fernandez
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=20150715234823.GT30412@codeaurora.org \
--to=sboyd@codeaurora.org \
--cc=devicetree@vger.kernel.org \
--cc=fabf@skynet.be \
--cc=gabriel.fernandez@linaro.org \
--cc=galak@codeaurora.org \
--cc=geert+renesas@glider.be \
--cc=ijc+devicetree@hellion.org.uk \
--cc=kernel@stlinux.com \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-clk@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux@arm.linux.org.uk \
--cc=mark.rutland@arm.com \
--cc=maxime.coquelin@st.com \
--cc=mturquette@baylibre.com \
--cc=olivier.bideau@st.com \
--cc=pankaj.dev@st.com \
--cc=patrice.chotard@st.com \
--cc=pawel.moll@arm.com \
--cc=peter.griffin@linaro.org \
--cc=robh+dt@kernel.org \
--cc=srinivas.kandagatla@gmail.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