<feed xmlns='http://www.w3.org/2005/Atom'>
<title>kernel/linux.git/drivers/clk/clk.h, branch v6.12.80</title>
<subtitle>Linux kernel stable tree (mirror)</subtitle>
<id>https://git.radix-linux.su/kernel/linux.git/atom?h=v6.12.80</id>
<link rel='self' href='https://git.radix-linux.su/kernel/linux.git/atom?h=v6.12.80'/>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/'/>
<updated>2019-07-12T18:00:14+00:00</updated>
<entry>
<title>clk: consoldiate the __clk_get_hw() declarations</title>
<updated>2019-07-12T18:00:14+00:00</updated>
<author>
<name>Stephen Rothwell</name>
<email>sfr@canb.auug.org.au</email>
</author>
<published>2019-07-02T02:03:50+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=1df379924304b687263942452836db1d725155df'/>
<id>urn:sha1:1df379924304b687263942452836db1d725155df</id>
<content type='text'>
Without this we were getting errors like:

In file included from drivers/clk/clkdev.c:22:0:
drivers/clk/clk.h:36:23: error: static declaration of '__clk_get_hw' follows non-static declaration
include/linux/clk-provider.h:808:16: note: previous declaration of '__clk_get_hw' was here

Fixes: 59fcdce425b7 ("clk: Remove ifdef for COMMON_CLK in clk-provider.h")
fixes: 73e0e496afda ("clkdev: Always allocate a struct clk and call __clk_get() w/ CCF")
Signed-off-by: Stephen Rothwell &lt;sfr@canb.auug.org.au&gt;
Signed-off-by: Stephen Boyd &lt;sboyd@kernel.org&gt;
</content>
</entry>
<entry>
<title>clk: Look for parents with clkdev based clk_lookups</title>
<updated>2019-04-19T21:53:00+00:00</updated>
<author>
<name>Stephen Boyd</name>
<email>sboyd@kernel.org</email>
</author>
<published>2019-04-12T18:31:48+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=dde4eff47c82c52a72af333d9e55370eee6d95d6'/>
<id>urn:sha1:dde4eff47c82c52a72af333d9e55370eee6d95d6</id>
<content type='text'>
In addition to looking for DT based parents, support clkdev based
clk_lookups. This should allow non-DT based clk drivers to participate
in the parent lookup process.

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;
Tested-by: Jeffrey Hugo &lt;jhugo@codeaurora.org&gt;
Signed-off-by: Stephen Boyd &lt;sboyd@kernel.org&gt;
</content>
</entry>
<entry>
<title>clk: Move of_clk_*() APIs into clk.c from clkdev.c</title>
<updated>2019-03-01T19:17:22+00:00</updated>
<author>
<name>Stephen Boyd</name>
<email>sboyd@kernel.org</email>
</author>
<published>2018-12-19T23:09:14+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/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:22+00:00</updated>
<author>
<name>Stephen Boyd</name>
<email>sboyd@kernel.org</email>
</author>
<published>2018-12-11T16:34:16+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/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:22+00:00</updated>
<author>
<name>Stephen Boyd</name>
<email>sboyd@kernel.org</email>
</author>
<published>2018-12-19T18:59:55+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/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:14+00:00</updated>
<author>
<name>Stephen Boyd</name>
<email>sboyd@kernel.org</email>
</author>
<published>2018-12-11T16:32:04+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/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>clk: Tag clk core files with SPDX</title>
<updated>2018-12-11T17:57:47+00:00</updated>
<author>
<name>Stephen Boyd</name>
<email>sboyd@kernel.org</email>
</author>
<published>2018-12-11T17:43:03+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=ebafb63dc7759c4cc54065b5aa675080b5f453ce'/>
<id>urn:sha1:ebafb63dc7759c4cc54065b5aa675080b5f453ce</id>
<content type='text'>
These are all GPL-2.0 files per the existing license text. Replace the
boiler plate with the tag.

Signed-off-by: Stephen Boyd &lt;sboyd@kernel.org&gt;
</content>
</entry>
<entry>
<title>clk: Move __clk_{get,put}() into private clk.h API</title>
<updated>2018-01-04T23:13:29+00:00</updated>
<author>
<name>Stephen Boyd</name>
<email>sboyd@codeaurora.org</email>
</author>
<published>2018-01-03T00:54:16+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=bfc0cbfcad122c27aefad0e00da4f383954cf145'/>
<id>urn:sha1:bfc0cbfcad122c27aefad0e00da4f383954cf145</id>
<content type='text'>
We can move these APIs into the private header file now that we
don't have any users of the __clk_get() and __clk_put() APIs
outside of clkdev.c and clk.c.

