From: James Liao <jamesjj.liao@mediatek.com>
To: Daniel Kurtz <djkurtz@chromium.org>
Cc: Lucas Stach <l.stach@pengutronix.de>,
Matthias Brugger <matthias.bgg@gmail.com>,
Sascha Hauer <kernel@pengutronix.de>,
"linux-arm-kernel@lists.infradead.org"
<linux-arm-kernel@lists.infradead.org>,
"open list:OPEN FIRMWARE AND..." <devicetree@vger.kernel.org>,
srv_heupstream <srv_heupstream@mediatek.com>,
Kevin Hilman <khilman@kernel.org>,
"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
<linux-mediatek@lists.infradead.org>, <linux-clk@vger.kernel.org>,
Mike Turquette <mturquette@linaro.org>,
"Stephen Boyd" <sboyd@codeaurora.org>, <linux-pm@vger.kernel.org>,
<rjw@sisk.pl>
Subject: Re: [PATCH] soc: mediatek: Fix random hang up issue while kernel init
Date: Fri, 2 Oct 2015 11:00:38 +0800 [thread overview]
Message-ID: <1443754838.1714.94.camel@mtksdaap41> (raw)
In-Reply-To: <CAGS+omCm2pKczooGkMf75HjQL=oF7Ufo6DsRCvvikt0QA1jx-g@mail.gmail.com>
Hi Daniel,
On Thu, 2015-10-01 at 18:08 +0800, Daniel Kurtz wrote:
> I see two cases where "a power domain is a consumer of a clock":
> (a) the clock is needed to access the power domain control
> registers. The clock must actually be in another power domain, since
> otherwise you could never turn *on* the power domain in question.
> (b) the clock is needed to talk to the power domain that is about to
> turn off, or that was just turned on - these clocks are usually used
> to control some kind of bus arbitration, etc. In this case, the
> clocks are only accessed when the power domain is on.
>
> I would argue that in both cases, the clock should in theory should
> only be enabled/disabled by the power on/off routine for the duration
> of time that is needed, and that it should not be "left enabled" by
> the power domain on/off function... I can see how this might be a
> useful optimization - but it also seems like a way to burn extra power
> by leaving on a clock that is not necessarily being used.
>
> But - perhaps I am over thinking this, and it is standard practice to
> bundle power domains with the clocks that service components in the
> power domain.
Yes, you are right. Power domain on/off operations need clocks to get
status of the subsystem. Keeping clocks on during power domain on is an
optimization.
But to model a clock controller as a power domain consumer, or say we
need to control power domain before clock on/off, is not a good practice
because we always consider clock operations should be light weight.
Power domains should be controlled explicitly by subsystem drivers,
instead of hiding behind clock controls.
> Or, alternatively, just prepare venc_sel once during init, for each
> clock controller that needs it, when configuring the clock controller
> node (for example, in mtk_vencsys_init()). This is similar to how we
> set up 'critical clocks'.
> By just preparing the clock, you tell the common clock core:
> "my clock controller will need this clock later; please make sure
> that it can be enabled/disabled later during atomic context."
In current implementation, PLLs will be turned on in clk_prepare(). So
if a clock is always prepared, its parent PLL will be kept on even if
the clock is not enabled. It consumes extra power, so we don't prefer
this kind of solution.
Best regards,
James
next prev parent reply other threads:[~2015-10-02 3:00 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-09-25 6:31 [PATCH] soc: mediatek: Fix random hang up issue while kernel init James Liao
2015-09-25 8:26 ` Lucas Stach
2015-09-27 11:25 ` Matthias Brugger
2015-09-29 10:25 ` Daniel Kurtz
2015-09-30 9:07 ` Lucas Stach
2015-10-01 7:15 ` James Liao
2015-10-01 8:07 ` Daniel Kurtz
2015-10-01 9:26 ` James Liao
2015-10-01 10:08 ` Daniel Kurtz
2015-10-02 3:00 ` James Liao [this message]
2015-10-02 9:25 ` Daniel Kurtz
2015-10-02 10:37 ` James Liao
2015-10-01 6:58 ` James Liao
2015-10-06 1:57 ` Daniel Kurtz
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=1443754838.1714.94.camel@mtksdaap41 \
--to=jamesjj.liao@mediatek.com \
--cc=devicetree@vger.kernel.org \
--cc=djkurtz@chromium.org \
--cc=kernel@pengutronix.de \
--cc=khilman@kernel.org \
--cc=l.stach@pengutronix.de \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-clk@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mediatek@lists.infradead.org \
--cc=linux-pm@vger.kernel.org \
--cc=matthias.bgg@gmail.com \
--cc=mturquette@linaro.org \
--cc=rjw@sisk.pl \
--cc=sboyd@codeaurora.org \
--cc=srv_heupstream@mediatek.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