From: Stephen Boyd <sboyd-sgV2jX0FEOL9JmXXK+q4OQ@public.gmane.org>
To: Abhishek Sahu <absahu-sgV2jX0FEOL9JmXXK+q4OQ@public.gmane.org>
Cc: andy.gross-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org,
david.brown-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org,
robh+dt-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org,
pawel.moll-5wv7dgnIgG8@public.gmane.org,
mark.rutland-5wv7dgnIgG8@public.gmane.org,
ijc+devicetree-KcIKpvwj1kUDXYZnReoRVg@public.gmane.org,
mturquette-rdvid1DuHRBWk0Htik3J/w@public.gmane.org,
galak-sgV2jX0FEOL9JmXXK+q4OQ@public.gmane.org,
pradeepb-sgV2jX0FEOL9JmXXK+q4OQ@public.gmane.org,
mmcclint-sgV2jX0FEOL9JmXXK+q4OQ@public.gmane.org,
varada-sgV2jX0FEOL9JmXXK+q4OQ@public.gmane.org,
sricharan-sgV2jX0FEOL9JmXXK+q4OQ@public.gmane.org,
architt-sgV2jX0FEOL9JmXXK+q4OQ@public.gmane.org,
ntelkar-sgV2jX0FEOL9JmXXK+q4OQ@public.gmane.org,
linux-arm-msm-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
linux-soc-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
linux-clk-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
devicetree-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
Subject: Re: [PATCH v2 5/5] clk: qcom: ipq4019: Added the cpu clock frequency change notifier
Date: Mon, 15 Aug 2016 15:26:14 -0700 [thread overview]
Message-ID: <20160815222614.GL361@codeaurora.org> (raw)
In-Reply-To: <1466516962-18087-6-git-send-email-absahu-sgV2jX0FEOL9JmXXK+q4OQ@public.gmane.org>
On 06/21, Abhishek Sahu wrote:
> The current driver code gives the crash or gets hang while switching
> the CPU frequency some time. The APSS CPU Clock divider is not glitch
> free so it the APPS clock need to be switched for stable clock during
> the change.
>
> This patch adds the frequency change notifier for APSS CPU clock. It
> changes the parent of this clock to stable PLL FEPLL500 when it gets
> for PRE_RATE_CHANGE event. This event will be generated before actual
> clock set operations. The clock set operation will again change its
> corresponding parent by getting the same from frequency table.
>
> Signed-off-by: Abhishek Sahu <absahu-sgV2jX0FEOL9JmXXK+q4OQ@public.gmane.org>
> ---
> drivers/clk/qcom/gcc-ipq4019.c | 27 ++++++++++++++++++++++++++-
> 1 file changed, 26 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/clk/qcom/gcc-ipq4019.c b/drivers/clk/qcom/gcc-ipq4019.c
> index df159c2..3c014f7 100644
> --- a/drivers/clk/qcom/gcc-ipq4019.c
> +++ b/drivers/clk/qcom/gcc-ipq4019.c
> @@ -1740,9 +1740,34 @@ static const struct of_device_id gcc_ipq4019_match_table[] = {
> };
> MODULE_DEVICE_TABLE(of, gcc_ipq4019_match_table);
>
> +int cpu_clk_notifier_fn(struct notifier_block *nb,
static?
Please come up with a better name that is not so generic.
> + unsigned long action, void *data)
> +{
> + int err = 0;
> +
> + if (action == PRE_RATE_CHANGE) {
> + err = clk_rcg2_ops.set_parent(&apps_clk_src.clkr.hw,
> + P_FEPLL500);
> + }
> +
> + return notifier_from_errno(err);
> +}
> +
> +struct notifier_block cpu_clk_notifier = {
static?
> + .notifier_call = cpu_clk_notifier_fn,
> +};
> +
> static int gcc_ipq4019_probe(struct platform_device *pdev)
> {
> - return qcom_cc_probe(pdev, &gcc_ipq4019_desc);
> + int err;
> +
> + err = qcom_cc_probe(pdev, &gcc_ipq4019_desc);
> +
> + if (!err)
> + clk_notifier_register(apps_clk_src.clkr.hw.clk,
> + &cpu_clk_notifier);
This has to be unregistered on driver remove.
> +
> + return err;
> }
--
Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum,
a Linux Foundation Collaborative Project
--
To unsubscribe from this list: send the line "unsubscribe devicetree" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
WARNING: multiple messages have this Message-ID (diff)
From: Stephen Boyd <sboyd@codeaurora.org>
To: Abhishek Sahu <absahu@codeaurora.org>
Cc: andy.gross@linaro.org, david.brown@linaro.org,
robh+dt@kernel.org, pawel.moll@arm.com, mark.rutland@arm.com,
ijc+devicetree@hellion.org.uk, mturquette@baylibre.com,
galak@codeaurora.org, pradeepb@codeaurora.org,
mmcclint@codeaurora.org, varada@codeaurora.org,
sricharan@codeaurora.org, architt@codeaurora.org,
ntelkar@codeaurora.org, linux-arm-msm@vger.kernel.org,
linux-soc@vger.kernel.org, linux-clk@vger.kernel.org,
linux-kernel@vger.kernel.org, devicetree@vger.kernel.org
Subject: Re: [PATCH v2 5/5] clk: qcom: ipq4019: Added the cpu clock frequency change notifier
Date: Mon, 15 Aug 2016 15:26:14 -0700 [thread overview]
Message-ID: <20160815222614.GL361@codeaurora.org> (raw)
In-Reply-To: <1466516962-18087-6-git-send-email-absahu@codeaurora.org>
On 06/21, Abhishek Sahu wrote:
> The current driver code gives the crash or gets hang while switching
> the CPU frequency some time. The APSS CPU Clock divider is not glitch
> free so it the APPS clock need to be switched for stable clock during
> the change.
>
> This patch adds the frequency change notifier for APSS CPU clock. It
> changes the parent of this clock to stable PLL FEPLL500 when it gets
> for PRE_RATE_CHANGE event. This event will be generated before actual
> clock set operations. The clock set operation will again change its
> corresponding parent by getting the same from frequency table.
>
> Signed-off-by: Abhishek Sahu <absahu@codeaurora.org>
> ---
> drivers/clk/qcom/gcc-ipq4019.c | 27 ++++++++++++++++++++++++++-
> 1 file changed, 26 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/clk/qcom/gcc-ipq4019.c b/drivers/clk/qcom/gcc-ipq4019.c
> index df159c2..3c014f7 100644
> --- a/drivers/clk/qcom/gcc-ipq4019.c
> +++ b/drivers/clk/qcom/gcc-ipq4019.c
> @@ -1740,9 +1740,34 @@ static const struct of_device_id gcc_ipq4019_match_table[] = {
> };
> MODULE_DEVICE_TABLE(of, gcc_ipq4019_match_table);
>
> +int cpu_clk_notifier_fn(struct notifier_block *nb,
static?
Please come up with a better name that is not so generic.
> + unsigned long action, void *data)
> +{
> + int err = 0;
> +
> + if (action == PRE_RATE_CHANGE) {
> + err = clk_rcg2_ops.set_parent(&apps_clk_src.clkr.hw,
> + P_FEPLL500);
> + }
> +
> + return notifier_from_errno(err);
> +}
> +
> +struct notifier_block cpu_clk_notifier = {
static?
> + .notifier_call = cpu_clk_notifier_fn,
> +};
> +
> static int gcc_ipq4019_probe(struct platform_device *pdev)
> {
> - return qcom_cc_probe(pdev, &gcc_ipq4019_desc);
> + int err;
> +
> + err = qcom_cc_probe(pdev, &gcc_ipq4019_desc);
> +
> + if (!err)
> + clk_notifier_register(apps_clk_src.clkr.hw.clk,
> + &cpu_clk_notifier);
This has to be unregistered on driver remove.
> +
> + return err;
> }
--
Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum,
a Linux Foundation Collaborative Project
next prev parent reply other threads:[~2016-08-15 22:26 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-06-21 13:49 [PATCH v2 0/5] Patches for QCOM IPQ4019 clock driver Abhishek Sahu
[not found] ` <1466516962-18087-1-git-send-email-absahu-sgV2jX0FEOL9JmXXK+q4OQ@public.gmane.org>
2016-06-21 13:49 ` [PATCH v2 1/5] clk: qcom: ipq4019: Added the clock nodes and operations for pll Abhishek Sahu
2016-06-21 13:49 ` Abhishek Sahu
2016-08-15 22:19 ` Stephen Boyd
2016-06-21 13:49 ` [PATCH v2 2/5] clk: qcom: ipq4019: Added the apss cpu pll divider clock node Abhishek Sahu
[not found] ` <1466516962-18087-3-git-send-email-absahu-sgV2jX0FEOL9JmXXK+q4OQ@public.gmane.org>
2016-08-15 22:31 ` Stephen Boyd
2016-08-15 22:31 ` Stephen Boyd
2016-06-21 13:49 ` [PATCH v2 3/5] clk: qcom: ipq4019: Added the nodes for pcnoc Abhishek Sahu
2016-08-15 22:27 ` Stephen Boyd
2016-06-21 13:49 ` [PATCH v2 4/5] clk: qcom: ipq4019: Added the all frequencies for apps cpu Abhishek Sahu
2016-08-15 22:24 ` Stephen Boyd
2016-06-21 13:49 ` [PATCH v2 5/5] clk: qcom: ipq4019: Added the cpu clock frequency change notifier Abhishek Sahu
[not found] ` <1466516962-18087-6-git-send-email-absahu-sgV2jX0FEOL9JmXXK+q4OQ@public.gmane.org>
2016-08-15 22:26 ` Stephen Boyd [this message]
2016-08-15 22:26 ` Stephen Boyd
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=20160815222614.GL361@codeaurora.org \
--to=sboyd-sgv2jx0feol9jmxxk+q4oq@public.gmane.org \
--cc=absahu-sgV2jX0FEOL9JmXXK+q4OQ@public.gmane.org \
--cc=andy.gross-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org \
--cc=architt-sgV2jX0FEOL9JmXXK+q4OQ@public.gmane.org \
--cc=david.brown-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org \
--cc=devicetree-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
--cc=galak-sgV2jX0FEOL9JmXXK+q4OQ@public.gmane.org \
--cc=ijc+devicetree-KcIKpvwj1kUDXYZnReoRVg@public.gmane.org \
--cc=linux-arm-msm-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
--cc=linux-clk-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
--cc=linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
--cc=linux-soc-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
--cc=mark.rutland-5wv7dgnIgG8@public.gmane.org \
--cc=mmcclint-sgV2jX0FEOL9JmXXK+q4OQ@public.gmane.org \
--cc=mturquette-rdvid1DuHRBWk0Htik3J/w@public.gmane.org \
--cc=ntelkar-sgV2jX0FEOL9JmXXK+q4OQ@public.gmane.org \
--cc=pawel.moll-5wv7dgnIgG8@public.gmane.org \
--cc=pradeepb-sgV2jX0FEOL9JmXXK+q4OQ@public.gmane.org \
--cc=robh+dt-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org \
--cc=sricharan-sgV2jX0FEOL9JmXXK+q4OQ@public.gmane.org \
--cc=varada-sgV2jX0FEOL9JmXXK+q4OQ@public.gmane.org \
/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.