From: Geert Uytterhoeven <geert@linux-m68k.org>
To: Michael Turquette <mturquette@linaro.org>,
Michael Turquette <mturquette@baylibre.com>
Cc: Geert Uytterhoeven <geert+renesas@glider.be>,
Laurent Pinchart <Laurent.pinchart@ideasonboard.com>,
Magnus Damm <magnus.damm@gmail.com>,
Stephen Boyd <sboyd@codeaurora.org>,
Simon Horman <horms@verge.net.au>,
"Rafael J. Wysocki" <rjw@rjwysocki.net>,
Kevin Hilman <khilman@kernel.org>,
Ulf Hansson <ulf.hansson@linaro.org>,
linux-clk@vger.kernel.org,
Linux PM list <linux-pm@vger.kernel.org>,
Linux-sh list <linux-sh@vger.kernel.org>,
"linux-arm-kernel@lists.infradead.org"
<linux-arm-kernel@lists.infradead.org>,
"devicetree@vger.kernel.org" <devicetree@vger.kernel.org>,
"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH v2 00/14] ARM: shmobile: Add CPG Clock Domains
Date: Tue, 23 Jun 2015 10:59:15 +0200 [thread overview]
Message-ID: <CAMuHMdXsnKZjMe1FVr5etz6EakBxw9VONWa=UhC5uqa-TZWC_Q@mail.gmail.com> (raw)
In-Reply-To: <20150622204617.9112.71054@quantum>
Hi Mike,
On Mon, Jun 22, 2015 at 10:46 PM, Michael Turquette
<mturquette@linaro.org> wrote:
>> The MSTP block provides two functions:
>> 1. Module Standby: "Clock supply to specified modules is stopped by
>> setting the module stop control register bits."
>> However, the clock supply to a module is not stopped until all CPUs
>> in the SoC agree. Indeed, there are separate MSTP registers for
>> application (Cortex-A) and real-time (SH and/or Cortex-R) cores.
>> 2. Reset control. to perform a software reset of a specific module.
>>
>> Given the second function, perhaps the MSTP bits shouldn't have been
>> moduled as clocks, but it made sense at the time of introduction, and
>> IMHO it still does.
>
> Does the clk.enable_count refcount for an MSTP "clock" mirror your
> statement, "the clock supply to a module is not stopped until all CPUs
> in the SoC agree"? Put another way, is it possble in a shmobile system
> for an MSTP "clock" to have an enable_count of zero, but still by
> physically enabled in hardware?
Yes. The enable_count only matches the bit in the application core MSTP
control register. The real-time core MSTP control register may still have the
same module clock enabled (i.e. module not put in standby).
On some SoCs (e.g. R-Mobile APE6) there can be 3 sets of control registers
(for application, real-time, and baseband core).
Most (not all) module clocks have a status register to check if the module
clock is actually enabled or not. This shows that the module clock is stopped
iff all cores agree to stop it.
However, I found a few module clocks that never can be stopped, according to
the status register. Perhaps there's another set of control registers for an
undocumented core...
In addition, there are many undocumented bits in the MSTP control registers,
which may represent existing but undocumented clocks. Disabling such bits
may lock up the system.
As Linux doesn't touch the control registers for other CPU cores (they're
not described in DT), a module clock may be enabled (read: not stopped) in
a control registers meant for another CPU core, depending on reset state or
on the boot loader. Or by another OS running on another CPU core.
I've been running for quite some time with extra code that disables all module
clocks (for all cores) at early boot time, which let me find lots of drivers
that relied on implicit module clocks. Most got fixed, the only major
offender left is the module clock for the GIC ;-)
Gr{oetje,eeting}s,
Geert
--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org
In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
-- Linus Torvalds
prev parent reply other threads:[~2015-06-23 8:59 UTC|newest]
Thread overview: 24+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-05-28 18:53 [PATCH v2 00/14] ARM: shmobile: Add CPG Clock Domains Geert Uytterhoeven
2015-05-28 18:53 ` [PATCH v2 02/14] clk: shmobile: r8a7778: Add CPG Clock Domain support Geert Uytterhoeven
2015-05-28 18:53 ` [PATCH v2 04/14] clk: shmobile: rcar-gen2: " Geert Uytterhoeven
2015-05-28 18:53 ` [PATCH v2 05/14] clk: shmobile: rz: " Geert Uytterhoeven
2015-05-28 18:53 ` [PATCH v2 06/14] ARM: shmobile: r7s72100 dtsi: Add CPG Clock Domain Geert Uytterhoeven
2015-05-28 18:53 ` [PATCH v2 07/14] ARM: shmobile: r8a7778 " Geert Uytterhoeven
2015-05-28 18:53 ` [PATCH v2 08/14] ARM: shmobile: r8a7779 " Geert Uytterhoeven
2015-05-28 18:53 ` [PATCH v2 09/14] ARM: shmobile: r8a7790 " Geert Uytterhoeven
2015-05-28 18:53 ` [PATCH v2 10/14] ARM: shmobile: r8a7791 " Geert Uytterhoeven
2015-05-28 18:53 ` [PATCH v2 11/14] ARM: shmobile: r8a7794 " Geert Uytterhoeven
2015-05-28 18:53 ` [PATCH v2 12/14] drivers: sh: Stop using pm_runtime.c for multi-platform shmobile with genpd Geert Uytterhoeven
2015-06-15 19:44 ` Geert Uytterhoeven
2015-05-28 18:53 ` [PATCH v2 13/14] clk: shmobile: mstp: Consider "zb_clk" suitable for power management Geert Uytterhoeven
2015-06-22 20:05 ` Michael Turquette
2015-06-22 20:17 ` Geert Uytterhoeven
2015-05-28 18:53 ` [PATCH v2 14/14] ARM: shmobile: R-Mobile: Use CPG Clock Domain attach/detach helpers Geert Uytterhoeven
2015-06-08 21:42 ` [PATCH v2 00/14] ARM: shmobile: Add CPG Clock Domains Stephen Boyd
[not found] ` <1432839219-475-1-git-send-email-geert+renesas-gXvu3+zWzMSzQB+pC5nmwQ@public.gmane.org>
2015-05-28 18:53 ` [PATCH v2 01/14] clk: shmobile: Add CPG Clock Domain support Geert Uytterhoeven
2015-06-22 15:07 ` Geert Uytterhoeven
2015-05-28 18:53 ` [PATCH v2 03/14] clk: shmobile: r8a7779: " Geert Uytterhoeven
2015-06-15 16:15 ` [PATCH v2 00/14] ARM: shmobile: Add CPG Clock Domains Geert Uytterhoeven
2015-06-15 18:39 ` Kevin Hilman
2015-06-22 20:46 ` Michael Turquette
2015-06-23 8:59 ` Geert Uytterhoeven [this message]
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='CAMuHMdXsnKZjMe1FVr5etz6EakBxw9VONWa=UhC5uqa-TZWC_Q@mail.gmail.com' \
--to=geert@linux-m68k.org \
--cc=Laurent.pinchart@ideasonboard.com \
--cc=devicetree@vger.kernel.org \
--cc=geert+renesas@glider.be \
--cc=horms@verge.net.au \
--cc=khilman@kernel.org \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-clk@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-pm@vger.kernel.org \
--cc=linux-sh@vger.kernel.org \
--cc=magnus.damm@gmail.com \
--cc=mturquette@baylibre.com \
--cc=mturquette@linaro.org \
--cc=rjw@rjwysocki.net \
--cc=sboyd@codeaurora.org \
--cc=ulf.hansson@linaro.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).