From: linux@arm.linux.org.uk (Russell King - ARM Linux)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH] clk: Propagate prepare and enable when reparenting orphans
Date: Fri, 7 Nov 2014 18:58:44 +0000 [thread overview]
Message-ID: <20141107185844.GR4042@n2100.arm.linux.org.uk> (raw)
In-Reply-To: <1415386312-23741-1-git-send-email-dianders@chromium.org>
On Fri, Nov 07, 2014 at 10:51:52AM -0800, Doug Anderson wrote:
> diff --git a/drivers/clk/clk.c b/drivers/clk/clk.c
> index 4896ae9..a3d3d58 100644
> --- a/drivers/clk/clk.c
> +++ b/drivers/clk/clk.c
> @@ -1650,6 +1650,17 @@ void __clk_reparent(struct clk *clk, struct clk *new_parent)
> clk_reparent(clk, new_parent);
> __clk_recalc_accuracies(clk);
> __clk_recalc_rates(clk, POST_RATE_CHANGE);
> +
> + if (clk->prepare_count) {
> + unsigned long flags;
> +
> + __clk_prepare(new_parent);
> +
> + flags = clk_enable_lock();
> + if (clk->enable_count)
> + __clk_enable(new_parent);
> + clk_enable_unlock(flags);
> + }
I really don't understand why this isn't already done - I said this was
necessary a /long/ time ago.
However, the above isn't sufficient. Think about the old parent - this
should be disabled and unprepared if it was prepared and enabled by the
child.
--
FTTC broadband for 0.8mile line: currently at 9.5Mbps down 400kbps up
according to speedtest.net.
next prev parent reply other threads:[~2014-11-07 18:58 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-11-07 18:51 [PATCH] clk: Propagate prepare and enable when reparenting orphans Doug Anderson
2014-11-07 18:58 ` Russell King - ARM Linux [this message]
2014-11-07 22:52 ` Doug Anderson
2014-11-07 23:36 ` Russell King - ARM Linux
2014-11-08 0:14 ` Doug Anderson
2014-11-08 0:23 ` Russell King - ARM Linux
2014-11-08 0:46 ` Doug Anderson
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=20141107185844.GR4042@n2100.arm.linux.org.uk \
--to=linux@arm.linux.org.uk \
--cc=linux-arm-kernel@lists.infradead.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;
as well as URLs for NNTP newsgroup(s).