<feed xmlns='http://www.w3.org/2005/Atom'>
<title>pm24.git/drivers/clk/clk.c, branch v4.9</title>
<subtitle>Unnamed repository; edit this file 'description' to name the repository.</subtitle>
<id>https://git.kobert.dev/pm24.git/atom/drivers/clk/clk.c?h=v4.9</id>
<link rel='self' href='https://git.kobert.dev/pm24.git/atom/drivers/clk/clk.c?h=v4.9'/>
<link rel='alternate' type='text/html' href='https://git.kobert.dev/pm24.git/'/>
<updated>2016-08-30T21:52:26Z</updated>
<entry>
<title>clk: core: Force setting the phase delay when no change</title>
<updated>2016-08-30T21:52:26Z</updated>
<author>
<name>Jean-Francois Moine</name>
<email>moinejf@free.fr</email>
</author>
<published>2016-08-24T06:32:51Z</published>
<link rel='alternate' type='text/html' href='https://git.kobert.dev/pm24.git/commit/?id=3174b0c9a62bb3738b4a2a506b8a075d4430e353'/>
<id>urn:sha1:3174b0c9a62bb3738b4a2a506b8a075d4430e353</id>
<content type='text'>
This patch reverts commit 023bd7166be0 ("clk: skip unnecessary
set_phase if nothing to do"), fixing two problems:

* in some SoCs, the hardware phase delay depends on the rate ratio of
  the clock and its parent. So, changing this ratio may imply to set
  new hardware values, even if the logical delay is the same.

* when the delay was the same as previously, an error was returned.

Signed-off-by: Jean-Francois Moine &lt;moinejf@free.fr&gt;
Fixes: 023bd7166be0 ("clk: skip unnecessary set_phase if nothing to do")
Signed-off-by: Stephen Boyd &lt;sboyd@codeaurora.org&gt;
</content>
</entry>
<entry>
<title>clk: Simplify __of_clk_get_hw_from_provider()</title>
<updated>2016-08-26T19:28:27Z</updated>
<author>
<name>Stephen Boyd</name>
<email>sboyd@codeaurora.org</email>
</author>
<published>2016-08-25T20:35:36Z</published>
<link rel='alternate' type='text/html' href='https://git.kobert.dev/pm24.git/commit/?id=74002fcde01d8acb4ce68878e9998fad51fe7925'/>
<id>urn:sha1:74002fcde01d8acb4ce68878e9998fad51fe7925</id>
<content type='text'>
__of_clk_get_hw_from_provider() is confusing because it will
return EPROBE_DEFER if there isn't a -&gt;get() or -&gt;get_hw()
function pointer in a provider. That's just a bug though, and we
used to NULL pointer exception when -&gt;get() was missing anyway,
so let's make this more obvious that they're not optional. The
assumption is that most providers will implement -&gt;get_hw() so we
only fallback to the -&gt;get() function if necessary. This
clarifies the intent and removes any possibility of probe defer
happening if clk providers are buggy.

Reported-by: Masahiro Yamada &lt;yamada.masahiro@socionext.com&gt;
Reviewed-by: Sylwester Nawrocki &lt;s.nawrocki@samsung.com&gt;
Signed-off-by: Stephen Boyd &lt;sboyd@codeaurora.org&gt;
</content>
</entry>
<entry>
<title>clk: Return errors from clk providers in __of_clk_get_from_provider()</title>
<updated>2016-08-15T21:32:23Z</updated>
<author>
<name>Stephen Boyd</name>
<email>sboyd@codeaurora.org</email>
</author>
<published>2016-08-15T21:32:23Z</published>
<link rel='alternate' type='text/html' href='https://git.kobert.dev/pm24.git/commit/?id=f155d15b64e36b45ca89e3521fe0c1ccad5e5ff0'/>
<id>urn:sha1:f155d15b64e36b45ca89e3521fe0c1ccad5e5ff0</id>
<content type='text'>
Before commit 0861e5b8cf80 (clk: Add clk_hw OF clk providers,
2016-02-05) __of_clk_get_from_provider() would return an error
pointer of the provider's choosing if there was a provider
registered and EPROBE_DEFER otherwise. After that commit, it
would return EPROBE_DEFER regardless of whether or not the
provider returned an error. This is odd and can lead to behavior
where clk consumers keep probe deferring when they should be
seeing some other error.

Let's restore the previous behavior where we only return
EPROBE_DEFER when there isn't a provider in our of_clk_providers
list. Otherwise, return the error from the last provider we find
that matches the node.

Reported-by: Masahiro Yamada &lt;yamada.masahiro@socionext.com&gt;
Fixes: 0861e5b8cf80 ("clk: Add clk_hw OF clk providers")
Signed-off-by: Stephen Boyd &lt;sboyd@codeaurora.org&gt;
</content>
</entry>
<entry>
<title>clk: use ERR_CAST() for __clk_create_clk()</title>
<updated>2016-08-13T01:17:04Z</updated>
<author>
<name>Masahiro Yamada</name>
<email>yamada.masahiro@socionext.com</email>
</author>
<published>2016-07-19T07:28:47Z</published>
<link rel='alternate' type='text/html' href='https://git.kobert.dev/pm24.git/commit/?id=8a23133c7a2afc49d97b5b27caefe6847d32599e'/>
<id>urn:sha1:8a23133c7a2afc49d97b5b27caefe6847d32599e</id>
<content type='text'>
This code is clear enough, but the intention will be even clearer
with this.

Signed-off-by: Masahiro Yamada &lt;yamada.masahiro@socionext.com&gt;
Signed-off-by: Stephen Boyd &lt;sboyd@codeaurora.org&gt;
</content>
</entry>
<entry>
<title>clk: core: Avoid double initialization of clocks</title>
<updated>2016-08-13T01:01:58Z</updated>
<author>
<name>Ricardo Ribalda Delgado</name>
<email>ricardo.ribalda@gmail.com</email>
</author>
<published>2016-07-05T16:23:32Z</published>
<link rel='alternate' type='text/html' href='https://git.kobert.dev/pm24.git/commit/?id=989eafd0b6091c15a0929ea5f520ff926ccaaa25'/>
<id>urn:sha1:989eafd0b6091c15a0929ea5f520ff926ccaaa25</id>
<content type='text'>
Some clock providers can be initialized via of_clk_init() and also via
platform device probe.

Avoid double initialization of them by setting the OF_POPULATED flag.

Signed-off-by: Ricardo Ribalda Delgado &lt;ricardo.ribalda@gmail.com&gt;
Signed-off-by: Stephen Boyd &lt;sboyd@codeaurora.org&gt;
</content>
</entry>
<entry>
<title>clk: migrate ref counts when orphans are reunited</title>
<updated>2016-08-12T01:06:50Z</updated>
<author>
<name>Michael Turquette</name>
<email>mturquette@baylibre.com</email>
</author>
<published>2016-07-08T23:32:10Z</published>
<link rel='alternate' type='text/html' href='https://git.kobert.dev/pm24.git/commit/?id=904e6ead02dcb409cb6eb5ec1c31dc2c7c28b5df'/>
<id>urn:sha1:904e6ead02dcb409cb6eb5ec1c31dc2c7c28b5df</id>
<content type='text'>
It's always nice to see families reunited, and this is equally true when
talking about parent clocks and their children. However, if the orphan
clk had a positive prepare_count or enable_count, then we would not
migrate those counts up the parent chain correctly.

This has manifested with the recent critical clocks feature, which often
enables clocks very early, before their parents have been registered.

Fixed by replacing the call to clk_core_reparent with calls to
__clk_set_parent_{before,after}.

Cc: James Liao &lt;jamesjj.liao@mediatek.com&gt;
Cc: Erin Lo &lt;erin.lo@mediatek.com&gt;
Signed-off-by: Michael Turquette &lt;mturquette@baylibre.com&gt;
[sboyd@codeaurora.org: Recalc accuracies and rates too]
Signed-off-by: Stephen Boyd &lt;sboyd@codeaurora.org&gt;
</content>
</entry>
<entry>
<title>clk: core: support clocks which requires parents enable (part 2)</title>
<updated>2016-07-02T00:42:56Z</updated>
<author>
<name>Dong Aisheng</name>
<email>aisheng.dong@nxp.com</email>
</author>
<published>2016-06-30T09:31:14Z</published>
<link rel='alternate' type='text/html' href='https://git.kobert.dev/pm24.git/commit/?id=fc8726a2c021b5525151ff6482f8f9a863c56d8d'/>
<id>urn:sha1:fc8726a2c021b5525151ff6482f8f9a863c56d8d</id>
<content type='text'>
On Freescale i.MX7D platform, all clocks operations, including
enable/disable, rate change and re-parent, requires its parent clock on.
Current clock core can not support it well.
This patch adding flag CLK_OPS_PARENT_ENABLE to handle this special case in
clock core that enable its parent clock firstly for each operation and
disable it later after operation complete.

The patch part 2 fixes set clock rate and set parent while its parent
is off. The most special case is for set_parent() operation which requires
all parents including both old and new one to be enabled at the same time
during the operation.

Cc: Michael Turquette &lt;mturquette@baylibre.com&gt;
Cc: Stephen Boyd &lt;sboyd@codeaurora.org&gt;
Cc: Shawn Guo &lt;shawnguo@kernel.org&gt;
Signed-off-by: Dong Aisheng &lt;aisheng.dong@nxp.com&gt;
[sboyd@codeaurora.org: Move set_rate tracepoint after prepare_enable]
Signed-off-by: Stephen Boyd &lt;sboyd@codeaurora.org&gt;
</content>
</entry>
<entry>
<title>clk: core: support clocks which requires parents enable (part 1)</title>
<updated>2016-07-02T00:40:23Z</updated>
<author>
<name>Dong Aisheng</name>
<email>aisheng.dong@nxp.com</email>
</author>
<published>2016-06-30T09:31:13Z</published>
<link rel='alternate' type='text/html' href='https://git.kobert.dev/pm24.git/commit/?id=a4b3518d146f150d633f7dc815bb8ee2fbc162e9'/>
<id>urn:sha1:a4b3518d146f150d633f7dc815bb8ee2fbc162e9</id>
<content type='text'>
On Freescale i.MX7D platform, all clocks operations, including
enable/disable, rate change and re-parent, requires its parent
clock enable. Current clock core can not support it well.
This patch introduce a new flag CLK_OPS_PARENT_ENABLE to handle this
special case in clock core that enable its parent clock firstly for
each operation and disable it later after operation complete.

The patch part 1 fixes the possible disabling clocks while its parent
is off during kernel booting phase in clk_disable_unused_subtree().

Before the completion of kernel booting, clock tree is still not built
completely, there may be a case that the child clock is on but its
parent is off which could be caused by either HW initial reset state
or bootloader initialization.

Taking bootloader as an example, we may enable all clocks in HW by default.
And during kernel booting time, the parent clock could be disabled in its
driver probe due to calling clk_prepare_enable and clk_disable_unprepare.
Because it's child clock is only enabled in HW while its SW usecount
in clock tree is still 0, so clk_disable of parent clock will gate
the parent clock in both HW and SW usecount ultimately. Then there will
be a child clock is still on in HW but its parent is already off.

Later in clk_disable_unused(), this clock disable accessing while its
parent off will cause system hang due to the limitation of HW which
must require its parent on.

This patch simply enables the parent clock first before disabling
if flag CLK_OPS_PARENT_ENABLE is set in clk_disable_unused_subtree().
This is a simple solution and only affects booting time.

After kernel booting up the clock tree is already created, there will
be no case that child is off but its parent is off.
So no need do this checking for normal clk_disable() later.

Cc: Michael Turquette &lt;mturquette@baylibre.com&gt;
Cc: Stephen Boyd &lt;sboyd@codeaurora.org&gt;
Cc: Shawn Guo &lt;shawnguo@kernel.org&gt;
Signed-off-by: Dong Aisheng &lt;aisheng.dong@nxp.com&gt;
Signed-off-by: Stephen Boyd &lt;sboyd@codeaurora.org&gt;
</content>
</entry>
<entry>
<title>clk: move clk_disable_unused after clk_core_disable_unprepare function</title>
<updated>2016-07-02T00:40:20Z</updated>
<author>
<name>Dong Aisheng</name>
<email>aisheng.dong@nxp.com</email>
</author>
<published>2016-06-30T09:31:12Z</published>
<link rel='alternate' type='text/html' href='https://git.kobert.dev/pm24.git/commit/?id=7ec986efed0208ca5fdfc26f9fc19c1604d3d502'/>
<id>urn:sha1:7ec986efed0208ca5fdfc26f9fc19c1604d3d502</id>
<content type='text'>
No function level change, just moving code place.
clk_disable_unused function will need to call clk_core_prepare_enable/
clk_core_disable_unprepare when adding CLK_OPS_PARENT_ENABLE features.
So move it after clk_core_disable_unprepare to avoid adding forward
declared functions later.

Cc: Michael Turquette &lt;mturquette@baylibre.com&gt;
Cc: Stephen Boyd &lt;sboyd@codeaurora.org&gt;
Cc: Shawn Guo &lt;shawnguo@kernel.org&gt;
Signed-off-by: Dong Aisheng &lt;aisheng.dong@nxp.com&gt;
Signed-off-by: Stephen Boyd &lt;sboyd@codeaurora.org&gt;
</content>
</entry>
<entry>
<title>clk: introduce clk_core_enable_lock and clk_core_disable_lock functions</title>
<updated>2016-07-02T00:40:18Z</updated>
<author>
<name>Dong Aisheng</name>
<email>aisheng.dong@nxp.com</email>
</author>
<published>2016-06-30T09:31:11Z</published>
<link rel='alternate' type='text/html' href='https://git.kobert.dev/pm24.git/commit/?id=a6adc30ba7bef8da62a32c884609eb9cace04fbc'/>
<id>urn:sha1:a6adc30ba7bef8da62a32c884609eb9cace04fbc</id>
<content type='text'>
This can be useful when clock core wants to enable/disable clocks.
Then we don't have to convert the struct clk_core to struct clk to call
clk_enable/clk_disable which is a bit un-align with exist using.

And after introduce clk_core_{enable|disable}_lock, we can refine
clk_enable and clk_disable a bit.

As well as clk_core_{enable|disable}_lock, we also added
clk_core_{prepare|unprepare}_lock and clk_core_prepare_enable/
clk_core_unprepare_disable for clock core to easily use.

Cc: Michael Turquette &lt;mturquette@baylibre.com&gt;
Cc: Stephen Boyd &lt;sboyd@codeaurora.org&gt;
Cc: Shawn Guo &lt;shawnguo@kernel.org&gt;
Signed-off-by: Dong Aisheng &lt;aisheng.dong@nxp.com&gt;
Signed-off-by: Stephen Boyd &lt;sboyd@codeaurora.org&gt;
</content>
</entry>
</feed>
