<feed xmlns='http://www.w3.org/2005/Atom'>
<title>BMC/Intel-BMC/linux.git/drivers/clk/clk.c, branch dev-4.4</title>
<subtitle>Intel OpenBMC Linux kernel source tree (mirror)</subtitle>
<id>https://git.radix-linux.su/BMC/Intel-BMC/linux.git/atom?h=dev-4.4</id>
<link rel='self' href='https://git.radix-linux.su/BMC/Intel-BMC/linux.git/atom?h=dev-4.4'/>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/BMC/Intel-BMC/linux.git/'/>
<updated>2015-10-26T19:36:55+00:00</updated>
<entry>
<title>clk: Add clk_hw_is_enabled() for use by clk providers</title>
<updated>2015-10-26T19:36:55+00:00</updated>
<author>
<name>Joachim Eastwood</name>
<email>manabian@gmail.com</email>
</author>
<published>2015-10-24T16:55:22+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/BMC/Intel-BMC/linux.git/commit/?id=be68bf883170b3e4123fc4ff3745e38fb45a573e'/>
<id>urn:sha1:be68bf883170b3e4123fc4ff3745e38fb45a573e</id>
<content type='text'>
Add clk_hw_is_enabled() to the provider APIs so clk providers can
use a struct clk_hw instead of a struct clk to check if a clk is
enabled or not.

Signed-off-by: Joachim Eastwood &lt;manabian@gmail.com&gt;
Signed-off-by: Stephen Boyd &lt;sboyd@codeaurora.org&gt;
</content>
</entry>
<entry>
<title>clk: add missing of_node_put</title>
<updated>2015-10-21T23:16:32+00:00</updated>
<author>
<name>Julia Lawall</name>
<email>Julia.Lawall@lip6.fr</email>
</author>
<published>2015-10-21T20:41:36+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/BMC/Intel-BMC/linux.git/commit/?id=6bc9d9d62cbc885414c7d4bb1926c43950498479'/>
<id>urn:sha1:6bc9d9d62cbc885414c7d4bb1926c43950498479</id>
<content type='text'>
for_each_matching_node_and_match performs an of_node_get on each iteration,
so a break out of the loop requires an of_node_put.

