From: Michael Turquette <mturquette@linaro.org>
To: Jim Quinlan <jim2101024@gmail.com>, linux-clk@vger.kernel.org
Cc: bcm-kernel-feedback-list@broadcom.com,
"Jim Quinlan" <jim2101024@gmail.com>,
Grygorii Strashko <grygorii.strashko@ti.com>
Subject: Re: [PATCH] clk: export function clk_disable_unused()
Date: Sat, 23 May 2015 12:33:21 -0700 [thread overview]
Message-ID: <20150523193321.9817.1715@quantum> (raw)
In-Reply-To: <1431728556-620-1-git-send-email-jim2101024@gmail.com>
Quoting Jim Quinlan (2015-05-15 15:22:36)
> For Broadcom STB chips, clocks may come up after resume in an "on"
> state, so calling clk_disable_unused() again will turn off unused
> clocks. This commit exports clk_disable_unused() so it may be
> called in such cases.
Jim,
Thanks for the patch.
I think a more general solution to the problem might be needed. E.g. how
do we solve for the opposite case where after a low-power suspend/resume
we turn on clocks that were enabled by drivers before suspending, but
are disabled out of reset/post-transition?
Additionally, it would be helpful to see your driver changes and how
exactly you plan to use this newly exported function.
I've Cc'd Grygorii Strashko from TI. I faintly recall that he had an
out-of-tree solution to add some .suspend/.resume callbacks to struct
clk_ops. I didn't like that solution at the time either, but maybe we
can figure out a more natural way to handle these cases.
(Grygorii: sorry in advance if this is a case of mistaken identity. I
could not find the code in question from my email archive)
Regards,
Mike
> =
> Signed-off-by: Jim Quinlan <jim2101024@gmail.com>
> ---
> drivers/clk/clk.c | 2 +-
> include/linux/clk.h | 8 ++++++++
> 2 files changed, 9 insertions(+), 1 deletion(-)
> =
> diff --git a/drivers/clk/clk.c b/drivers/clk/clk.c
> index 459ce9d..4469f8b 100644
> --- a/drivers/clk/clk.c
> +++ b/drivers/clk/clk.c
> @@ -549,7 +549,7 @@ static int __init clk_ignore_unused_setup(char *__unu=
sed)
> }
> __setup("clk_ignore_unused", clk_ignore_unused_setup);
> =
> -static int clk_disable_unused(void)
> +int clk_disable_unused(void)
> {
> struct clk_core *clk;
> =
> diff --git a/include/linux/clk.h b/include/linux/clk.h
> index 68c16a6..c03822c 100644
> --- a/include/linux/clk.h
> +++ b/include/linux/clk.h
> @@ -265,6 +265,14 @@ int clk_enable(struct clk *clk);
> void clk_disable(struct clk *clk);
> =
> /**
> + * clk_disable_unused - turns off unused clocks.
> + *
> + * This is already called as a late initcall, but may be
> + * called again in special cases such as resuming from S3.
> + */
> +int clk_disable_unused(void);
> +
> +/**
> * clk_get_rate - obtain the current clock rate (in Hz) for a clock sour=
ce.
> * This is only valid once the clock source has been enabl=
ed.
> * @clk: clock source
> -- =
> 1.9.0.138.g2de3478
>=20
next prev parent reply other threads:[~2015-05-23 19:33 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-05-15 22:22 [PATCH] clk: export function clk_disable_unused() Jim Quinlan
2015-05-23 19:33 ` Michael Turquette [this message]
2015-05-26 12:20 ` Grygorii.Strashko@linaro.org
2015-05-28 14:21 ` Jim Quinlan
2015-05-28 15:16 ` Grygorii.Strashko@linaro.org
2015-07-23 18:32 ` Michael Turquette
2015-08-03 21:40 ` Jim Quinlan
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=20150523193321.9817.1715@quantum \
--to=mturquette@linaro.org \
--cc=bcm-kernel-feedback-list@broadcom.com \
--cc=grygorii.strashko@ti.com \
--cc=jim2101024@gmail.com \
--cc=linux-clk@vger.kernel.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox