<feed xmlns='http://www.w3.org/2005/Atom'>
<title>linux/drivers/clk/clkdev.c, branch v4.1</title>
<subtitle>Mirror of https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/
</subtitle>
<id>https://git.shady.money/linux/atom?h=v4.1</id>
<link rel='self' href='https://git.shady.money/linux/atom?h=v4.1'/>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/'/>
<updated>2015-03-12T19:20:34Z</updated>
<entry>
<title>clk: Replace of_clk_get_by_clkspec() with of_clk_get_from_provider()</title>
<updated>2015-03-12T19:20:34Z</updated>
<author>
<name>Stephen Boyd</name>
<email>sboyd@codeaurora.org</email>
</author>
<published>2015-02-05T23:39:11Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/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:20Z</updated>
<author>
<name>Stephen Boyd</name>
<email>sboyd@codeaurora.org</email>
</author>
<published>2015-02-06T19:42:43Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/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>
<entry>
<title>clkdev: Export clk_register_clkdev</title>
<updated>2015-02-02T22:23:43Z</updated>
<author>
<name>Tomeu Vizoso</name>
<email>tomeu.vizoso@collabora.com</email>
</author>
<published>2015-01-23T11:03:32Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=a251361ac4cc5371a424d70fa0fd591dc9e83a5f'/>
<id>urn:sha1:a251361ac4cc5371a424d70fa0fd591dc9e83a5f</id>
<content type='text'>
So it can be used from modules such as clk-test.ko.

Signed-off-by: Tomeu Vizoso &lt;tomeu.vizoso@collabora.com&gt;
Reviewed-by: Stephen Boyd &lt;sboyd@codeaurora.org&gt;
Signed-off-by: Michael Turquette &lt;mturquette@linaro.org&gt;
</content>
</entry>
<entry>
<title>clk: Make clk API return per-user struct clk instances</title>
<updated>2015-02-02T22:22:19Z</updated>
<author>
<name>Tomeu Vizoso</name>
<email>tomeu.vizoso@collabora.com</email>
</author>
<published>2015-01-23T11:03:30Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=035a61c314eb3dab5bcc5683afaf4d412689858a'/>
<id>urn:sha1:035a61c314eb3dab5bcc5683afaf4d412689858a</id>
<content type='text'>
Moves clock state to struct clk_core, but takes care to change as little API as
possible.

struct clk_hw still has a pointer to a struct clk, which is the
implementation's per-user clk instance, for backwards compatibility.

The struct clk that clk_get_parent() returns isn't owned by the caller, but by
the clock implementation, so the former shouldn't call clk_put() on it.

Because some boards in mach-omap2 still register clocks statically, their clock
registration had to be updated to take into account that the clock information
is stored in struct clk_core now.

Signed-off-by: Tomeu Vizoso &lt;tomeu.vizoso@collabora.com&gt;
Reviewed-by: Stephen Boyd &lt;sboyd@codeaurora.org&gt;
Tested-by: Tony Lindgren &lt;tony@atomide.com&gt;
Signed-off-by: Michael Turquette &lt;mturquette@linaro.org&gt;
[mturquette@linaro.org: adapted clk_has_parent to struct clk_core
                        applied OMAP3+ DPLL fix from Tero &amp; Tony]
</content>
</entry>
<entry>
<title>clkdev: Don't print errors on probe defer</title>
<updated>2014-06-26T19:55:03Z</updated>
<author>
<name>Stephen Boyd</name>
<email>sboyd@codeaurora.org</email>
</author>
<published>2014-06-13T23:36:31Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=d8e53c3deb46ec5b45bd7f5e1cc8ff8d35ec92ba'/>
<id>urn:sha1:d8e53c3deb46ec5b45bd7f5e1cc8ff8d35ec92ba</id>
<content type='text'>
This error message can spam the logs if you have lots of probe
deferals due to missing clocks. Just silence the error in this
case because the driver should try again later.

Signed-off-by: Stephen Boyd &lt;sboyd@codeaurora.org&gt;
Acked-by: Russell King &lt;rmk+kernel@arm.linux.org.uk&gt;
Signed-off-by: Mike Turquette &lt;mturquette@linaro.org&gt;
</content>
</entry>
<entry>
<title>clk: Add of_clk_get_by_clkspec() helper</title>
<updated>2014-05-22T22:54:59Z</updated>
<author>
<name>Sylwester Nawrocki</name>
<email>s.nawrocki@samsung.com</email>
</author>
<published>2014-05-19T17:22:50Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=7f05e28f9dd3eb7a3f27c6f50b715995dc7a88c5'/>
<id>urn:sha1:7f05e28f9dd3eb7a3f27c6f50b715995dc7a88c5</id>
<content type='text'>
This patch adds of_clk_get_by_clkspec() helper function, which does only
a struct clk lookup from the clock providers. It is used in the subsequent
patch where parsing of a clock from device tree and the lookup from
providers needed to be split.