A simplified version of the semantic patch that fixes this problem is as
follows (http://coccinelle.lip6.fr):

// &lt;smpl&gt;
@@
expression e1,e2,e;
local idexpression np;
@@

 for_each_matching_node_and_match(np, e1, e2) {
   ... when != of_node_put(np)
       when != e = np
(
   return np;
|
+  of_node_put(np);
?  return ...;
)
   ...
 }
// &lt;/smpl&gt;

Besides the problem identified by the semantic patch, this patch adds an
of_node_get in front of saving np in a field of parent, to account for the
fact that this value will be put on going on to the next element in the
iteration, and then adds of_node_puts in the two loops where the parent
pointer can be freed.

Signed-off-by: Julia Lawall &lt;Julia.Lawall@lip6.fr&gt;
Signed-off-by: Stephen Boyd &lt;sboyd@codeaurora.org&gt;
</content>
</entry>
<entry>
<title>clk: Make clk input parameter of __clk_get_name() const</title>
<updated>2015-10-16T18:56:19+00:00</updated>
<author>
<name>Geert Uytterhoeven</name>
<email>geert+renesas@glider.be</email>
</author>
<published>2015-10-16T12:35:21+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/BMC/Intel-BMC/linux.git/commit/?id=b76281cb97761002277730432812b1687de96062'/>
<id>urn:sha1:b76281cb97761002277730432812b1687de96062</id>
<content type='text'>
When calling __clk_get_name() on a const clock:

    warning: passing argument 1 of '__clk_get_name' discards 'const' qualifier from pointer target type
    include/linux/clk-provider.h:613:13: note: expected 'struct clk *' but argument is of type 'const struct clk *'

__clk_get_name() does not modify the passed clock, hence make it const.

Signed-off-by: Geert Uytterhoeven &lt;geert+renesas@glider.be&gt;
Signed-off-by: Stephen Boyd &lt;sboyd@codeaurora.org&gt;
</content>
</entry>
<entry>
<title>clk: Use %u to format unsigned int in of_clk_src_onecell_get()</title>
<updated>2015-10-16T18:49:01+00:00</updated>
<author>
<name>Geert Uytterhoeven</name>
<email>geert+renesas@glider.be</email>
</author>
<published>2015-10-16T15:12:32+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/BMC/Intel-BMC/linux.git/commit/?id=7e96353c3faaedea91f67972d011db41ed21b367'/>
<id>urn:sha1:7e96353c3faaedea91f67972d011db41ed21b367</id>
<content type='text'>
Signed-off-by: Geert Uytterhoeven &lt;geert+renesas@glider.be&gt;
Signed-off-by: Stephen Boyd &lt;sboyd@codeaurora.org&gt;
</content>
</entry>
<entry>
<title>clk: Make of_clk_get_parent_name() robust with #clock-cells = 1</title>
<updated>2015-10-15T23:17:03+00:00</updated>
<author>
<name>Stephen Boyd</name>
<email>sboyd@codeaurora.org</email>
</author>
<published>2015-10-14T21:03:07+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/BMC/Intel-BMC/linux.git/commit/?id=0a4807c2f9a4a1afc2163089176abdc7ee4a361a'/>
<id>urn:sha1:0a4807c2f9a4a1afc2163089176abdc7ee4a361a</id>
<content type='text'>
If a clock provider has #clock-cells = 1 and we call
of_clk_get_parent_name() on it we may end up returning the name
of the provider node if the provider doesn't have a
clock-output-names property. This doesn't make sense, especially
when you consider that calling of_clk_get_parent_name() on such a
node with different indices will return the same name each time.

Let's try getting the clock from the framework via of_clk_get()
instead, and only fallback to the node name if we have a provider
with #clock-cells = 0. This way, we can't hand out the same name
for different clocks when we don't actually know their names.

Cc: Thomas Petazzoni &lt;thomas.petazzoni@free-electrons.com&gt;
Signed-off-by: Stephen Boyd &lt;sboyd@codeaurora.org&gt;
</content>
</entry>
<entry>
<title>Merge branch 'clk-fixes' into clk-next</title>
<updated>2015-09-17T19:28:41+00:00</updated>
<author>
<name>Stephen Boyd</name>
<email>sboyd@codeaurora.org</email>
</author>
<published>2015-09-17T19:28:41+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/BMC/Intel-BMC/linux.git/commit/?id=ab5c342992cac7d1ddaf8a75a4dcab0d13718022'/>
<id>urn:sha1:ab5c342992cac7d1ddaf8a75a4dcab0d13718022</id>
<content type='text'>
* clk-fixes:
  drivers: clk: st: Rename st_pll3200c32_407_c0_x into st_pll3200c32_cx_x
  clk: check for invalid parent index of orphans in __clk_init()
</content>
</entry>
<entry>
<title>clk: Remove unneeded semicolons</title>
<updated>2015-09-17T18:15:14+00:00</updated>
<author>
<name>Javier Martinez Canillas</name>
<email>javier@osg.samsung.com</email>
</author>
<published>2015-09-17T13:49:29+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/BMC/Intel-BMC/linux.git/commit/?id=90c53547fcae9daf46265fd9e74adc4f936cd919'/>
<id>urn:sha1:90c53547fcae9daf46265fd9e74adc4f936cd919</id>
<content type='text'>
There are cleary typo errors so can be removed.

Signed-off-by: Javier Martinez Canillas &lt;javier@osg.samsung.com&gt;
Acked-by: Leo Yan &lt;leo.yan@linaro.org&gt;
Signed-off-by: Stephen Boyd &lt;sboyd@codeaurora.org&gt;
</content>
</entry>
<entry>
<title>clk: check for invalid parent index of orphans in __clk_init()</title>
<updated>2015-09-16T22:35:18+00:00</updated>
<author>
<name>Mans Rullgard</name>
<email>mans@mansr.com</email>
</author>
<published>2015-02-15T12:33:49+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/BMC/Intel-BMC/linux.git/commit/?id=9054a31d603ea82c6ed4914170a8708812a16324'/>
<id>urn:sha1:9054a31d603ea82c6ed4914170a8708812a16324</id>
<content type='text'>
If a mux clock is initialised (by hardware or firmware) with an
invalid parent, its -&gt;get_parent() can return an out of range
index.  For example, the generic mux clock attempts to return
-EINVAL, which due to the u8 return type ends up a rather large
number.  Using this index with the parent_names[] array results
in an invalid pointer and (usually) a crash in the following
strcmp().

This patch adds a check for the parent index being in range,
ignoring clocks reporting invalid values.

Signed-off-by: Mans Rullgard &lt;mans@mansr.com&gt;
Tested-by: Rhyland Klein &lt;rklein@nvidia.com&gt;
Signed-off-by: Stephen Boyd &lt;sboyd@codeaurora.org&gt;
</content>
</entry>
<entry>
<title>clk: remove duplicated code with __clk_set_parent_after</title>
<updated>2015-08-24T23:49:13+00:00</updated>
<author>
<name>Dong Aisheng</name>
<email>aisheng.dong@freescale.com</email>
</author>
<published>2015-07-28T13:19:41+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/BMC/Intel-BMC/linux.git/commit/?id=c660b2ebb25be5668a4ed333539f34b05841e17a'/>
<id>urn:sha1:c660b2ebb25be5668a4ed333539f34b05841e17a</id>
<content type='text'>
__clk_set_parent_after() actually used the second argument then we
could put this duplicate logic in there and call it with a different
order of arguments in the success vs. error paths in this function.

Cc: Mike Turquette &lt;mturquette@linaro.org&gt;
Suggested-by: Stephen Boyd &lt;sboyd@codeaurora.org&gt;
Signed-off-by: Dong Aisheng &lt;aisheng.dong@freescale.com&gt;
Signed-off-by: Stephen Boyd &lt;sboyd@codeaurora.org&gt;
</content>
</entry>
<entry>
<title>clk: Constify clk_hw argument to provider APIs</title>
<updated>2015-08-24T23:49:11+00:00</updated>
<author>
<name>Stephen Boyd</name>
<email>sboyd@codeaurora.org</email>
</author>
<published>2015-08-12T20:04:56+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/BMC/Intel-BMC/linux.git/commit/?id=e7df6f6e21883d7e8b3ad4641c911da8314ef283'/>
<id>urn:sha1:e7df6f6e21883d7e8b3ad4641c911da8314ef283</id>
<content type='text'>
We don't modify the clk_hw argument in these functions, so it's
safe to mark it as const.

Signed-off-by: Stephen Boyd &lt;sboyd@codeaurora.org&gt;
</content>
</entry>
</feed>
