<feed xmlns='http://www.w3.org/2005/Atom'>
<title>kernel/drivers/clk/clkdev.c, branch linux-5.1.y</title>
<subtitle>Hosts the 0x221E linux distro kernel.</subtitle>
<id>https://universe.0xinfinity.dev/distro/kernel/atom?h=linux-5.1.y</id>
<link rel='self' href='https://universe.0xinfinity.dev/distro/kernel/atom?h=linux-5.1.y'/>
<link rel='alternate' type='text/html' href='https://universe.0xinfinity.dev/distro/kernel/'/>
<updated>2019-04-18T20:33:13Z</updated>
<entry>
<title>clkdev: Hold clocks_mutex while iterating clocks list</title>
<updated>2019-04-18T20:33:13Z</updated>
<author>
<name>Stephen Boyd</name>
<email>sboyd@kernel.org</email>
</author>
<published>2019-04-12T18:31:42Z</published>
<link rel='alternate' type='text/html' href='https://universe.0xinfinity.dev/distro/kernel/commit/?id=5a7efdacb9dda1c35fb414d57b3e16d520e2c0db'/>
<id>urn:sha1:5a7efdacb9dda1c35fb414d57b3e16d520e2c0db</id>
<content type='text'>
We recently introduced a change to support devm clk lookups. That change
introduced a code-path that used clk_find() without holding the
'clocks_mutex'. Unfortunately, clk_find() iterates over the 'clocks'
list and so we need to prevent the list from being modified at the same
time. Do this by holding the mutex and checking to make sure it's held
while iterating the list.

Note, we don't really care if the lookup is freed after we find it with
clk_find() because we're just doing a pointer comparison, but if we did
care we would need to keep holding the mutex while we dereference the
clk_lookup pointer.

Fixes: 3eee6c7d119c ("clkdev: add managed clkdev lookup registration")
Cc: Miquel Raynal &lt;miquel.raynal@bootlin.com&gt;
Cc: Jerome Brunet &lt;jbrunet@baylibre.com&gt;
Cc: Russell King &lt;linux@armlinux.org.uk&gt;
Cc: Michael Turquette &lt;mturquette@baylibre.com&gt;
Cc: Jeffrey Hugo &lt;jhugo@codeaurora.org&gt;
Cc: Chen-Yu Tsai &lt;wens@csie.org&gt;
Cc: Matti Vaittinen &lt;matti.vaittinen@fi.rohmeurope.com&gt;
Acked-by: Matti Vaittinen &lt;matti.vaittinen@fi.rohmeurope.com&gt;
Tested-by: Jeffrey Hugo &lt;jhugo@codeaurora.org&gt;
Signed-off-by: Stephen Boyd &lt;sboyd@kernel.org&gt;
</content>
</entry>
<entry>
<title>Merge branch 'clk-parent-rewrite' (early part) into clk-next</title>
<updated>2019-03-08T18:35:01Z</updated>
<author>
<name>Stephen Boyd</name>
<email>sboyd@kernel.org</email>
</author>
<published>2019-03-08T18:35:01Z</published>
<link rel='alternate' type='text/html' href='https://universe.0xinfinity.dev/distro/kernel/commit/?id=5dc7e84268f53f08251abe1d388a019f55ddb077'/>
<id>urn:sha1:5dc7e84268f53f08251abe1d388a019f55ddb077</id>
<content type='text'>
* 'clk-parent-rewrite' (early part):
  clk: Move of_clk_*() APIs into clk.c from clkdev.c
  clk: Inform the core about consumer devices
  clk: Introduce of_clk_get_hw_from_clkspec()
  clk: core: clarify the check for runtime PM
  clk: Combine __clk_get() and __clk_create_clk()
</content>
</entry>
<entry>
<title>Merge branches 'clk-optional', 'clk-devm-clkdev-register', 'clk-allwinner', 'clk-meson' and 'clk-renesas' into clk-next</title>
<updated>2019-03-08T18:27:21Z</updated>
<author>
<name>Stephen Boyd</name>
<email>sboyd@kernel.org</email>
</author>
<published>2019-03-08T18:27:21Z</published>
<link rel='alternate' type='text/html' href='https://universe.0xinfinity.dev/distro/kernel/commit/?id=3f8e7e7247e0627b4f1d758d793041fe3032b6e3'/>
<id>urn:sha1:3f8e7e7247e0627b4f1d758d793041fe3032b6e3</id>
<content type='text'>
 - Add a {devm_}clk_get_optional() API
 - Add devm_clk_hw_register_clkdev() API to manage clkdev lookups

* clk-optional:
  clk: Add (devm_)clk_get_optional() functions
  clk: Add comment about __of_clk_get_by_name() error values

* clk-devm-clkdev-register:
  clk: clk-st: avoid clkdev lookup leak at remove
  clk: clk-max77686: Clean clkdev lookup leak and use devm
  clkdev: add managed clkdev lookup registration

* clk-allwinner:
  clk: sunxi-ng: sun8i-a23: Enable PLL-MIPI LDOs when ungating it

* clk-meson: (22 commits)
  clk: meson: meson8b: fix the naming of the APB clocks
  dt-bindings: clock: meson8b: add APB clock definition
  clk: meson: Add G12A AO Clock + Reset Controller
  dt-bindings: clk: add G12A AO Clock and Reset Bindings
  clk: meson: factorise meson64 peripheral clock controller drivers
  clk: meson: g12a: add peripheral clock controller
  dt-bindings: clk: meson: add g12a periph clock controller bindings
  clk: meson: pll: update driver for the g12a
  clk: meson: rework and clean drivers dependencies
  clk: meson: axg-audio does not require syscon
  clk: meson: use CONFIG_ARCH_MESON to enter meson clk directory
  clk: export some clk_hw function symbols for module drivers
  clk: meson: ao-clkc: claim clock controller input clocks from DT
  clk: meson: axg: claim clock controller input clock from DT
  clk: meson: gxbb: claim clock controller input clock from DT
  clk: meson: meson8b: add the GPU clock tree
  clk: meson: meson8b: use a separate clock table for Meson8
  clk: meson: axg-ao: add 32k generation subtree
  clk: meson: gxbb-ao: replace cec-32k with the dual divider
  clk: meson: add dual divider clock driver
  ...

* clk-renesas:
  clk: renesas: r8a774a1: Fix LAST_DT_CORE_CLK
  clk: renesas: r8a774c0: Fix LAST_DT_CORE_CLK
  clk: renesas: r8a774c0: Add TMU clock
  clk: renesas: r8a77980: Add RPC clocks
  clk: renesas: rcar-gen3: Add RPC clocks
  clk: renesas: rcar-gen3: Add spinlock
  clk: renesas: rcar-gen3: Factor out cpg_reg_modify()
  clk: renesas: r8a774c0: Correct parent clock of DU
  clk: renesas: r8a774a1: Add missing CANFD clock
  clk: renesas: r8a774c0: Add missing CANFD clock