Signed-off-by: Sylwester Nawrocki &lt;s.nawrocki@samsung.com&gt;
Signed-off-by: Mike Turquette &lt;mturquette@linaro.org&gt;
</content>
</entry>
<entry>
<title>clk: return probe defer when DT clock not yet ready</title>
<updated>2014-02-25T01:14:56Z</updated>
<author>
<name>Jean-Francois Moine</name>
<email>moinejf@free.fr</email>
</author>
<published>2013-11-25T18:47:04Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=a34cd4666f3da84228a82f70c94b8d9b692034ea'/>
<id>urn:sha1:a34cd4666f3da84228a82f70c94b8d9b692034ea</id>
<content type='text'>
At probe time, a clock device may not be ready when some other device
wants to use it.

This patch lets the functions clk_get/devm_clk_get return a probe defer
when the clock is defined in the DT but not yet available.

Signed-off-by: Jean-Francois Moine &lt;moinejf@free.fr&gt;
Reviewed-by: Sylwester Nawrocki &lt;s.nawrocki@samsung.com&gt;
Tested-by: Sylwester Nawrocki &lt;s.nawrocki@samsung.com&gt;
Signed-off-by: Mike Turquette &lt;mturquette@linaro.org&gt;
</content>
</entry>
<entry>
<title>clkdev: Fix race condition in clock lookup from device tree</title>
<updated>2013-12-04T16:19:36Z</updated>
<author>
<name>Sylwester Nawrocki</name>
<email>s.nawrocki@samsung.com</email>
</author>
<published>2013-08-23T15:03:44Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=3a3d2b0551d79ef476ef57424beeb8f68789fbcd'/>
<id>urn:sha1:3a3d2b0551d79ef476ef57424beeb8f68789fbcd</id>
<content type='text'>
There is currently a race condition in the device tree part of clk_get()
function, since the pointer returned from of_clk_get_by_name() may become
invalid before __clk_get() call. E.g. due to the clock provider driver
remove() callback being called in between of_clk_get_by_name() and
__clk_get().

Fix this by doing both the look up and __clk_get() operations with the
clock providers list mutex held. This ensures that the clock pointer
returned from __of_clk_get_from_provider() call and passed to __clk_get()
is valid, as long as the clock supplier module first removes its clock
provider instance and then does clk_unregister() on the corresponding
clocks.

Signed-off-by: Sylwester Nawrocki &lt;s.nawrocki@samsung.com&gt;
Signed-off-by: Kyungmin Park &lt;kyungmin.park@samsung.com&gt;
Reviewed-by: Mike Turquette &lt;mturquette@linaro.org&gt;
Acked-by: Russell King &lt;rmk+kernel@arm.linux.org.uk&gt;
</content>
</entry>
<entry>
<title>ARM: 7534/1: clk: Make the managed clk functions generically available</title>
<updated>2012-09-15T20:55:27Z</updated>
<author>
<name>Lars-Peter Clausen</name>
<email>lars@metafoo.de</email>
</author>
<published>2012-09-11T18:56:23Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=8ef997b67f0d779c82e7e533a792c5a6837594cd'/>
<id>urn:sha1:8ef997b67f0d779c82e7e533a792c5a6837594cd</id>
<content type='text'>
The managed clk functions are currently only available when the generic clk
lookup framework is build. But the managed clk functions are merely wrappers
around clk_get and clk_put and do not depend on any specifics of the generic
lookup functions and there are still quite a few custom implementations of the
clk API. So make the managed functions available whenever the clk API is
implemented.

The patch also removes the custom implementation of devm_clk_get for the
coldfire platform.

Signed-off-by: Lars-Peter Clausen &lt;lars@metafoo.de&gt;
Acked-by: Greg Ungerer &lt;gerg@uclinux.org&gt;
Signed-off-by: Russell King &lt;rmk+kernel@arm.linux.org.uk&gt;
</content>
</entry>
<entry>
<title>clk: fix compile for OF &amp;&amp; !COMMON_CLK</title>
<updated>2012-07-19T21:07:56Z</updated>
<author>
<name>Rob Herring</name>
<email>rob.herring@calxeda.com</email>
</author>
<published>2012-07-18T03:52:23Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=137f8a7213d80c1388ca48280c1ef0856b6fec30'/>
<id>urn:sha1:137f8a7213d80c1388ca48280c1ef0856b6fec30</id>
<content type='text'>
With commit 766e6a4ec602d0c107 (clk: add DT clock binding support),
compiling with OF &amp;&amp; !COMMON_CLK is broken.

Reported-by: Alexandre Pereira da Silva &lt;aletes.xgr@gmail.com&gt;
Reported-by: Prashant Gaikwad &lt;pgaikwad@nvidia.com&gt;
Signed-off-by: Rob Herring &lt;rob.herring@calxeda.com&gt;
Signed-off-by: Mike Turquette &lt;mturquette@linaro.org&gt;
</content>
</entry>
</feed>
