<feed xmlns='http://www.w3.org/2005/Atom'>
<title>linux/drivers/clk/clkdev.c, branch v4.5</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.5</id>
<link rel='self' href='https://git.shady.money/linux/atom?h=v4.5'/>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/'/>
<updated>2015-10-20T16:24:08Z</updated>
<entry>
<title>clkdev: fix clk_add_alias() with a NULL alias device name</title>
<updated>2015-10-20T16:24:08Z</updated>
<author>
<name>Russell King</name>
<email>rmk+kernel@arm.linux.org.uk</email>
</author>
<published>2015-10-20T10:49:44Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=625faa6a720d26fc0db9e20b48dc0dfe4c8d8ddf'/>
<id>urn:sha1:625faa6a720d26fc0db9e20b48dc0dfe4c8d8ddf</id>
<content type='text'>
clk_add_alias() was not correctly handling the case where alias_dev_name
was NULL: rather than producing an entry with a NULL dev_id pointer,
it would produce a device name of (null).  Fix this.

Cc: &lt;stable@vger.kernel.org&gt;
Fixes: 2568999835d7 ("clkdev: add clkdev_create() helper")
Reported-by: Aaro Koskinen &lt;aaro.koskinen@iki.fi&gt;
Tested-by: Aaro Koskinen &lt;aaro.koskinen@iki.fi&gt;
Signed-off-by: Russell King &lt;rmk+kernel@arm.linux.org.uk&gt;
</content>
</entry>
<entry>
<title>clkdev: add clkdev_create() helper</title>
<updated>2015-05-06T10:58:57Z</updated>
<author>
<name>Russell King</name>
<email>rmk+kernel@arm.linux.org.uk</email>
</author>
<published>2015-03-02T15:40:29Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=2568999835d7797afce3dcc3a3f368051ffcaf1f'/>
<id>urn:sha1:2568999835d7797afce3dcc3a3f368051ffcaf1f</id>
<content type='text'>
Add a helper to allocate and add a clk_lookup structure.  This can not
only be used in several places in clkdev.c to simplify the code, but
more importantly, can be used by callers of the clkdev code to simplify
their clkdev creation and registration.

Signed-off-by: Russell King &lt;rmk+kernel@arm.linux.org.uk&gt;
</content>
</entry>
<entry>
<title>clkdev: const-ify connection id to clk_add_alias()</title>
<updated>2015-05-06T10:58:57Z</updated>
<author>
<name>Russell King</name>
<email>rmk+kernel@arm.linux.org.uk</email>
</author>
<published>2015-03-09T10:43:04Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=b3d8d7e89fab374d731dfb46fe048f09766ca9c8'/>
<id>urn:sha1:b3d8d7e89fab374d731dfb46fe048f09766ca9c8</id>
<content type='text'>
The connection id is only passed to clk_get() which is already const.
Const-ify this argument too.

Signed-off-by: Russell King &lt;rmk+kernel@arm.linux.org.uk&gt;
</content>
</entry>
<entry>
<title>clkdev: drop __init from clkdev_add_table()</title>
<updated>2015-05-06T10:58:10Z</updated>
<author>
<name>Russell King</name>
<email>rmk+kernel@arm.linux.org.uk</email>
</author>
<published>2015-03-10T14:34:00Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=fba3acd961ee167a5ffe4c094deccb7d99a0e963'/>
<id>urn:sha1:fba3acd961ee167a5ffe4c094deccb7d99a0e963</id>
<content type='text'>
We want to be able to call clkdev_add_table() from non-init code, so we
need to drop the __init marker from it.

Signed-off-by: Russell King &lt;rmk+kernel@arm.linux.org.uk&gt;
</content>
</entry>
<entry>
<title>clkdev: use clk_hw internally</title>
<updated>2015-05-06T10:58:02Z</updated>
<author>
<name>Russell King</name>
<email>rmk+kernel@arm.linux.org.uk</email>
</author>
<published>2015-03-02T15:45:41Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=d5622a9c13752be46e6fcde9d31391ce0bb0598b'/>
<id>urn:sha1:d5622a9c13752be46e6fcde9d31391ce0bb0598b</id>
<content type='text'>
clk_add_alias() calls clk_get() followed by clk_put() but in between
those two calls it saves away the struct clk pointer to a clk_lookup
structure. This leaves the 'clk' member of the clk_lookup pointing at
freed memory on configurations where CONFIG_COMMON_CLK=y. This is a
problem because clk_get_sys() will eventually try to dereference the
freed pointer by calling __clk_get_hw() on it. Fix this by saving away
the struct clk_hw pointer instead of the struct clk pointer so that when
we try to create a per-user struct clk in clk_get_sys() we don't
dereference a junk pointer.

Signed-off-by: Russell King &lt;rmk+kernel@arm.linux.org.uk&gt;
</content>
</entry>
<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>
</feed>