Cc: Russell King &lt;linux@armlinux.org.uk&gt;
Signed-off-by: Stephen Boyd &lt;sboyd@codeaurora.org&gt;
</content>
</entry>
<entry>
<title>clk: Replace of_clk_get_by_clkspec() with of_clk_get_from_provider()</title>
<updated>2015-03-12T19:20:34+00:00</updated>
<author>
<name>Stephen Boyd</name>
<email>sboyd@codeaurora.org</email>
</author>
<published>2015-02-05T23:39:11+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=306c342f9cb1f573af57a6afd1b3549aa97b9281'/>
<id>urn:sha1:306c342f9cb1f573af57a6afd1b3549aa97b9281</id>
<content type='text'>
of_clk_get_by_clkspec() has the same function signature as
of_clk_get_from_provider()

 struct clk *of_clk_get_by_clkspec(struct of_phandle_args
 *clkspec)
 struct clk *of_clk_get_from_provider(struct of_phandle_args
 *clkspec)

except of_clk_get_by_clkspec() checks to make sure clkspec is not
NULL. Let's remove of_clk_get_by_clkspec() and replace the
callers of it (clkconf.c) with of_clk_get_from_provider().

Cc: Sylwester Nawrocki &lt;s.nawrocki@samsung.com&gt;
Reviewed-by: Tomeu Vizoso &lt;tomeu.vizoso@collabora.com&gt;
Signed-off-by: Stephen Boyd &lt;sboyd@codeaurora.org&gt;
</content>
</entry>
<entry>
<title>clkdev: Always allocate a struct clk and call __clk_get() w/ CCF</title>
<updated>2015-02-07T01:53:20+00:00</updated>
<author>
<name>Stephen Boyd</name>
<email>sboyd@codeaurora.org</email>
</author>
<published>2015-02-06T19:42:43+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=73e0e496afdac9a5190eb3b9c51fdfebcc14ebd4'/>
<id>urn:sha1:73e0e496afdac9a5190eb3b9c51fdfebcc14ebd4</id>
<content type='text'>
of_clk_get_by_clkspec() returns a struct clk pointer but it
doesn't create a new handle for the consumers when we're using
the common clock framework. Instead it just returns whatever the
clk provider hands out. When the consumers go to call clk_put()
we get an Oops.