</content>
</entry>
<entry>
<title>clk: Move of_clk_*() APIs into clk.c from clkdev.c</title>
<updated>2019-03-01T19:17:22Z</updated>
<author>
<name>Stephen Boyd</name>
<email>sboyd@kernel.org</email>
</author>
<published>2018-12-19T23:09:14Z</published>
<link rel='alternate' type='text/html' href='https://universe.0xinfinity.dev/distro/kernel/commit/?id=cf13f2896807d516df79d118d1e82f9d2db3c336'/>
<id>urn:sha1:cf13f2896807d516df79d118d1e82f9d2db3c336</id>
<content type='text'>
The API between clk.c and clkdev.c is purely getting the clk_hw
structure (or the struct clk if it's not CCF) and then turning that
struct clk_hw pointer into a struct clk pointer via clk_hw_create_clk().
There's no need to complicate clkdev.c with these DT parsing details
that are only relevant to the common clk framework. Move the DT parsing
logic into the core framework and just expose the APIs to get a clk_hw
pointer and convert it.

Cc: Miquel Raynal &lt;miquel.raynal@bootlin.com&gt;
Cc: Jerome Brunet &lt;jbrunet@baylibre.com&gt;
Cc: Russell King &lt;linux@armlinux.org.uk&gt;
Cc: Michael Turquette &lt;mturquette@baylibre.com&gt;
Cc: Jeffrey Hugo &lt;jhugo@codeaurora.org&gt;
Cc: Chen-Yu Tsai &lt;wens@csie.org&gt;
Signed-off-by: Stephen Boyd &lt;sboyd@kernel.org&gt;
</content>
</entry>
<entry>
<title>clk: Inform the core about consumer devices</title>
<updated>2019-03-01T19:17:22Z</updated>
<author>
<name>Stephen Boyd</name>
<email>sboyd@kernel.org</email>
</author>
<published>2018-12-11T16:34:16Z</published>
<link rel='alternate' type='text/html' href='https://universe.0xinfinity.dev/distro/kernel/commit/?id=efa850487a6b6742699e3352d8562f5aba531ae7'/>
<id>urn:sha1:efa850487a6b6742699e3352d8562f5aba531ae7</id>
<content type='text'>
We'd like to have a pointer to the device that's consuming a particular
clk in the clk framework so we can link the consumer to the clk provider
with a PM device link. Add a device argument to clk_hw_create_clk() for
this so it can be used in subsequent patches to add and remove the link.

Cc: Miquel Raynal &lt;miquel.raynal@bootlin.com&gt;
Cc: Jerome Brunet &lt;jbrunet@baylibre.com&gt;
Cc: Russell King &lt;linux@armlinux.org.uk&gt;
Cc: Michael Turquette &lt;mturquette@baylibre.com&gt;
Cc: Jeffrey Hugo &lt;jhugo@codeaurora.org&gt;
Cc: Chen-Yu Tsai &lt;wens@csie.org&gt;
Signed-off-by: Stephen Boyd &lt;sboyd@kernel.org&gt;
</content>
</entry>
<entry>
<title>clk: Introduce of_clk_get_hw_from_clkspec()</title>
<updated>2019-03-01T19:17:22Z</updated>
<author>
<name>Stephen Boyd</name>
<email>sboyd@kernel.org</email>
</author>
<published>2018-12-19T18:59:55Z</published>
<link rel='alternate' type='text/html' href='https://universe.0xinfinity.dev/distro/kernel/commit/?id=4472287a3b2f52f4aa53f294ccb74392dde4e07d'/>
<id>urn:sha1:4472287a3b2f52f4aa53f294ccb74392dde4e07d</id>
<content type='text'>
We want to get struct clk_hw pointers from a DT clk specifier (i.e. a
clocks property) so that we can find parent clks without searching for
globally unique clk names. This should save time by avoiding the global
string search for clks that are external to the clock controller
providing the clk and let us move away from string comparisons in
general.

Introduce of_clk_get_hw_from_clkspec() which is largely the DT parsing
part of finding clks implemented in clkdev.c and have that return a
clk_hw pointer instead of converting that into a clk pointer. This lets
us push up the clk pointer creation to the caller in clk_get() and
avoids the need to push the dev_id and con_id throughout the DT parsing
code.

Cc: Miquel Raynal &lt;miquel.raynal@bootlin.com&gt;
Cc: Jerome Brunet &lt;jbrunet@baylibre.com&gt;
Cc: Russell King &lt;linux@armlinux.org.uk&gt;
Cc: Michael Turquette &lt;mturquette@baylibre.com&gt;
Cc: Jeffrey Hugo &lt;jhugo@codeaurora.org&gt;
Cc: Chen-Yu Tsai &lt;wens@csie.org&gt;
Signed-off-by: Stephen Boyd &lt;sboyd@kernel.org&gt;
</content>
</entry>
<entry>
<title>clk: Combine __clk_get() and __clk_create_clk()</title>
<updated>2019-03-01T19:16:14Z</updated>
<author>
<name>Stephen Boyd</name>
<email>sboyd@kernel.org</email>
</author>
<published>2018-12-11T16:32:04Z</published>
<link rel='alternate' type='text/html' href='https://universe.0xinfinity.dev/distro/kernel/commit/?id=1df4046a93e086f77d244ea47c21591b4acad3e2'/>
<id>urn:sha1:1df4046a93e086f77d244ea47c21591b4acad3e2</id>
<content type='text'>
The __clk_get() function is practically a private clk implementation
detail now. No architecture defines it, and given that new code should
be using the common clk framework there isn't a need for it to keep
existing just to serve clkdev purposes. Let's fold it into the
__clk_create_clk() function and make that a little more generic by
renaming it to clk_hw_create_clk(). This will allow the framework to
create a struct clk handle to a particular clk_hw pointer and link it up
as a consumer wherever that's needed.

Doing this also lets us get rid of the __clk_free_clk() API that had to
be kept in sync with __clk_put(). Splitting that API up into the "link
and unlink from consumer list" phase and "free the clk pointer" phase
allows us to reuse that logic in a couple places, simplifying the code.

Cc: Miquel Raynal &lt;miquel.raynal@bootlin.com&gt;
Cc: Jerome Brunet &lt;jbrunet@baylibre.com&gt;
Cc: Russell King &lt;linux@armlinux.org.uk&gt;
Cc: Michael Turquette &lt;mturquette@baylibre.com&gt;
Cc: Jeffrey Hugo &lt;jhugo@codeaurora.org&gt;
Cc: Chen-Yu Tsai &lt;wens@csie.org&gt;
Signed-off-by: Stephen Boyd &lt;sboyd@kernel.org&gt;
</content>
</entry>
<entry>
<title>clkdev: add managed clkdev lookup registration</title>
<updated>2019-02-06T18:35:02Z</updated>
<author>
<name>Matti Vaittinen</name>
<email>matti.vaittinen@fi.rohmeurope.com</email>
</author>
<published>2018-12-07T11:09:39Z</published>
<link rel='alternate' type='text/html' href='https://universe.0xinfinity.dev/distro/kernel/commit/?id=3eee6c7d119cd8563ad25898f94d6c1b514da548'/>
<id>urn:sha1:3eee6c7d119cd8563ad25898f94d6c1b514da548</id>
<content type='text'>
Clkdev registration lacks of managed registration functions and it
seems few drivers do not drop clkdev lookups at exit. Add
devm_clk_hw_register_clkdev and devm_clk_release_clkdev to ease lookup
releasing at exit.

Signed-off-by: Matti Vaittinen &lt;matti.vaittinen@fi.rohmeurope.com&gt;
Signed-off-by: Stephen Boyd &lt;sboyd@kernel.org&gt;
</content>
</entry>
<entry>
<title>clk: Add comment about __of_clk_get_by_name() error values</title>
<updated>2019-02-06T18:32:42Z</updated>
<author>
<name>Phil Edworthy</name>
<email>phil.edworthy@renesas.com</email>
</author>
<published>2018-12-03T11:13:08Z</published>
<link rel='alternate' type='text/html' href='https://universe.0xinfinity.dev/distro/kernel/commit/?id=5c56dfe63b6e7da3d9fd84a6c553ff4d2753dd1c'/>
<id>urn:sha1:5c56dfe63b6e7da3d9fd84a6c553ff4d2753dd1c</id>
<content type='text'>
It's not immediately obvious from the code that failure to get a
clock provider can return either -ENOENT or -EINVAL. Therefore, add
a comment to highlight this.

Signed-off-by: Phil Edworthy &lt;phil.edworthy@renesas.com&gt;
Reviewed-by: Andy Shevchenko &lt;andriy.shevchenko@linux.intel.com&gt;
Cc: Russell King &lt;linux@armlinux.org.uk&gt;
[sboyd@kernel.org: Fix comment to be proper C with ==]
Signed-off-by: Stephen Boyd &lt;sboyd@kernel.org&gt;
</content>
</entry>
<entry>
<title>ARM: 8778/1: clkdev: don't call __of_clk_get_by_name() unnecessarily from clk_get()</title>
<updated>2018-08-13T15:27:52Z</updated>
<author>
<name>Bartosz Golaszewski</name>
<email>bgolaszewski@baylibre.com</email>
</author>
<published>2018-06-28T14:42:20Z</published>
<link rel='alternate' type='text/html' href='https://universe.0xinfinity.dev/distro/kernel/commit/?id=53ccb22b8d4a9293cf4249f3b526892810038fd3'/>
<id>urn:sha1:53ccb22b8d4a9293cf4249f3b526892810038fd3</id>
<content type='text'>
The way this function is implemented caused some confusion when
converting the TI DaVinci platform to using the common clock framework.

Current kernel supports booting DaVinci boards both in device tree as
well as legacy, board-file mode. In the latter, we always end up
calling clk_get_sys() as of_node is NULL and __of_clk_get_by_name()
returns -ENOENT.

It was not obvious at first glance how clk_get(dev, NULL) will work in
board-file mode since we always call __of_clk_get_by_name(). Let's make
it clearer by checking if of_node is NULL and skipping right to
clk_get_sys().

Cc: Sekhar Nori &lt;nsekhar@ti.com&gt;
Cc: Kevin Hilman &lt;khilman@baylibre.com&gt;
Cc: David Lechner &lt;david@lechnology.com&gt;
Reviewed-by: David Lechner &lt;david@lechnology.com&gt;
Reviewed-by: Sekhar Nori &lt;nsekhar@ti.com&gt;
Signed-off-by: Bartosz Golaszewski &lt;bgolaszewski@baylibre.com&gt;
Signed-off-by: Russell King &lt;rmk+kernel@armlinux.org.uk&gt;
</content>
</entry>
</feed>