Unable to handle kernel paging request at virtual address 00200200
pgd = c0004000
[00200200] *pgd=00000000
Internal error: Oops: 805 [#1] PREEMPT SMP ARM
Modules linked in:
CPU: 0 PID: 1 Comm: swapper/0 Not tainted 3.19.0-rc1-00104-ga251361a-dirty #992
Hardware name: SAMSUNG EXYNOS (Flattened Device Tree)
task: ee00b000 ti: ee088000 task.ti: ee088000
PC is at __clk_put+0x24/0xd0
LR is at clk_prepare_lock+0xc/0xec
pc : [&lt;c03eef38&gt;]    lr : [&lt;c03ec1f4&gt;]    psr: 20000153
sp : ee089de8  ip : 00000000  fp : 00000000
r10: ee02f480  r9 : 00000001  r8 : 00000000
r7 : ee031cc0  r6 : ee089e08  r5 : 00000000  r4 : ee02f480
r3 : 00100100  r2 : 00200200  r1 : 0000091e  r0 : 00000001
Flags: nzCv  IRQs on  FIQs off  Mode SVC_32  ISA ARM  Segment kernel
Control: 10c5387d  Table: 4000404a  DAC: 00000015
Process swapper/0 (pid: 1, stack limit = 0xee088238)
Stack: (0xee089de8 to 0xee08a000)
9de0:                   ee7c8f14 c03f0ec8 ee089e08 00000000 c0718dc8 00000001
9e00: 00000000 c04ee0f0 ee7e0844 00000001 00000181 c04edb58 ee2bd320 00000000
9e20: 00000000 c011dc5c ee16a1e0 00000000 00000000 c0718dc8 ee16a1e0 ee2bd1e0
9e40: c0641740 ee16a1e0 00000000 ee2bd320 c0718dc8 ee1d3e10 ee1d3e10 00000000
9e60: c0769a88 00000000 c0718dc8 00000000 00000000 c02c3124 c02c310c ee1d3e10
9e80: c07b4eec 00000000 c0769a88 c02c1d0c ee1d3e10 c0769a88 ee1d3e44 00000000
9ea0: c07091dc c02c1eb8 00000000 c0769a88 c02c1e2c c02c0544 ee005478 ee1676c0
9ec0: c0769a88 ee3a4e80 c0760ce8 c02c150c c0669b90 c0769a88 c0746cd8 c0769a88
9ee0: c0746cd8 ee2bc4c0 c0778c00 c02c24e0 00000000 c0746cd8 c0746cd8 c07091f0
9f00: 00000000 c0008944 c04f405c 00000025 ee00b000 60000153 c074ab00 00000000
9f20: 00000000 c074ab90 60000153 00000000 ef7fca5d c050860c 000000b6 c0036b88
9f40: c065ecc4 c06bc728 00000006 00000006 c074ab30 ef7fca40 c0739bdc 00000006
9f60: c0718dbc c0778c00 000000b6 c0718dc8 c06ed598 c06edd64 00000006 00000006
9f80: c06ed598 c003b438 00000000 c04e64f4 00000000 00000000 00000000 00000000
9fa0: 00000000 c04e64fc 00000000 c000e838 00000000 00000000 00000000 00000000
9fc0: 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000
9fe0: 00000000 00000000 00000000 00000000 00000013 00000000 c0c0c0c0 c0c0c0c0
[&lt;c03eef38&gt;] (__clk_put) from [&lt;c03f0ec8&gt;] (of_clk_set_defaults+0xe0/0x2c0)
[&lt;c03f0ec8&gt;] (of_clk_set_defaults) from [&lt;c02c3124&gt;] (platform_drv_probe+0x18/0xa4)
[&lt;c02c3124&gt;] (platform_drv_probe) from [&lt;c02c1d0c&gt;] (driver_probe_device+0x10c/0x22c)
[&lt;c02c1d0c&gt;] (driver_probe_device) from [&lt;c02c1eb8&gt;] (__driver_attach+0x8c/0x90)
[&lt;c02c1eb8&gt;] (__driver_attach) from [&lt;c02c0544&gt;] (bus_for_each_dev+0x54/0x88)
[&lt;c02c0544&gt;] (bus_for_each_dev) from [&lt;c02c150c&gt;] (bus_add_driver+0xd4/0x1d0)
[&lt;c02c150c&gt;] (bus_add_driver) from [&lt;c02c24e0&gt;] (driver_register+0x78/0xf4)
[&lt;c02c24e0&gt;] (driver_register) from [&lt;c07091f0&gt;] (fimc_md_init+0x14/0x30)
[&lt;c07091f0&gt;] (fimc_md_init) from [&lt;c0008944&gt;] (do_one_initcall+0x80/0x1d0)
[&lt;c0008944&gt;] (do_one_initcall) from [&lt;c06edd64&gt;] (kernel_init_freeable+0x108/0x1d4)
[&lt;c06edd64&gt;] (kernel_init_freeable) from [&lt;c04e64fc&gt;] (kernel_init+0x8/0xec)
[&lt;c04e64fc&gt;] (kernel_init) from [&lt;c000e838&gt;] (ret_from_fork+0x14/0x3c)
Code: ebfff4ae e5943014 e5942018 e3530000 (e5823000)

Let's create a per-user handle here so that clk_put() can
properly unlink it and free the handle. Now that we allocate a
clk structure here we need to free it if __clk_get() fails so
bury the __clk_get() call in __of_clk_get_from_provider(). We
need to handle the same problem in clk_get_sys() so export
__clk_free_clk() to clkdev.c and do the same thing, except let's
use a union to make this code #ifdef free.

This fixes the above crash, properly calls __clk_get() when
of_clk_get_from_provider() is called, and cleans up the clk
structure on the error path of clk_get_sys().

Fixes: 035a61c314eb "clk: Make clk API return per-user struct clk instances"
Reported-by: Sylwester Nawrocki &lt;s.nawrocki@samsung.com&gt;
Reported-by: Alban Browaeys &lt;alban.browaeys@gmail.com&gt;
Tested-by: Sylwester Nawrocki &lt;s.nawrocki@samsung.com&gt;
Tested-by: Alban Browaeys &lt;prahal@yahoo.com&gt;
Reviewed-by: Tomeu Vizoso &lt;tomeu.vizoso@collabora.com&gt;
Signed-off-by: Stephen Boyd &lt;sboyd@codeaurora.org&gt;
Signed-off-by: Michael Turquette &lt;mturquette@linaro.org&gt;
</content>
</entry>
</feed>
